From e60293d6039a24b3d36a35e0b4d938dacd250a49 Mon Sep 17 00:00:00 2001 From: Martin Decky Date: Tue, 17 Oct 2006 15:50:37 +0000 Subject: [PATCH] ppc64: make it compile again --- kernel/arch/ppc64/Makefile.inc | 3 +- .../ppc64/include/{interrupt.h => drivers/pic.h} | 32 +++++----- kernel/arch/ppc64/include/interrupt.h | 11 ++-- .../arch/ppc64/src/{interrupt.c => drivers/pic.c} | 69 ++++++++++++++-------- kernel/arch/ppc64/src/interrupt.c | 39 +++++++++--- 5 files changed, 101 insertions(+), 53 deletions(-) copy kernel/arch/ppc64/include/{interrupt.h => drivers/pic.h} (75%) copy kernel/arch/ppc64/src/{interrupt.c => drivers/pic.c} (58%) diff --git a/kernel/arch/ppc64/Makefile.inc b/kernel/arch/ppc64/Makefile.inc index 8d206f03c..dc7e8d850 100644 --- a/kernel/arch/ppc64/Makefile.inc +++ b/kernel/arch/ppc64/Makefile.inc @@ -69,4 +69,5 @@ ARCH_SOURCES = \ arch/$(ARCH)/src/mm/frame.c \ arch/$(ARCH)/src/mm/memory_init.c \ arch/$(ARCH)/src/mm/page.c \ - arch/$(ARCH)/src/mm/tlb.c + arch/$(ARCH)/src/mm/tlb.c \ + arch/$(ARCH)/src/drivers/pic.c diff --git a/kernel/arch/ppc64/include/interrupt.h b/kernel/arch/ppc64/include/drivers/pic.h similarity index 75% copy from kernel/arch/ppc64/include/interrupt.h copy to kernel/arch/ppc64/include/drivers/pic.h index 931af9768..f05b1eaca 100644 --- a/kernel/arch/ppc64/include/interrupt.h +++ b/kernel/arch/ppc64/include/drivers/pic.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Martin Decky + * Copyright (C) 2006 Ondrej Palkovsky * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,25 +26,27 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** @addtogroup ppc64interrupt +/** @addtogroup ppc64 * @{ */ /** @file */ -#ifndef KERN_ppc64_INTERRUPT_H_ -#define KERN_ppc64_INTERRUPT_H_ - -#include - -#define IRQ_COUNT 1 -#define IVT_ITEMS 15 -#define INT_OFFSET 0 - -#define VECTOR_DECREMENTER 10 - -extern void start_decrementer(void); -extern void interrupt_init(void); +#ifndef KERN_ppc64_PIC_H_ +#define KERN_ppc64_PIC_H_ + +#define PIC_PENDING_LOW 8 +#define PIC_PENDING_HIGH 4 +#define PIC_MASK_LOW 9 +#define PIC_MASK_HIGH 5 +#define PIC_ACK_LOW 10 +#define PIC_ACK_HIGH 6 + +void pic_init(uintptr_t base, size_t size); +void pic_enable_interrupt(int intnum); +void pic_disable_interrupt(int intnum); +void pic_ack_interrupt(int intnum); +int pic_get_pending(void); #endif diff --git a/kernel/arch/ppc64/include/interrupt.h b/kernel/arch/ppc64/include/interrupt.h index 931af9768..7eedd4f3b 100644 --- a/kernel/arch/ppc64/include/interrupt.h +++ b/kernel/arch/ppc64/include/interrupt.h @@ -37,14 +37,17 @@ #include -#define IRQ_COUNT 1 -#define IVT_ITEMS 15 -#define INT_OFFSET 0 +#define IVT_ITEMS 16 +#define IVT_FIRST 0 -#define VECTOR_DECREMENTER 10 +#define VECTOR_DATA_STORAGE 2 +#define VECTOR_INSTRUCTION_STORAGE 3 +#define VECTOR_EXTERNAL 4 +#define VECTOR_DECREMENTER 8 extern void start_decrementer(void); extern void interrupt_init(void); +extern void extint_handler(int n, istate_t *istate); #endif diff --git a/kernel/arch/ppc64/src/interrupt.c b/kernel/arch/ppc64/src/drivers/pic.c similarity index 58% copy from kernel/arch/ppc64/src/interrupt.c copy to kernel/arch/ppc64/src/drivers/pic.c index 5be4f599b..2ea6290eb 100644 --- a/kernel/arch/ppc64/src/interrupt.c +++ b/kernel/arch/ppc64/src/drivers/pic.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Martin Decky + * Copyright (C) 2006 Ondrej Palkovsky * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,49 +26,68 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** @addtogroup ppc64interrupt +/** @addtogroup ppc64 * @{ */ /** @file */ -#include -#include -#include -#include -#include