From 62af4ffa5e89432193a320c26ec77575d94179ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 3 May 2003 12:49:57 +0000 Subject: [PATCH] Added missing or changed/removed outdated PPC headers. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3133 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/ppc/arch_cpu.h | 18 +++++++ headers/private/kernel/arch/ppc/arch_elf.h | 48 +++++++++++++++++++ headers/private/kernel/arch/ppc/arch_kernel.h | 30 ++++++++++++ headers/private/kernel/arch/ppc/arch_stage2.h | 18 +++++++ headers/private/kernel/arch/ppc/arch_thread.h | 8 ++++ headers/private/kernel/arch/ppc/stage2.h | 19 -------- .../private/kernel/arch/ppc/thread_struct.h | 9 ++-- 7 files changed, 126 insertions(+), 24 deletions(-) create mode 100644 headers/private/kernel/arch/ppc/arch_cpu.h create mode 100644 headers/private/kernel/arch/ppc/arch_elf.h create mode 100644 headers/private/kernel/arch/ppc/arch_kernel.h create mode 100644 headers/private/kernel/arch/ppc/arch_stage2.h create mode 100644 headers/private/kernel/arch/ppc/arch_thread.h delete mode 100644 headers/private/kernel/arch/ppc/stage2.h diff --git a/headers/private/kernel/arch/ppc/arch_cpu.h b/headers/private/kernel/arch/ppc/arch_cpu.h new file mode 100644 index 0000000000..5537ef29bd --- /dev/null +++ b/headers/private/kernel/arch/ppc/arch_cpu.h @@ -0,0 +1,18 @@ +/* +** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the OpenBeOS License. +*/ +#ifndef _KERNEL_ARCH_PPC_CPU_H +#define _KERNEL_ARCH_PPC_CPU_H + +#include + +#define PAGE_SIZE 4096 + +#define _BIG_ENDIAN 1 +#define _LITTLE_ENDIAN 0 + +struct iframe { +}; + +#endif /* _KERNEL_ARCH_PPC_CPU_H */ diff --git a/headers/private/kernel/arch/ppc/arch_elf.h b/headers/private/kernel/arch/ppc/arch_elf.h new file mode 100644 index 0000000000..e48245dfad --- /dev/null +++ b/headers/private/kernel/arch/ppc/arch_elf.h @@ -0,0 +1,48 @@ +/* +** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the OpenBeOS License. +*/ +#ifndef _KERNEL_ARCH_PPC_ELF_H +#define _KERNEL_ARCH_PPC_ELF_H + +/* relocation types */ + +#define R_PPC_NONE 0 +#define R_PPC_ADDR32 1 +#define R_PPC_ADDR24 2 +#define R_PPC_ADDR16 3 +#define R_PPC_ADDR16_LO 4 +#define R_PPC_ADDR16_HI 5 +#define R_PPC_ADDR16_HA 6 +#define R_PPC_ADDR14 7 +#define R_PPC_ADDR14_BRTAKEN 8 +#define R_PPC_ADDR14_BRNTAKEN 9 +#define R_PPC_REL24 10 +#define R_PPC_REL14 11 +#define R_PPC_REL14_BRTAKEN 12 +#define R_PPC_REL14_BRNTAKEN 13 +#define R_PPC_GOT16 14 +#define R_PPC_GOT16_LO 15 +#define R_PPC_GOT16_HI 16 +#define R_PPC_GOT16_HA 17 +#define R_PPC_PLTREL24 18 +#define R_PPC_COPY 19 +#define R_PPC_GLOB_DAT 20 +#define R_PPC_JMP_SLOT 21 +#define R_PPC_RELATIVE 22 +#define R_PPC_LOCAL24PC 23 +#define R_PPC_UADDR32 24 +#define R_PPC_UADDR16 25 +#define R_PPC_REL32 26 +#define R_PPC_PLT32 27 +#define R_PPC_PLTREL32 28 +#define R_PPC_PLT16_LO 29 +#define R_PPC_PLT16_HI 30 +#define R_PPC_PLT16_HA 31 +#define R_PPC_SDAREL16 32 +#define R_PPC_SECTOFF 33 +#define R_PPC_SECTOFF_LO 34 +#define R_PPC_SECTOFF_HI 35 +#define R_PPC_SECTOFF_HA 36 + +#endif /* _KERNEL_ARCH_PPC_ELF_H */ diff --git a/headers/private/kernel/arch/ppc/arch_kernel.h b/headers/private/kernel/arch/ppc/arch_kernel.h new file mode 100644 index 0000000000..72ed6b81c6 --- /dev/null +++ b/headers/private/kernel/arch/ppc/arch_kernel.h @@ -0,0 +1,30 @@ +/* +** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. +** Distributed under the terms of the NewOS License. +*/ +#ifndef _KERNEL_ARCH_PPC_KERNEL_H +#define _KERNEL_ARCH_PPC_KERNEL_H + +#include + +// memory layout +#define KERNEL_BASE 0x80000000 +#define KERNEL_SIZE 0x80000000 +#define KERNEL_TOP (KERNEL_BASE + (KERNEL_SIZE - 1)) + +/* +** User space layout is a little special: +** The user space does not completely cover the space not covered by the kernel. +** This is accomplished by starting user space at 1Mb and running to 64kb short of kernel space. +** The lower 1Mb reserved spot makes it easy to find null pointer references and guarantees a +** region wont be placed there. The 64kb region assures a user space thread cannot pass +** a buffer into the kernel as part of a syscall that would cross into kernel space. +*/ +#define USER_BASE 0x100000 +#define USER_SIZE (0x80000000 - (0x10000 + 0x100000)) +#define USER_TOP (USER_BASE + USER_SIZE) + +#define USER_STACK_REGION 0x70000000 +#define USER_STACK_REGION_SIZE (USER_BASE + (USER_SIZE - USER_STACK_REGION)) + +#endif /* _KERNEL_ARCH_PPC_KERNEL_H */ diff --git a/headers/private/kernel/arch/ppc/arch_stage2.h b/headers/private/kernel/arch/ppc/arch_stage2.h new file mode 100644 index 0000000000..af19acee6d --- /dev/null +++ b/headers/private/kernel/arch/ppc/arch_stage2.h @@ -0,0 +1,18 @@ +/* +** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the OpenBeOS License. +*/ +#ifndef _KERNEL_ARCH_PPC_STAGE2_H +#define _KERNEL_ARCH_PPC_STAGE2_H + +#define _PACKED __attribute__((packed)) + +// kernel args +typedef struct { + // architecture specific + addr_range page_table; // maps where the page table is located, in physical memory + addr_range framebuffer; // maps where the framebuffer is located, in physical memory + int screen_x, screen_y, screen_depth; +} arch_kernel_args; + +#endif /* _KERNEL_ARCH_PPC_STAGE2_H */ diff --git a/headers/private/kernel/arch/ppc/arch_thread.h b/headers/private/kernel/arch/ppc/arch_thread.h new file mode 100644 index 0000000000..96805569db --- /dev/null +++ b/headers/private/kernel/arch/ppc/arch_thread.h @@ -0,0 +1,8 @@ +/* +** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the OpenBeOS License. +*/ +#ifndef _KERNEL_ARCH_PPC_THREAD_H +#define _KERNEL_ARCH_PPC_THREAD_H + +#endif /* _KERNEL_ARCH_PPC_THREAD_H */ diff --git a/headers/private/kernel/arch/ppc/stage2.h b/headers/private/kernel/arch/ppc/stage2.h deleted file mode 100644 index c8827d6114..0000000000 --- a/headers/private/kernel/arch/ppc/stage2.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -** Copyright 2001, Travis Geiselbrecht. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ -#ifndef _PPC_STAGE2_H -#define _PPC_STAGE2_H - -#include - -// kernel args -typedef struct { - // architecture specific - addr_range page_table; // maps where the page table is located, in physical memory - addr_range framebuffer; // maps where the framebuffer is located, in physical memory - int screen_x, screen_y, screen_depth; -} arch_kernel_args; - -#endif - diff --git a/headers/private/kernel/arch/ppc/thread_struct.h b/headers/private/kernel/arch/ppc/thread_struct.h index acb398fe1e..66c721a615 100644 --- a/headers/private/kernel/arch/ppc/thread_struct.h +++ b/headers/private/kernel/arch/ppc/thread_struct.h @@ -2,17 +2,16 @@ ** Copyright 2001, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. */ -#ifndef _PPC_THREAD_STRUCT_H -#define _PPC_THREAD_STRUCT_H +#ifndef KERNEL_ARCH_PPC_THREAD_STRUCT_H +#define KERNEL_ARCH_PPC_THREAD_STRUCT_H // architecture specific thread info struct arch_thread { // stack pointer }; -struct arch_proc { +struct arch_team { // nothing here }; -#endif - +#endif /* KERNEL_ARCH_PPC_THREAD_STRUCT_H */