diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-07-26 07:02:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-26 19:46:16 -0400 |
commit | b585e8551b352cee95cf060b7eddc76d16e6120a (patch) | |
tree | 92f5346a503111037a5cbb80b0892b7a04fd97c6 /arch/sparc/include | |
parent | 59b00c792f0302b43e098849febc52386be5fd54 (diff) |
sparc32: centralize all mmu context handling in srmmu.c
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include')
-rw-r--r-- | arch/sparc/include/asm/mmu_context_32.h | 8 | ||||
-rw-r--r-- | arch/sparc/include/asm/pgtable_32.h | 32 |
2 files changed, 3 insertions, 37 deletions
diff --git a/arch/sparc/include/asm/mmu_context_32.h b/arch/sparc/include/asm/mmu_context_32.h index 01456c90072..2df2a9be8f6 100644 --- a/arch/sparc/include/asm/mmu_context_32.h +++ b/arch/sparc/include/asm/mmu_context_32.h | |||
@@ -9,14 +9,12 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
9 | { | 9 | { |
10 | } | 10 | } |
11 | 11 | ||
12 | /* | 12 | /* Initialize a new mmu context. This is invoked when a new |
13 | * Initialize a new mmu context. This is invoked when a new | ||
14 | * address space instance (unique or shared) is instantiated. | 13 | * address space instance (unique or shared) is instantiated. |
15 | */ | 14 | */ |
16 | #define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0) | 15 | int init_new_context(struct task_struct *tsk, struct mm_struct *mm); |
17 | 16 | ||
18 | /* | 17 | /* Destroy a dead context. This occurs when mmput drops the |
19 | * Destroy a dead context. This occurs when mmput drops the | ||
20 | * mm_users count to zero, the mmaps have been released, and | 18 | * mm_users count to zero, the mmaps have been released, and |
21 | * all the page tables have been flushed. Our job is to destroy | 19 | * all the page tables have been flushed. Our job is to destroy |
22 | * any remaining processor-specific state. | 20 | * any remaining processor-specific state. |
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h index c704f949b7e..97a48807361 100644 --- a/arch/sparc/include/asm/pgtable_32.h +++ b/arch/sparc/include/asm/pgtable_32.h | |||
@@ -79,8 +79,6 @@ extern unsigned long ptr_in_current_pgd; | |||
79 | #define __S110 PAGE_SHARED | 79 | #define __S110 PAGE_SHARED |
80 | #define __S111 PAGE_SHARED | 80 | #define __S111 PAGE_SHARED |
81 | 81 | ||
82 | extern int num_contexts; | ||
83 | |||
84 | /* First physical page can be anywhere, the following is needed so that | 82 | /* First physical page can be anywhere, the following is needed so that |
85 | * va-->pa and vice versa conversions work properly without performance | 83 | * va-->pa and vice versa conversions work properly without performance |
86 | * hit for all __pa()/__va() operations. | 84 | * hit for all __pa()/__va() operations. |
@@ -399,36 +397,6 @@ static inline pte_t pgoff_to_pte(unsigned long pgoff) | |||
399 | */ | 397 | */ |
400 | #define PTE_FILE_MAX_BITS 24 | 398 | #define PTE_FILE_MAX_BITS 24 |
401 | 399 | ||
402 | /* | ||
403 | */ | ||
404 | struct ctx_list { | ||
405 | struct ctx_list *next; | ||
406 | struct ctx_list *prev; | ||
407 | unsigned int ctx_number; | ||
408 | struct mm_struct *ctx_mm; | ||
409 | }; | ||
410 | |||
411 | extern struct ctx_list *ctx_list_pool; /* Dynamically allocated */ | ||
412 | extern struct ctx_list ctx_free; /* Head of free list */ | ||
413 | extern struct ctx_list ctx_used; /* Head of used contexts list */ | ||
414 | |||
415 | #define NO_CONTEXT -1 | ||
416 | |||
417 | static inline void remove_from_ctx_list(struct ctx_list *entry) | ||
418 | { | ||
419 | entry->next->prev = entry->prev; | ||
420 | entry->prev->next = entry->next; | ||
421 | } | ||
422 | |||
423 | static inline void add_to_ctx_list(struct ctx_list *head, struct ctx_list *entry) | ||
424 | { | ||
425 | entry->next = head; | ||
426 | (entry->prev = head->prev)->next = entry; | ||
427 | head->prev = entry; | ||
428 | } | ||
429 | #define add_to_free_ctxlist(entry) add_to_ctx_list(&ctx_free, entry) | ||
430 | #define add_to_used_ctxlist(entry) add_to_ctx_list(&ctx_used, entry) | ||
431 | |||
432 | static inline unsigned long | 400 | static inline unsigned long |
433 | __get_phys (unsigned long addr) | 401 | __get_phys (unsigned long addr) |
434 | { | 402 | { |