···99{1010}11111212-/*1313- * Initialize a new mmu context. This is invoked when a new1212+/* Initialize a new mmu context. This is invoked when a new1413 * address space instance (unique or shared) is instantiated.1514 */1616-#define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0)1515+int init_new_context(struct task_struct *tsk, struct mm_struct *mm);17161818-/*1919- * Destroy a dead context. This occurs when mmput drops the1717+/* Destroy a dead context. This occurs when mmput drops the2018 * mm_users count to zero, the mmaps have been released, and2119 * all the page tables have been flushed. Our job is to destroy2220 * any remaining processor-specific state.
-32
arch/sparc/include/asm/pgtable_32.h
···7979#define __S110 PAGE_SHARED8080#define __S111 PAGE_SHARED81818282-extern int num_contexts;8383-8482/* First physical page can be anywhere, the following is needed so that8583 * va-->pa and vice versa conversions work properly without performance8684 * hit for all __pa()/__va() operations.···396398 * This is made a constant because mm/fremap.c required a constant.397399 */398400#define PTE_FILE_MAX_BITS 24399399-400400-/*401401- */402402-struct ctx_list {403403- struct ctx_list *next;404404- struct ctx_list *prev;405405- unsigned int ctx_number;406406- struct mm_struct *ctx_mm;407407-};408408-409409-extern struct ctx_list *ctx_list_pool; /* Dynamically allocated */410410-extern struct ctx_list ctx_free; /* Head of free list */411411-extern struct ctx_list ctx_used; /* Head of used contexts list */412412-413413-#define NO_CONTEXT -1414414-415415-static inline void remove_from_ctx_list(struct ctx_list *entry)416416-{417417- entry->next->prev = entry->prev;418418- entry->prev->next = entry->next;419419-}420420-421421-static inline void add_to_ctx_list(struct ctx_list *head, struct ctx_list *entry)422422-{423423- entry->next = head;424424- (entry->prev = head->prev)->next = entry;425425- head->prev = entry;426426-}427427-#define add_to_free_ctxlist(entry) add_to_ctx_list(&ctx_free, entry)428428-#define add_to_used_ctxlist(entry) add_to_ctx_list(&ctx_used, entry)429401430402static inline unsigned long431403__get_phys (unsigned long addr)
-1
arch/sparc/kernel/setup_32.c
···371371 (*(linux_dbvec->teach_debugger))();372372 }373373374374- init_mm.context = (unsigned long) NO_CONTEXT;375374 init_task.thread.kregs = &fake_swapper_regs;376375377376 /* Run-time patch instructions to match the cpu model */
-6
arch/sparc/mm/fault_32.c
···32323333int show_unhandled_signals = 1;34343535-/* At boot time we determine these two values necessary for setting3636- * up the segment maps and page table entries (pte's).3737- */3838-3939-int num_contexts;4040-4135/* Return how much physical memory we have. */4236unsigned long probe_memory(void)4337{