arch_kernel.h revision 5629675a
1/*
2** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3** Copyright 2019, Adrien Destugues, pulkomandy@pulkomandy.tk
4** Distributed under the terms of the MIT License.
5*/
6#ifndef _KERNEL_ARCH_SPARC_KERNEL_H
7#define _KERNEL_ARCH_SPARC_KERNEL_H
8
9#include <arch/cpu.h>
10
11// memory layout
12#define KERNEL_BASE 0x80000000
13#define KERNEL_SIZE 0x80000000
14#define KERNEL_TOP  (KERNEL_BASE + (KERNEL_SIZE - 1))
15
16/*
17** User space layout is a little special:
18** The user space does not completely cover the space not covered by the kernel.
19** This is accomplished by starting user space at 1Mb and running to 64kb short of kernel space.
20** The lower 1Mb reserved spot makes it easy to find null pointer references and guarantees a
21** region wont be placed there. The 64kb region assures a user space thread cannot pass
22** a buffer into the kernel as part of a syscall that would cross into kernel space.
23*/
24#define USER_BASE     0x100000
25#define USER_BASE_ANY USER_BASE
26#define USER_SIZE     (0x80000000 - (0x10000 + 0x100000))
27#define USER_TOP      (USER_BASE + (USER_SIZE - 1))
28
29#define KERNEL_USER_DATA_BASE	0x60000000
30#define USER_STACK_REGION              0x70000000
31#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)
32
33#endif	/* _KERNEL_ARCH_SPARC_KERNEL_H */
34
35