Changeset 3e828ea in mainline for kernel/arch/ppc32
- Timestamp:
- 2019-09-23T12:49:29Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9be2358
- Parents:
- 9259d20 (diff), 1a4ec93f (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. - git-author:
- Jiri Svoboda <jiri@…> (2019-09-22 12:49:07)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-09-23 12:49:29)
- Location:
- kernel/arch/ppc32
- Files:
-
- 1 deleted
- 6 edited
- 1 moved
-
Makefile.inc (deleted)
-
include/arch/mm/as.h (modified) (1 diff)
-
include/arch/mm/page.h (modified) (2 diffs)
-
meson.build (moved) (moved from uspace/lib/c/arch/amd64/Makefile.common ) (1 diff)
-
src/debug/stacktrace.c (modified) (1 diff)
-
src/drivers/pic.c (modified) (4 diffs)
-
src/interrupt.c (modified) (1 diff)
-
src/ppc32.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/include/arch/mm/as.h
r9259d20 r3e828ea 39 39 40 40 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 0 41 #define KERNEL_SEPARATE_PTL0_ARCH 0 41 42 42 43 #define KERNEL_ADDRESS_SPACE_START_ARCH UINT32_C(0x80000000) -
kernel/arch/ppc32/include/arch/mm/page.h
r9259d20 r3e828ea 37 37 38 38 #include <arch/mm/frame.h> 39 #include <trace.h>40 39 41 40 #define PAGE_WIDTH FRAME_WIDTH … … 150 149 #include <mm/mm.h> 151 150 #include <arch/interrupt.h> 151 #include <trace.h> 152 152 153 153 /** Page Table Entry. */ -
kernel/arch/ppc32/meson.build
r9259d20 r3e828ea 27 27 # 28 28 29 # TODO: We need to implement DWARF unwinding and get rid of this flag. 30 COMMON_CFLAGS += -fno-omit-frame-pointer -Wl,-z,max-page-size=0x1000 29 arch_src += files( 30 'src/context.S', 31 'src/debug/stacktrace.c', 32 'src/debug/stacktrace_asm.S', 33 'src/fpu_context.S', 34 'src/boot/boot.S', 35 'src/ppc32.c', 36 'src/dummy.S', 37 'src/exception.S', 38 'src/interrupt.c', 39 'src/asm.S', 40 'src/cpu/cpu.c', 41 'src/proc/scheduler.c', 42 'src/smc.c', 43 'src/mm/km.c', 44 'src/mm/as.c', 45 'src/mm/frame.c', 46 'src/mm/page.c', 47 'src/mm/pht.c', 48 'src/mm/tlb.c', 49 'src/drivers/pic.c', 50 ) 31 51 32 # XXX: This architecture requires unoptimized TLS pointer access,33 # as with the GCC option `-mno-tls-direct-seg-refs`.34 # The `amd64-helenos` target defaults to this behavior.35 52 36 LDFLAGS += -Wl,--gc-sections 53 _check_headers = [ 54 'include/arch/istate_struct.h', 55 'include/arch/context_struct.h', 56 'include/arch/fpu_context_struct.h', 57 ] 37 58 38 ENDIANESS = LE 39 40 BFD_NAME = elf64-x86-64 41 BFD_ARCH = i386:x86-64 59 foreach h : _check_headers 60 arch_src += [ autocheck.process(h) ] 61 endforeach -
kernel/arch/ppc32/src/debug/stacktrace.c
r9259d20 r3e828ea 67 67 bool uspace_frame_pointer_prev(stack_trace_context_t *ctx, uintptr_t *prev) 68 68 { 69 return !copy_from_uspace( (void *)prev,70 (uint32_t *) ctx->fp +FRAME_OFFSET_FP_PREV, sizeof(*prev));69 return !copy_from_uspace(prev, 70 ctx->fp + sizeof(uintptr_t) * FRAME_OFFSET_FP_PREV, sizeof(*prev)); 71 71 } 72 72 73 73 bool uspace_return_address_get(stack_trace_context_t *ctx, uintptr_t *ra) 74 74 { 75 return !copy_from_uspace( (void *)ra,76 (uint32_t *) ctx->fp +FRAME_OFFSET_RA, sizeof(*ra));75 return !copy_from_uspace(ra, 76 ctx->fp + sizeof(uintptr_t) * FRAME_OFFSET_RA, sizeof(*ra)); 77 77 } 78 78 -
kernel/arch/ppc32/src/drivers/pic.c
r9259d20 r3e828ea 37 37 #include <byteorder.h> 38 38 #include <bitops.h> 39 #include <typedefs.h> 39 40 40 static volatile uint32_t *pic = NULL;41 static ioport32_t *pic = NULL; 41 42 42 43 void pic_init(uintptr_t base, size_t size, cir_t *cir, void **cir_arg) … … 50 51 void pic_enable_interrupt(inr_t intnum) 51 52 { 52 if (pic) { 53 if (intnum < 32) 54 pic[PIC_MASK_LOW] = pic[PIC_MASK_LOW] | (1 << intnum); 55 else 56 pic[PIC_MASK_HIGH] = pic[PIC_MASK_HIGH] | (1 << (intnum - 32)); 53 if (!pic) 54 return; 55 56 if (intnum < 32) { 57 pio_write_32(&pic[PIC_MASK_LOW], 58 pio_read_32(&pic[PIC_MASK_LOW]) | (1 << intnum)); 59 } else { 60 pio_write_32(&pic[PIC_MASK_HIGH], 61 pio_read_32(&pic[PIC_MASK_HIGH]) | (1 << (intnum - 32))); 57 62 } 58 59 63 } 60 64 61 65 void pic_disable_interrupt(inr_t intnum) 62 66 { 63 if (pic) { 64 if (intnum < 32) 65 pic[PIC_MASK_LOW] = pic[PIC_MASK_LOW] & (~(1 << intnum)); 66 else 67 pic[PIC_MASK_HIGH] = pic[PIC_MASK_HIGH] & (~(1 << (intnum - 32))); 67 if (!pic) 68 return; 69 70 if (intnum < 32) { 71 pio_write_32(&pic[PIC_MASK_LOW], 72 pio_read_32(&pic[PIC_MASK_LOW]) & (~(1 << intnum))); 73 } else { 74 pio_write_32(&pic[PIC_MASK_HIGH], 75 pio_read_32(&pic[PIC_MASK_HIGH]) & (~(1 << (intnum - 32)))); 68 76 } 69 77 } … … 71 79 void pic_ack_interrupt(void *arg, inr_t intnum) 72 80 { 73 if (pic) { 74 if (intnum < 32) 75 pic[PIC_ACK_LOW] = 1 << intnum; 76 else 77 pic[PIC_ACK_HIGH] = 1 << (intnum - 32); 81 if (!pic) 82 return; 83 84 if (intnum < 32) { 85 pio_write_32(&pic[PIC_ACK_LOW], 1 << intnum); 86 } else { 87 pio_write_32(&pic[PIC_ACK_HIGH], 1 << (intnum - 32)); 78 88 } 79 89 } … … 87 97 uint32_t pending; 88 98 89 pending = pi c[PIC_PENDING_LOW];99 pending = pio_read_32(&pic[PIC_PENDING_LOW]); 90 100 if (pending != 0) 91 101 return fnzb32(pending); 92 102 93 pending = pi c[PIC_PENDING_HIGH];103 pending = pio_read_32(&pic[PIC_PENDING_HIGH]); 94 104 if (pending != 0) 95 105 return fnzb32(pending) + 32; -
kernel/arch/ppc32/src/interrupt.c
r9259d20 r3e828ea 141 141 " (inum=%" PRIu8 ")", CPU->id, inum); 142 142 #endif 143 pic_ack_interrupt(NULL, inum); 144 break; 143 145 } 144 146 } -
kernel/arch/ppc32/src/ppc32.c
r9259d20 r3e828ea 292 292 void userspace(uspace_arg_t *kernel_uarg) 293 293 { 294 userspace_asm( (uintptr_t)kernel_uarg->uspace_uarg,295 (uintptr_t)kernel_uarg->uspace_stack +294 userspace_asm(kernel_uarg->uspace_uarg, 295 kernel_uarg->uspace_stack + 296 296 kernel_uarg->uspace_stack_size - SP_DELTA, 297 (uintptr_t)kernel_uarg->uspace_entry);297 kernel_uarg->uspace_entry); 298 298 299 299 unreachable();
Note:
See TracChangeset
for help on using the changeset viewer.
