Changeset ef9a2a8 in mainline for kernel/arch/sparc32/src
- Timestamp:
- 2013-09-15T19:23:19Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3efc35a
- Parents:
- b6b02c0
- Location:
- kernel/arch/sparc32/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc32/src/mm/as.c
rb6b02c0 ref9a2a8 1 1 /* 2 * Copyright (c) 201 0 Martin Decky2 * Copyright (c) 2013 Jakub Klama 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup abs32lemm29 /** @addtogroup sparc32mm 30 30 * @{ 31 31 */ 32 32 33 33 #include <mm/as.h> 34 #include <arch/arch.h> 35 #include <arch/asm.h> 34 36 #include <arch/mm/as.h> 37 #include <arch/mm/page.h> 35 38 #include <genarch/mm/page_pt.h> 39 40 static ptd_t context_table[ASID_MAX_ARCH] __attribute__((aligned (1024))); 36 41 37 42 void as_arch_init(void) 38 43 { 39 44 as_operations = &as_pt_operations; 45 as_context_table = (uintptr_t)&context_table; 46 } 47 48 void as_install_arch(as_t *as) 49 { 50 printf("as_install_arch(asid=%d)\n", as->asid); 51 printf("genarch.page_table=%p\n", as->genarch.page_table); 52 53 context_table[as->asid].table_pointer = (uintptr_t)as->genarch.page_table >> 6; 54 context_table[as->asid].et = PTE_ET_DESCRIPTOR; 55 asi_u32_write(ASI_MMUREGS, 0x200, as->asid); 40 56 } 41 57 -
kernel/arch/sparc32/src/mm/frame.c
rb6b02c0 ref9a2a8 48 48 //machine_get_memory_extents(&base, &size); 49 49 base = 0x40000000; 50 size = 0x 2000000;50 size = 0x4000000; 51 51 52 52 base = ALIGN_UP(base, FRAME_SIZE); -
kernel/arch/sparc32/src/mm/page.c
rb6b02c0 ref9a2a8 49 49 #include <print.h> 50 50 #include <interrupt.h> 51 #include <macros.h> 51 52 52 53 void page_arch_init(void) 53 54 { 54 if (config.cpu_active == 1) 55 page_mapping_operations = &pt_mapping_operations; 55 int flags = PAGE_CACHEABLE | PAGE_EXEC; 56 page_mapping_operations = &pt_mapping_operations; 57 58 page_table_lock(AS_KERNEL, true); 59 60 /* Kernel identity mapping */ 61 //FIXME: We need to consider the possibility that 62 //identity_base > identity_size and physmem_end. 63 //This might lead to overflow if identity_size is too big. 64 for (uintptr_t cur = PHYSMEM_START_ADDR; 65 cur < min(KA2PA(config.identity_base) + 66 config.identity_size, config.physmem_end); 67 cur += FRAME_SIZE) 68 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); 69 70 71 page_table_unlock(AS_KERNEL, true); 72 as_switch(NULL, AS_KERNEL); 73 74 printf("as_context_table=0x%08x\n", as_context_table); 75 76 /* Switch MMU to new context table */ 77 asi_u32_write(ASI_MMUREGS, 0x100, KA2PA(as_context_table) >> 4); 78 79 //boot_page_table_free(); 56 80 } 57 81 -
kernel/arch/sparc32/src/sparc32.c
rb6b02c0 ref9a2a8 49 49 #include <syscall/syscall.h> 50 50 #include <console/console.h> 51 #include <macros.h> 51 52 #include <memstr.h> 53 #include <str.h> 52 54 53 55 char memcpy_from_uspace_failover_address; 54 56 char memcpy_to_uspace_failover_address; 55 57 56 void arch_pre_main( void)58 void arch_pre_main(bootinfo_t *bootinfo) 57 59 { 60 init.cnt = min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); 61 62 size_t i; 63 for (i = 0; i < init.cnt; i++) { 64 init.tasks[i].paddr = KA2PA(bootinfo->tasks[i].addr); 65 init.tasks[i].size = bootinfo->tasks[i].size; 66 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, 67 bootinfo->tasks[i].name); 68 } 58 69 } 59 70 -
kernel/arch/sparc32/src/start.S
rb6b02c0 ref9a2a8 51 51 sub %sp, 96, %sp 52 52 53 mov %o1, %i0 53 54 call arch_pre_main 54 55 nop
Note:
See TracChangeset
for help on using the changeset viewer.
