aboutsummaryrefslogtreecommitdiff
path: root/i686/gdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'i686/gdt.c')
-rw-r--r--i686/gdt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/i686/gdt.c b/i686/gdt.c
index c0898f3..3148096 100644
--- a/i686/gdt.c
+++ b/i686/gdt.c
@@ -4,11 +4,11 @@ void
SegmentDescriptor(struct SegmentDescriptor_t *self, unsigned base, unsigned limit, uint8_t access)
{
self->base_15_0 = base & 0xffff;
- self->base_23_16 = (base >> 16) & 0xff;
- self->base_31_24 = (base >> 24) & 0xff;
+ self->base_23_16 = (uint8_t)(base >> 16);
+ self->base_31_24 = (uint8_t)(base >> 24);
self->limit_15_0 = (limit <= 0xffff) ? (limit & 0xffff) : ((limit >> 12) & 0xffff);
- self->limit_19_16 = (limit <= 0xffff) ? 0 : ((limit >> 28) & 0xf);
+ self->limit_19_16 = 0xfu & (uint8_t)((limit <= 0xffff) ? 0 : (limit >> 28));
self->access = access;