MFi386: r190447
Convert gdt_segs and ldt_segs initialization to C99 style.
This commit is contained in:
parent
fc9e668b4b
commit
ba46cd63d8
@ -1308,234 +1308,234 @@ extern vm_offset_t proc0kstack;
|
|||||||
*/
|
*/
|
||||||
struct soft_segment_descriptor gdt_segs[] = {
|
struct soft_segment_descriptor gdt_segs[] = {
|
||||||
/* GNULL_SEL 0 Null Descriptor */
|
/* GNULL_SEL 0 Null Descriptor */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0x0, /* length */
|
.ssd_limit = 0x0,
|
||||||
0, /* segment type */
|
.ssd_type = 0,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
0, /* segment descriptor present */
|
.ssd_p = 0,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* GPRIV_SEL 1 SMP Per-Processor Private Data Descriptor */
|
/* GPRIV_SEL 1 SMP Per-Processor Private Data Descriptor */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GUFS_SEL 2 %fs Descriptor for user */
|
/* GUFS_SEL 2 %fs Descriptor for user */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
SEL_UPL, /* segment descriptor priority level */
|
.ssd_dpl = SEL_UPL,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GUGS_SEL 3 %gs Descriptor for user */
|
/* GUGS_SEL 3 %gs Descriptor for user */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
SEL_UPL, /* segment descriptor priority level */
|
.ssd_dpl = SEL_UPL,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GCODE_SEL 4 Code Descriptor for kernel */
|
/* GCODE_SEL 4 Code Descriptor for kernel */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMERA, /* segment type */
|
.ssd_type = SDT_MEMERA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GDATA_SEL 5 Data Descriptor for kernel */
|
/* GDATA_SEL 5 Data Descriptor for kernel */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GUCODE_SEL 6 Code Descriptor for user */
|
/* GUCODE_SEL 6 Code Descriptor for user */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMERA, /* segment type */
|
.ssd_type = SDT_MEMERA,
|
||||||
SEL_UPL, /* segment descriptor priority level */
|
.ssd_dpl = SEL_UPL,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GUDATA_SEL 7 Data Descriptor for user */
|
/* GUDATA_SEL 7 Data Descriptor for user */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
SEL_UPL, /* segment descriptor priority level */
|
.ssd_dpl = SEL_UPL,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GBIOSLOWMEM_SEL 8 BIOS access to realmode segment 0x40, must be #8 in GDT */
|
/* GBIOSLOWMEM_SEL 8 BIOS access to realmode segment 0x40, must be #8 in GDT */
|
||||||
{ 0x400, /* segment base address */
|
{ .ssd_base = 0x400,
|
||||||
0xfffff, /* length */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GPROC0_SEL 9 Proc 0 Tss Descriptor */
|
/* GPROC0_SEL 9 Proc 0 Tss Descriptor */
|
||||||
{
|
{
|
||||||
0x0, /* segment base address */
|
.ssd_base = 0x0,
|
||||||
sizeof(struct i386tss)-1,/* length */
|
.ssd_limit = sizeof(struct i386tss)-1,
|
||||||
SDT_SYS386TSS, /* segment type */
|
.ssd_type = SDT_SYS386TSS,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* unused - default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* GLDT_SEL 10 LDT Descriptor */
|
/* GLDT_SEL 10 LDT Descriptor */
|
||||||
{ (int) ldt, /* segment base address */
|
{ .ssd_base = (int) ldt,
|
||||||
sizeof(ldt)-1, /* length - all address space */
|
.ssd_limit = sizeof(ldt)-1,
|
||||||
SDT_SYSLDT, /* segment type */
|
.ssd_type = SDT_SYSLDT,
|
||||||
SEL_UPL, /* segment descriptor priority level */
|
.ssd_dpl = SEL_UPL,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* unused - default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* GUSERLDT_SEL 11 User LDT Descriptor per process */
|
/* GUSERLDT_SEL 11 User LDT Descriptor per process */
|
||||||
{ (int) ldt, /* segment base address */
|
{ .ssd_base = (int) ldt,
|
||||||
(512 * sizeof(union descriptor)-1), /* length */
|
.ssd_limit = (512 * sizeof(union descriptor)-1),
|
||||||
SDT_SYSLDT, /* segment type */
|
.ssd_type = SDT_SYSLDT,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* unused - default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* GPANIC_SEL 12 Panic Tss Descriptor */
|
/* GPANIC_SEL 12 Panic Tss Descriptor */
|
||||||
{ (int) &dblfault_tss, /* segment base address */
|
{ .ssd_base = (int) &dblfault_tss,
|
||||||
sizeof(struct i386tss)-1,/* length - all address space */
|
.ssd_limit = sizeof(struct i386tss)-1,
|
||||||
SDT_SYS386TSS, /* segment type */
|
.ssd_type = SDT_SYS386TSS,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* unused - default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* GBIOSCODE32_SEL 13 BIOS 32-bit interface (32bit Code) */
|
/* GBIOSCODE32_SEL 13 BIOS 32-bit interface (32bit Code) */
|
||||||
{ 0, /* segment base address (overwritten) */
|
{ .ssd_base = 0,
|
||||||
0xfffff, /* length */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMERA, /* segment type */
|
.ssd_type = SDT_MEMERA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GBIOSCODE16_SEL 14 BIOS 32-bit interface (16bit Code) */
|
/* GBIOSCODE16_SEL 14 BIOS 32-bit interface (16bit Code) */
|
||||||
{ 0, /* segment base address (overwritten) */
|
{ .ssd_base = 0,
|
||||||
0xfffff, /* length */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMERA, /* segment type */
|
.ssd_type = SDT_MEMERA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GBIOSDATA_SEL 15 BIOS 32-bit interface (Data) */
|
/* GBIOSDATA_SEL 15 BIOS 32-bit interface (Data) */
|
||||||
{ 0, /* segment base address (overwritten) */
|
{ .ssd_base = 0,
|
||||||
0xfffff, /* length */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GBIOSUTIL_SEL 16 BIOS 16-bit interface (Utility) */
|
/* GBIOSUTIL_SEL 16 BIOS 16-bit interface (Utility) */
|
||||||
{ 0, /* segment base address (overwritten) */
|
{ .ssd_base = 0,
|
||||||
0xfffff, /* length */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GBIOSARGS_SEL 17 BIOS 16-bit interface (Arguments) */
|
/* GBIOSARGS_SEL 17 BIOS 16-bit interface (Arguments) */
|
||||||
{ 0, /* segment base address (overwritten) */
|
{ .ssd_base = 0,
|
||||||
0xfffff, /* length */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* GNDIS_SEL 18 NDIS Descriptor */
|
/* GNDIS_SEL 18 NDIS Descriptor */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0x0, /* length */
|
.ssd_limit = 0x0,
|
||||||
0, /* segment type */
|
.ssd_type = 0,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
0, /* segment descriptor present */
|
.ssd_p = 0,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct soft_segment_descriptor ldt_segs[] = {
|
static struct soft_segment_descriptor ldt_segs[] = {
|
||||||
/* Null Descriptor - overwritten by call gate */
|
/* Null Descriptor - overwritten by call gate */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0x0, /* length - all address space */
|
.ssd_limit = 0x0,
|
||||||
0, /* segment type */
|
.ssd_type = 0,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
0, /* segment descriptor present */
|
.ssd_p = 0,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* Null Descriptor - overwritten by call gate */
|
/* Null Descriptor - overwritten by call gate */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0x0, /* length - all address space */
|
.ssd_limit = 0x0,
|
||||||
0, /* segment type */
|
.ssd_type = 0,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
0, /* segment descriptor present */
|
.ssd_p = 0,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* Null Descriptor - overwritten by call gate */
|
/* Null Descriptor - overwritten by call gate */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0x0, /* length - all address space */
|
.ssd_limit = 0x0,
|
||||||
0, /* segment type */
|
.ssd_type = 0,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
0, /* segment descriptor present */
|
.ssd_p = 0,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* Code Descriptor for user */
|
/* Code Descriptor for user */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMERA, /* segment type */
|
.ssd_type = SDT_MEMERA,
|
||||||
SEL_UPL, /* segment descriptor priority level */
|
.ssd_dpl = SEL_UPL,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
/* Null Descriptor - overwritten by call gate */
|
/* Null Descriptor - overwritten by call gate */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0x0, /* length - all address space */
|
.ssd_limit = 0x0,
|
||||||
0, /* segment type */
|
.ssd_type = 0,
|
||||||
0, /* segment descriptor priority level */
|
.ssd_dpl = 0,
|
||||||
0, /* segment descriptor present */
|
.ssd_p = 0,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
0, /* default 32 vs 16 bit size */
|
.ssd_def32 = 0,
|
||||||
0 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 0 },
|
||||||
/* Data Descriptor for user */
|
/* Data Descriptor for user */
|
||||||
{ 0x0, /* segment base address */
|
{ .ssd_base = 0x0,
|
||||||
0xfffff, /* length - all address space */
|
.ssd_limit = 0xfffff,
|
||||||
SDT_MEMRWA, /* segment type */
|
.ssd_type = SDT_MEMRWA,
|
||||||
SEL_UPL, /* segment descriptor priority level */
|
.ssd_dpl = SEL_UPL,
|
||||||
1, /* segment descriptor present */
|
.ssd_p = 1,
|
||||||
0, 0,
|
.ssd_xx = 0, .ssd_xx1 = 0,
|
||||||
1, /* default 32 vs 16 bit size */
|
.ssd_def32 = 1,
|
||||||
1 /* limit granularity (byte/page units)*/ },
|
.ssd_gran = 1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user