Changeset 778c1e1 in mainline
- Timestamp:
- 2006-02-22T14:52:18Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7d53ef4
- Parents:
- effee6f
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc32/include/mm/memory_init.h
reffee6f r778c1e1 30 30 #define __ppc32_MEMORY_INIT_H__ 31 31 32 #include < config.h>32 #include <typedefs.h> 33 33 34 34 size_t get_memory_size(void); 35 35 void preboot_read_config(void); 36 void ppc_init_zones(void);37 36 38 37 #endif -
arch/ppc32/src/mm/frame.c
reffee6f r778c1e1 30 30 #include <arch/mm/memory_init.h> 31 31 #include <mm/frame.h> 32 #include <config.h> 33 #include <panic.h> 32 #include <genarch/ofw/memory_init.h> 34 33 35 34 void frame_arch_init(void) 36 35 { 37 ppc_init_zones();36 ofw_init_zones(); 38 37 /* First is exception vector, second is 'implementation specific' */ 39 38 frame_mark_unavailable(0, 2); -
arch/ppc32/src/mm/memory_init.c
reffee6f r778c1e1 28 28 29 29 #include <arch/mm/memory_init.h> 30 #include <genarch/ofw/ofw.h> 31 #include <panic.h> 32 #include <mm/frame.h> 33 #include <align.h> 34 35 #define MEMMAP_MAX_RECORDS 32 36 37 typedef struct { 38 __u32 start; 39 __u32 size; 40 } memmap_t; 41 42 static memmap_t memmap[MEMMAP_MAX_RECORDS]; 43 size_t total_mem = 0; 44 45 static void init_memmap(void) 46 { 47 int i; 48 49 phandle handle = ofw_find_device("/memory"); 50 if (handle == -1) 51 panic("No RAM\n"); 52 53 size_t ret = ofw_get_property(handle, "reg", &memmap, sizeof(memmap)); 54 if (ret == -1) 55 panic("Device /memory has no reg property\n"); 56 57 58 for (i = 0; i < MEMMAP_MAX_RECORDS; i++) { 59 if (memmap[i].size == 0) 60 break; 61 total_mem += memmap[i].size; 62 } 63 } 30 #include <genarch/ofw/memory_init.h> 31 #include <typedefs.h> 64 32 65 33 void preboot_read_config(void) 66 34 { 67 init_memmap();35 ofw_init_memmap(); 68 36 } 69 37 70 38 size_t get_memory_size(void) 71 39 { 72 return total_mem;40 return ofw_get_memory_size(); 73 41 } 74 75 void ppc_init_zones(void)76 {77 int i;78 pfn_t confdata;79 80 for (i = 0; i < MEMMAP_MAX_RECORDS; i++) {81 if (memmap[i].size == 0)82 break;83 confdata = ADDR2PFN(memmap[i].start);84 if (confdata == 0)85 confdata = 2;86 zone_create(ADDR2PFN(memmap[i].start),87 SIZE2FRAMES(ALIGN_DOWN(memmap[i].size,PAGE_SIZE)),88 confdata, 0);89 }90 } -
arch/sparc64/Makefile.inc
reffee6f r778c1e1 69 69 arch/$(ARCH)/src/mm/page.c \ 70 70 arch/$(ARCH)/src/mm/tlb.c \ 71 arch/$(ARCH)/src/mm/memory_init.c \ 71 72 arch/$(ARCH)/src/sparc64.c \ 72 73 arch/$(ARCH)/src/start.S \ -
arch/sparc64/include/mm/memory_init.h
reffee6f r778c1e1 30 30 #define __sparc64_MEMORY_INIT_H__ 31 31 32 #include < config.h>32 #include <typedefs.h> 33 33 34 #define get_memory_size() CONFIG_MEMORY_SIZE 34 extern size_t get_memory_size(void); 35 35 36 36 #endif -
arch/sparc64/include/trap/mmu.h
reffee6f r778c1e1 40 40 #define FAST_MMU_HANDLER_SIZE 128 41 41 42 #ifdef __ASM__ 42 43 .macro FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER 43 44 call fast_instruction_access_mmu_miss … … 57 58 retry 58 59 .endm 60 #endif /* __ASM__ */ 59 61 60 62 #endif -
arch/sparc64/src/mm/frame.c
reffee6f r778c1e1 28 28 29 29 #include <arch/mm/frame.h> 30 #include <genarch/ofw/memory_init.h> 30 31 #include <mm/frame.h> 31 32 #include <config.h> … … 34 35 void frame_arch_init(void) 35 36 { 36 zone_create(0, config.memory_size >> FRAME_WIDTH, 1, 0);37 ofw_init_zones(); 37 38 38 39 /* -
arch/sparc64/src/start.S
reffee6f r778c1e1 99 99 stx %o4, [%l0] 100 100 101 call ofw_init_memmap 102 nop 103 101 104 call main_bsp 102 105 nop -
arch/sparc64/src/trap/trap.c
reffee6f r778c1e1 32 32 #include <arch/trap/exception.h> 33 33 #include <arch/trap/interrupt.h> 34 #include <arch/trap/mmu.h> 34 35 #include <arch/asm.h> 35 36 #include <memstr.h> … … 81 82 trap_install_handler(TT_INTERRUPT_LEVEL_15, INTERRUPT_LEVEL_N_HANDLER_SIZE, false); 82 83 trap_install_handler(TT_INTERRUPT_VECTOR_TRAP, INTERRUPT_VECTOR_TRAP_HANDLER_SIZE, false); 84 85 /* 86 * Kernel must become independent on Open Firmware calls before MMU handlers are enabled. 87 */ 88 /* 89 trap_install_handler(TT_FAST_INSTRUCTION_ACCESS_MMU_MISS, FAST_MMU_HANDLER_SIZE, false); 90 trap_install_handler(TT_FAST_DATA_ACCESS_MMU_MISS, FAST_MMU_HANDLER_SIZE, false); 91 trap_install_handler(TT_FAST_DATA_ACCESS_PROTECTION, FAST_MMU_HANDLER_SIZE, false); 92 trap_install_handler(TT_FAST_INSTRUCTION_ACCESS_MMU_MISS, FAST_MMU_HANDLER_SIZE, true); 93 trap_install_handler(TT_FAST_DATA_ACCESS_MMU_MISS, FAST_MMU_HANDLER_SIZE, true); 94 trap_install_handler(TT_FAST_DATA_ACCESS_PROTECTION, FAST_MMU_HANDLER_SIZE, true); 95 */ 96 83 97 } 84 98 -
genarch/Makefile.inc
reffee6f r778c1e1 31 31 ifeq ($(CONFIG_OFW),y) 32 32 GENARCH_SOURCES += \ 33 genarch/src/ofw/ofw.c 33 genarch/src/ofw/ofw.c \ 34 genarch/src/ofw/memory_init.c 34 35 endif 35 36 ifeq ($(CONFIG_ACPI),y)
Note:
See TracChangeset
for help on using the changeset viewer.