Changeset 4d0f97d in mainline for kernel/arch/arm32/src
- Timestamp:
- 2010-07-16T14:23:41Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e2650d3
- Parents:
- aa0d227 (diff), 24697c3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- kernel/arch/arm32/src
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/exc_handler.S
raa0d227 r4d0f97d 96 96 ldmfd r3!, {r4-r7} 97 97 stmfd r13!, {r4-r7} 98 stmfd r13!, {r13, lr}^ 98 mov r4, r13 99 stmfd r4, {r13, lr}^ 100 nop /* Cannot access r13 immediately after stm(2) */ 101 sub r13, r13, #8 99 102 stmfd r13!, {r2} 100 103 … … 137 140 138 141 # return to user mode 139 ldmfd r13!, {r13, lr}^ 142 mov r0, r13 143 ldmfd r0, {r13, lr}^ 144 nop /* Cannot access r13 immediately after ldm(2) */ 145 add r13, r13, #8 140 146 b 2f 141 147 -
kernel/arch/arm32/src/interrupt.c
raa0d227 r4d0f97d 40 40 #include <ddi/device.h> 41 41 #include <interrupt.h> 42 43 /** Initial size of a table holding interrupt handlers. */44 #define IRQ_COUNT 845 42 46 43 /** Disable interrupts. … … 105 102 void interrupt_init(void) 106 103 { 107 irq_init(IRQ_COUNT, IRQ_COUNT); 104 size_t irq_count; 105 106 irq_count = machine_get_irq_count(); 107 irq_init(irq_count, irq_count); 108 108 109 machine_timer_irq_start(); 109 110 } -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
raa0d227 r4d0f97d 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
raa0d227 r4d0f97d 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_extents(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. */ … … 210 211 unsigned int i; 211 212 212 for (i = 0; i < GXEMUL_IRQ C_MAX_IRQ; i++) {213 for (i = 0; i < GXEMUL_IRQ_COUNT; i++) { 213 214 if (sources & (1 << i)) { 214 215 irq_t *irq = irq_dispatch_and_lock(i); -
kernel/arch/arm32/src/machine_func.c
raa0d227 r4d0f97d 39 39 40 40 #include <arch/machine_func.h> 41 #include <arch/mach/gta02/gta02.h> 41 42 #include <arch/mach/integratorcp/integratorcp.h> 42 43 #include <arch/mach/testarm/testarm.h> … … 48 49 void machine_ops_init(void) 49 50 { 50 #if defined(MACHINE_testarm) 51 #if defined(MACHINE_gta02) 52 machine_ops = >a02_machine_ops; 53 #elif defined(MACHINE_testarm) 51 54 machine_ops = &gxemul_machine_ops; 52 55 #elif defined(MACHINE_integratorcp) … … 77 80 } 78 81 79 80 /** Returns size of available memory. 82 /** Get extents of available memory. 81 83 * 82 * @return Size of available memory. 84 * @param start Place to store memory start address. 85 * @param size Place to store memory size. 83 86 */ 84 uintptr_t machine_get_memory_size(void)87 void machine_get_memory_extents(uintptr_t *start, uintptr_t *size) 85 88 { 86 return (machine_ops->machine_get_memory_size)();89 (machine_ops->machine_get_memory_extents)(start, size); 87 90 } 88 91 … … 122 125 } 123 126 127 /** Get IRQ number range used by machine. */ 128 size_t machine_get_irq_count(void) 129 { 130 size_t irq_count; 131 132 #if defined(MACHINE_gta02) 133 irq_count = GTA02_IRQ_COUNT; 134 #elif defined(MACHINE_testarm) 135 irq_count = GXEMUL_IRQ_COUNT; 136 #elif defined(MACHINE_integratorcp) 137 irq_count = ICP_IRQ_COUNT; 138 #else 139 #error Machine type not defined. 140 #endif 141 return irq_count; 142 } 143 124 144 /** @} 125 145 */ -
kernel/arch/arm32/src/mm/frame.c
raa0d227 r4d0f97d 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 >> FRAME_WIDTH, num_frames, 51 59 BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0); 52 60 -
kernel/arch/arm32/src/mm/page.c
raa0d227 r4d0f97d 58 58 uintptr_t cur; 59 59 /* Kernel identity mapping */ 60 for (cur = 0; cur < last_frame; cur += FRAME_SIZE)60 for (cur = PHYSMEM_START_ADDR; cur < last_frame; cur += FRAME_SIZE) 61 61 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); 62 62 … … 68 68 #error "Only high exception vector supported now" 69 69 #endif 70 cur = ALIGN_DOWN(0x50008010, FRAME_SIZE); 71 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); 70 72 71 73 page_table_unlock(AS_KERNEL, true); -
kernel/arch/arm32/src/userspace.c
raa0d227 r4d0f97d 97 97 "mov sp, %[ustate]\n" 98 98 "msr spsr_c, %[user_mode]\n" 99 "ldmfd sp!, {r0-r12, sp, lr}^\n" 99 "ldmfd sp, {r0-r12, sp, lr}^\n" 100 "nop\n" /* Cannot access sp immediately after ldm(2) */ 101 "add sp, sp, #(15*4)\n" 100 102 "ldmfd sp!, {pc}^\n" 101 103 :: [ustate] "r" (&ustate), [user_mode] "r" (user_mode)
Note:
See TracChangeset
for help on using the changeset viewer.