|
[ source navigation ] [ diff markup ] [ identifier search ] [ general search ] |
|||
|
001 /* Copyright (C) 2004 The SOS Team 002 Copyright (C) 1999 Free Software Foundation, Inc. 003 004 This program is free software; you can redistribute it and/or 005 modify it under the terms of the GNU General Public License 006 as published by the Free Software Foundation; either version 2 007 of the License, or (at your option) any later version. 008 009 This program is distributed in the hope that it will be useful, 010 but WITHOUT ANY WARRANTY; without even the implied warranty of 011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 GNU General Public License for more details. 013 014 You should have received a copy of the GNU General Public License 015 along with this program; if not, write to the Free Software 016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 017 USA. 018 */ 019 #ifndef _SOS_HWSEGS_H_ 020 #define _SOS_HWSEGS_H_ 021 022 /** 023 * @file segments.h 024 * 025 * Global and local (GDT/LDT) segment descriptor definition and 026 * structure. These segments map virtual addresses (ie 027 * data/instruction addresses, relative to these segment descriptors) 028 * to linear addresses (ie addresses in the paged-memory space). 029 * 030 * @see Intel x86 doc, vol 3 chapter 3. 031 */ 032 033 #include <sos/types.h> 034 035 /* 036 * Global segment selectors (GDT) for SOS/x86. 037 * 038 * @see gdt.h 039 */ 040 #define SOS_SEG_NULL 0 /* NULL segment, unused by the procesor */ 041 #define SOS_SEG_KCODE 1 /* Kernel code segment */ 042 #define SOS_SEG_KDATA 2 /* Kernel data segment */ 043 044 045 /** 046 * Helper macro that builds a segment register's value 047 */ 048 #define SOS_BUILD_SEGMENT_REG_VALUE(desc_privilege,in_ldt,seg_index) \ 049 ( (((desc_privilege) & 0x3) << 0) \ 050 | (((in_ldt)?1:0) << 2) \ 051 | ((seg_index) << 3) ) 052 053 054 /* 055 * Local segment selectors (LDT) for SOS/x86 056 */ 057 /* None */ 058 059 #endif /* _SOS_HWSEGS_H_ */
[ source navigation ] | [ diff markup ] | [ identifier search ] | [ general search ] |