/branches/fs/kernel/arch/ppc32/include/types.h |
---|
62,7 → 62,6 |
typedef int32_t native_t; |
typedef uint8_t bool; |
typedef uint64_t thread_id_t; |
typedef uint64_t task_id_t; |
typedef uint32_t context_id_t; |
/branches/fs/kernel/arch/ppc32/src/mm/as.c |
---|
54,8 → 54,12 |
void as_install_arch(as_t *as) |
{ |
asid_t asid; |
ipl_t ipl; |
uint32_t sr; |
ipl = interrupts_disable(); |
spinlock_lock(&as->lock); |
asid = as->asid; |
/* Lower 2 GB, user and supervisor access */ |
75,6 → 79,9 |
: "r" ((0x4000 << 16) + (asid << 4) + sr), "r" (sr << 28) |
); |
} |
spinlock_unlock(&as->lock); |
interrupts_restore(ipl); |
} |
/** @} |
/branches/fs/kernel/arch/ppc32/src/mm/page.c |
---|
53,7 → 53,7 |
uintptr_t virtaddr = PA2KA(last_frame); |
pfn_t i; |
for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) |
page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE); |
page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE); |
last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); |
/branches/fs/kernel/arch/ppc32/src/drivers/cuda.c |
---|
48,8 → 48,7 |
#define PACKET_ADB 0x00 |
#define PACKET_CUDA 0x01 |
#define CUDA_POWERDOWN 0x0a |
#define CUDA_RESET 0x11 |
#define CUDA_POWERDOWN 0x0a |
#define RS 0x200 |
#define B (0 * RS) |
192,6 → 191,9 |
}; |
void send_packet(const uint8_t kind, index_t count, ...); |
static void receive_packet(uint8_t *kind, index_t count, uint8_t data[]) |
{ |
cuda[B] = cuda[B] & ~TIP; |
314,7 → 316,7 |
} |
static void send_packet(const uint8_t kind, count_t count, ...) |
void send_packet(const uint8_t kind, index_t count, ...) |
{ |
index_t i; |
va_list va; |
339,17 → 341,13 |
void cpu_halt(void) { |
#ifdef CONFIG_POWEROFF |
send_packet(PACKET_CUDA, 1, CUDA_POWERDOWN); |
#endif |
asm volatile ( |
"b 0\n" |
); |
} |
void arch_reboot(void) { |
send_packet(PACKET_CUDA, 1, CUDA_RESET); |
asm volatile ( |
"b 0\n" |
); |
} |
/** @} |
*/ |
/branches/fs/kernel/arch/ppc32/src/interrupt.c |
---|
60,19 → 60,11 |
int inum; |
while ((inum = pic_get_pending()) != -1) { |
bool ack = false; |
irq_t *irq = irq_dispatch_and_lock(inum); |
if (irq) { |
/* |
* The IRQ handler was found. |
*/ |
if (irq->preack) { |
/* Acknowledge the interrupt before processing */ |
pic_ack_interrupt(inum); |
ack = true; |
} |
irq->handler(irq, irq->arg); |
spinlock_unlock(&irq->lock); |
} else { |
83,9 → 75,7 |
printf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, inum); |
#endif |
} |
if (!ack) |
pic_ack_interrupt(inum); |
pic_ack_interrupt(inum); |
} |
} |