[25] | 1 | /* |
---|
| 2 | * hal_boot.S - Kernel boot entry point |
---|
| 3 | * |
---|
| 4 | * Author Maxime Villard (2017) |
---|
| 5 | * |
---|
| 6 | * Copyright (c) UPMC Sorbonne Universites |
---|
| 7 | * |
---|
| 8 | * This file is part of ALMOS-kernel. |
---|
| 9 | * |
---|
| 10 | * ALMOS-kernel is free software; you can redistribute it and/or modify it |
---|
| 11 | * under the terms of the GNU General Public License as published by |
---|
| 12 | * the Free Software Foundation; version 2.0 of the License. |
---|
| 13 | * |
---|
| 14 | * ALMOS-kernel is distributed in the hope that it will be useful, but |
---|
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 17 | * General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with ALMOS-kernel; if not, write to the Free Software Foundation, |
---|
| 21 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | /* |
---|
| 25 | * Selectors |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | #define ISPL(s) ((s) & SEL_RPL) /* what is the priority level of a selector */ |
---|
| 29 | #define SEL_KPL 0 /* kernel privilege level */ |
---|
| 30 | #define SEL_UPL 3 /* user privilege level */ |
---|
| 31 | #define SEL_RPL 3 /* requester's privilege level mask */ |
---|
| 32 | #define ISLDT(s) ((s) & SEL_LDT) /* is it local or global */ |
---|
| 33 | #define SEL_LDT 4 /* local descriptor table */ |
---|
| 34 | |
---|
| 35 | #define GSEL(s,r) (((s) << 3) | r) |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | /* |
---|
| 40 | * Entries in the Global Descriptor Table (GDT). They remain static. |
---|
| 41 | */ |
---|
| 42 | #define GNULL_SEL 0 /* Null descriptor */ |
---|
| 43 | #define GCODE_SEL 1 /* Kernel code descriptor */ |
---|
| 44 | #define GDATA_SEL 2 /* Kernel data descriptor */ |
---|
| 45 | #define GUCODE_SEL 3 /* User code descriptor */ |
---|
| 46 | #define GUDATA_SEL 4 /* User data descriptor */ |
---|
| 47 | |
---|