Changeset d7ef14b in mainline
- Timestamp:
- 2010-06-25T20:58:06Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 12b0d51
- Parents:
- 1590e23
- Location:
- kernel/arch/arm32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/_link.ld.in
r1590e23 rd7ef14b 7 7 */ 8 8 9 #ifdef MACHINE_gta02 10 #define KERNEL_LOAD_ADDRESS 0xb0a08000 11 #else 9 12 #define KERNEL_LOAD_ADDRESS 0x80a00000 13 #endif 10 14 11 15 OUTPUT_ARCH(arm) -
kernel/arch/arm32/include/machine_func.h
r1590e23 rd7ef14b 47 47 48 48 struct arm_machine_ops { 49 void 50 void 51 void 52 uintptr_t (*machine_get_memory_size)(void);53 void (*machine_irq_exception)(unsigned int, istate_t*);54 void 55 void 56 void 49 void (*machine_init)(void); 50 void (*machine_timer_irq_start)(void); 51 void (*machine_cpu_halt)(void); 52 void (*machine_get_memory_extents)(uintptr_t *, uintptr_t *); 53 void (*machine_irq_exception)(unsigned int, istate_t *); 54 void (*machine_frame_init)(void); 55 void (*machine_output_init)(void); 56 void (*machine_input_init)(void); 57 57 }; 58 58 … … 74 74 extern void machine_cpu_halt(void); 75 75 76 77 /** Returns size of available memory. 76 /** Get extents of available memory. 78 77 * 79 * @return Size of available memory. 78 * @param start Place to store memory start address. 79 * @param size Place to store memory size. 80 80 */ 81 extern uintptr_t machine_get_memory_size(void); 82 81 extern void machine_get_memory_extents(uintptr_t *start, uintptr_t *size); 83 82 84 83 /** Interrupt exception handler. -
kernel/arch/arm32/src/mach/gta02/gta02.c
r1590e23 rd7ef14b 36 36 #include <arch/exception.h> 37 37 #include <arch/mach/gta02/gta02.h> 38 #include <arch/mm/page.h> 39 40 #define GTA02_MEMORY_START 0x30000000 /* physical */ 41 #define GTA02_MEMORY_SIZE 0x08000000 /* 128 MB */ 42 #define GTA02_MEMORY_SKIP 0x8000 /* 2 pages */ 38 43 39 44 static void gta02_init(void); 40 45 static void gta02_timer_irq_start(void); 41 46 static void gta02_cpu_halt(void); 42 static uintptr_t gta02_get_memory_size(void);47 static void gta02_get_memory_extents(uintptr_t *start, uintptr_t *size); 43 48 static void gta02_irq_exception(unsigned int exc_no, istate_t *istate); 44 49 static void gta02_frame_init(void); … … 50 55 gta02_timer_irq_start, 51 56 gta02_cpu_halt, 52 gta02_get_memory_ size,57 gta02_get_memory_extents, 53 58 gta02_irq_exception, 54 59 gta02_frame_init, … … 69 74 } 70 75 71 static uintptr_t gta02_get_memory_size(void) 76 /** Get extents of available memory. 77 * 78 * @param start Place to store memory start address. 79 * @param size Place to store memory size. 80 */ 81 static void gta02_get_memory_extents(uintptr_t *start, uintptr_t *size) 72 82 { 73 return 0; 83 *start = PA2KA(GTA02_MEMORY_START) + GTA02_MEMORY_SKIP; 84 *size = GTA02_MEMORY_SIZE - GTA02_MEMORY_SKIP; 74 85 } 75 86 -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
r1590e23 rd7ef14b 60 60 icp_timer_irq_start, 61 61 icp_cpu_halt, 62 icp_get_memory_ size,62 icp_get_memory_extents, 63 63 icp_irq_exception, 64 64 icp_frame_init, … … 214 214 } 215 215 216 /** Returns the size of emulated memory. 217 * 218 * @return Size in bytes. 219 */ 220 size_t icp_get_memory_size(void) 221 { 216 /** Get extents of available memory. 217 * 218 * @param start Place to store memory start address. 219 * @param size Place to store memory size. 220 */ 221 void icp_get_memory_extents(uintptr_t *start, uintptr_t *size) 222 { 223 *start = 0; 224 222 225 if (hw_map_init_called) { 223 return (sdram[((*(uint32_t *)icp_hw_map.sdramcr & ICP_SDRAM_MASK) >> 2)]); 226 *size = (sdram[((*(uint32_t *)icp_hw_map.sdramcr & 227 ICP_SDRAM_MASK) >> 2)]); 224 228 } else { 225 return SDRAM_SIZE; 226 } 227 229 *size = SDRAM_SIZE; 230 } 228 231 } 229 232 -
kernel/arch/arm32/src/mach/testarm/testarm.c
r1590e23 rd7ef14b 60 60 gxemul_timer_irq_start, 61 61 gxemul_cpu_halt, 62 gxemul_get_memory_ size,62 gxemul_get_memory_extents, 63 63 gxemul_irq_exception, 64 64 gxemul_frame_init, … … 185 185 } 186 186 187 /** Returns the size of emulated memory. 188 * 189 * @return Size in bytes. 190 */ 191 uintptr_t gxemul_get_memory_size(void) 192 { 193 return *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET)); 194 } 195 187 /** Get extents of available memory. 188 * 189 * @param start Place to store memory start address. 190 * @param size Place to store memory size. 191 */ 192 void gxemul_get_memory_size(uintptr_t *start, uintptr_t *size) 193 { 194 start = 0; 195 size = *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET)); 196 } 196 197 197 198 /** Returns the mask of active interrupts. */ -
kernel/arch/arm32/src/machine_func.c
r1590e23 rd7ef14b 80 80 } 81 81 82 83 /** Returns size of available memory. 82 /** Get extents of available memory. 84 83 * 85 * @return Size of available memory. 84 * @param start Place to store memory start address. 85 * @param size Place to store memory size. 86 86 */ 87 uintptr_t machine_get_memory_size(void)87 void machine_get_memory_extents(uintptr_t *start, uintptr_t *size) 88 88 { 89 return (machine_ops->machine_get_memory_size)();89 (machine_ops->machine_get_memory_extents)(start, size); 90 90 } 91 91 -
kernel/arch/arm32/src/mm/frame.c
r1590e23 rd7ef14b 38 38 #include <arch/machine_func.h> 39 39 #include <config.h> 40 #include <align.h> 40 41 41 42 /** Address of the last frame in the memory. */ … … 45 46 void frame_arch_init(void) 46 47 { 47 last_frame = machine_get_memory_size(); 48 uintptr_t mem_start, mem_size; 49 uintptr_t first_frame; 50 uintptr_t num_frames; 51 52 machine_get_memory_extents(&mem_start, &mem_size); 53 first_frame = ALIGN_UP(mem_start, FRAME_SIZE); 54 last_frame = ALIGN_DOWN(mem_start + mem_size, FRAME_SIZE); 55 num_frames = (last_frame - first_frame) >> FRAME_WIDTH; 48 56 49 57 /* All memory as one zone */ 50 zone_create( 0, ADDR2PFN(last_frame),58 zone_create(first_frame, num_frames, 51 59 BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0); 52 60
Note:
See TracChangeset
for help on using the changeset viewer.