scoutos / prex-0.9.0 / include / arm / syspage.h @ 03e9c04a
History | View | Annotate | Download (3.3 KB)
1 |
/*-
|
---|---|
2 |
* Copyright (c) 2008-2009, Kohsuke Ohtani
|
3 |
* All rights reserved.
|
4 |
*
|
5 |
* Redistribution and use in source and binary forms, with or without
|
6 |
* modification, are permitted provided that the following conditions
|
7 |
* are met:
|
8 |
* 1. Redistributions of source code must retain the above copyright
|
9 |
* notice, this list of conditions and the following disclaimer.
|
10 |
* 2. Redistributions in binary form must reproduce the above copyright
|
11 |
* notice, this list of conditions and the following disclaimer in the
|
12 |
* documentation and/or other materials provided with the distribution.
|
13 |
* 3. Neither the name of the author nor the names of any co-contributors
|
14 |
* may be used to endorse or promote products derived from this software
|
15 |
* without specific prior written permission.
|
16 |
*
|
17 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
18 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
19 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
20 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
21 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
22 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
23 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
24 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
25 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
26 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
27 |
* SUCH DAMAGE.
|
28 |
*/
|
29 |
|
30 |
#ifndef _ARM_SYSPAGE_H
|
31 |
#define _ARM_SYSPAGE_H
|
32 |
|
33 |
#include <conf/config.h> |
34 |
|
35 |
/**
|
36 |
* syspage layout:
|
37 |
*
|
38 |
* +------------------+ CONFIG_SYSPAGE_BASE
|
39 |
* | Vector page |
|
40 |
* | |
|
41 |
* +------------------+ +0x1000
|
42 |
* | Interrupt stack |
|
43 |
* | |
|
44 |
* +------------------+ +0x2000
|
45 |
* | Sys mode stack |
|
46 |
* | |
|
47 |
* +------------------+ +0x3000
|
48 |
* | Boot information |
|
49 |
* +------------------+ +0x3400
|
50 |
* | Abort mode stack |
|
51 |
* +------------------+ +0x3800
|
52 |
* | Boot stack |
|
53 |
* +------------------+ +0x4000
|
54 |
* | PGD for boot |
|
55 |
* | (MMU only) |
|
56 |
* | |
|
57 |
* +------------------+ +0x8000
|
58 |
* | PTE0 for boot |
|
59 |
* | (MMU only) |
|
60 |
* +------------------+ +0x9000
|
61 |
* | PTE1 for UART I/O|
|
62 |
* | (MMU only) |
|
63 |
* +------------------+ +0xA000
|
64 |
|
65 |
*
|
66 |
* Note1: Kernel PGD must be stored at 16k aligned address.
|
67 |
*
|
68 |
* Note2: PTE0 must be stored at 4k aligned address.
|
69 |
*
|
70 |
* Note2: Interrupt stack should be placed after NULL page
|
71 |
* to detect the stack overflow.
|
72 |
*/
|
73 |
|
74 |
#define SYSPAGE CONFIG_SYSPAGE_BASE
|
75 |
#define INTSTK (SYSPAGE + 0x1000) |
76 |
#define SYSSTK (SYSPAGE + 0x2000) |
77 |
#define BOOTINFO (SYSPAGE + 0x3000) |
78 |
#define ABTSTK (SYSPAGE + 0x3400) |
79 |
#define BOOTSTK (SYSPAGE + 0x3800) |
80 |
#define BOOT_PGD (SYSPAGE + 0x4000) |
81 |
#define BOOT_PTE0 (SYSPAGE + 0x8000) |
82 |
#define BOOT_PTE1 (SYSPAGE + 0x9000) |
83 |
|
84 |
#define BOOT_PGD_PHYS 0x4000 |
85 |
#define BOOT_PTE0_PHYS 0x8000 |
86 |
#define BOOT_PTE1_PHYS 0x9000 |
87 |
|
88 |
#define INTSTKSZ 0x1000 |
89 |
#define SYSSTKSZ 0x1000 |
90 |
#define ABTSTKSZ 0x400 |
91 |
#define BOOTSTKSZ 0x800 |
92 |
|
93 |
#define INTSTKTOP (INTSTK + INTSTKSZ)
|
94 |
#define SYSSTKTOP (SYSSTK + SYSSTKSZ)
|
95 |
#define ABTSTKTOP (ABTSTK + ABTSTKSZ)
|
96 |
#define BOOTSTKTOP (BOOTSTK + BOOTSTKSZ)
|
97 |
|
98 |
#ifdef CONFIG_MMU
|
99 |
#define SYSPAGESZ 0xA000 |
100 |
#else
|
101 |
#define SYSPAGESZ 0x4000 |
102 |
#endif
|
103 |
|
104 |
#endif /* !_ARM_SYSPAGE_H */ |