Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48971
b: refs/heads/master
c: 9d99df4
h: refs/heads/master
i:
  48969: 027420d
  48967: 990c47c
v: v3
  • Loading branch information
Catalin Marinas authored and Russell King committed Feb 8, 2007
1 parent 202ab16 commit 494df81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 620879c9e33262426db0ade650be5d7a2046377b
refs/heads/master: 9d99df4b10eef130dacb5f772cd589c625b03634
12 changes: 10 additions & 2 deletions trunk/arch/arm/mm/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ unsigned int cpu_last_asid = { 1 << ASID_BITS };
/*
* We fork()ed a process, and we need a new context for the child
* to run in. We reserve version 0 for initial tasks so we will
* always allocate an ASID.
* always allocate an ASID. The ASID 0 is reserved for the TTBR
* register changing sequence.
*/
void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
Expand All @@ -38,8 +39,15 @@ void __new_context(struct mm_struct *mm)
* If we've used up all our ASIDs, we need
* to start a new version and flush the TLB.
*/
if ((asid & ~ASID_MASK) == 0)
if ((asid & ~ASID_MASK) == 0) {
asid = ++cpu_last_asid;
/* set the reserved ASID before flushing the TLB */
asm("mcr p15, 0, %0, c13, c0, 1 @ set reserved context ID\n"
:
: "r" (0));
isb();
flush_tlb_all();
}

mm->context.id = asid;
}

0 comments on commit 494df81

Please sign in to comment.