It is accomplished ...

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
ejakowatz
2002-07-09 12:24:59 +00:00
commit 52a3801208
2025 changed files with 472889 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _PPC_CPU_H
#define _PPC_CPU_H
#define PAGE_SIZE 4096
#endif
+28
View File
@@ -0,0 +1,28 @@
/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _PPC_KERNEL_H
#define _PPC_KERNEL_H
// 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
+11
View File
@@ -0,0 +1,11 @@
/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _PPC_KTYPES_H
#define _PPC_KTYPES_H
typedef unsigned long addr;
#endif
+19
View File
@@ -0,0 +1,19 @@
/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _PPC_STAGE2_H
#define _PPC_STAGE2_H
#include <boot/stage2_struct.h>
// 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
@@ -0,0 +1,43 @@
/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _STAGE2_PRIV_H
#define _STAGE2_PRIV_H
#define LOAD_ADDR 0x100000
#define BOOTDIR_ADDR 0x101000
int s2_text_init();
void s2_change_framebuffer_addr(unsigned int address);
void putchar(char c);
void puts(char *str);
int printf(const char *fmt, ...);
int of_init(void *of_entry);
int of_open(const char *node_name);
int of_finddevice(const char *dev);
int of_instance_to_package(int in_handle);
int of_getprop(int handle, const char *prop, void *buf, int buf_len);
int of_setprop(int handle, const char *prop, const void *buf, int buf_len);
int of_read(int handle, void *buf, int buf_len);
int of_write(int handle, void *buf, int buf_len);
int of_seek(int handle, long long pos);
int s2_mmu_init();
void mmu_map_page(unsigned int vsid, unsigned long pa, unsigned long va);;
void syncicache(void *address, int len);
void s2_faults_init(kernel_args *ka);
void getibats(int bats[8]);
void setibats(int bats[8]);
void getdbats(int bats[8]);
void setdbats(int bats[8]);
unsigned int *getsdr1();
void setsdr1(unsigned int sdr);
unsigned int getsr(int sr);
unsigned int getmsr();
void setmsr(unsigned int msr);
#endif
@@ -0,0 +1,18 @@
/*
** 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
// architecture specific thread info
struct arch_thread {
// stack pointer
};
struct arch_proc {
// nothing here
};
#endif
+18
View File
@@ -0,0 +1,18 @@
/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _PPC_TYPES_H
#define _PPC_TYPES_H
typedef unsigned long long uint64;
typedef long long int64;
typedef unsigned int uint32;
typedef int int32;
typedef unsigned short uint16;
typedef short int16;
typedef unsigned char uint8;
typedef char int8;
#endif