Rev 110 | Rev 113 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 110 | Rev 112 | ||
---|---|---|---|
Line 69... | Line 69... | ||
69 | struct ptr_16_32 gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt) }; |
69 | struct ptr_16_32 gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt) }; |
70 | struct ptr_16_32 idtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(idt), .base = KA2PA((__address) idt) }; |
70 | struct ptr_16_32 idtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(idt), .base = KA2PA((__address) idt) }; |
71 | 71 | ||
72 | void gdt_setbase(struct descriptor *d, __address base) |
72 | void gdt_setbase(struct descriptor *d, __address base) |
73 | { |
73 | { |
74 | d->base_0_15 = KA2PA(base) & 0xffff; |
74 | d->base_0_15 = base & 0xffff; |
75 | d->base_16_23 = (KA2PA(base) >> 16) & 0xff; |
75 | d->base_16_23 = ((base) >> 16) & 0xff; |
76 | d->base_24_31 = (KA2PA(base) >> 24) & 0xff; |
76 | d->base_24_31 = ((base) >> 24) & 0xff; |
77 | 77 | ||
78 | } |
78 | } |
79 | 79 | ||
80 | void gdt_setlimit(struct descriptor *d, __u32 limit) |
80 | void gdt_setlimit(struct descriptor *d, __u32 limit) |
81 | { |
81 | { |
Line 83... | Line 83... | ||
83 | d->limit_16_19 = (limit >> 16) & 0xf; |
83 | d->limit_16_19 = (limit >> 16) & 0xf; |
84 | } |
84 | } |
85 | 85 | ||
86 | void idt_setoffset(struct idescriptor *d, __address offset) |
86 | void idt_setoffset(struct idescriptor *d, __address offset) |
87 | { |
87 | { |
- | 88 | /* |
|
- | 89 | * Offset is a linear address. |
|
- | 90 | */ |
|
88 | d->offset_0_15 = KA2PA(offset) & 0xffff; |
91 | d->offset_0_15 = offset & 0xffff; |
89 | d->offset_16_31 = KA2PA(offset) >> 16; |
92 | d->offset_16_31 = offset >> 16; |
90 | } |
93 | } |
91 | 94 | ||
92 | void tss_initialize(struct tss *t) |
95 | void tss_initialize(struct tss *t) |
93 | { |
96 | { |
94 | memsetb((__address) t, sizeof(struct tss), 0); |
97 | memsetb((__address) t, sizeof(struct tss), 0); |