Changeset 3e828ea in mainline for kernel/arch/ppc32/src
- 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/src
- Files:
-
- 4 edited
-
debug/stacktrace.c (modified) (1 diff)
-
drivers/pic.c (modified) (4 diffs)
-
interrupt.c (modified) (1 diff)
-
ppc32.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
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.
