Browse Source

:wrench: 修复了一些隐式类型转换

fslongjin 3 years ago
parent
commit
012948d345
3 changed files with 4 additions and 5 deletions
  1. 1 1
      kernel/common/printk.c
  2. 0 1
      kernel/common/printk.h
  3. 3 3
      kernel/exception/gate.h

+ 1 - 1
kernel/common/printk.c

@@ -346,7 +346,7 @@ static int vsprintf(char *buf, const char *fmt, va_list args)
             if (qualifier == 'l')
                 ip = va_arg(args, long long *);
             else
-                ip = va_arg(args, int *);
+                ip = (ll*)va_arg(args, int *);
 
             *ip = str - buf;
             break;

+ 0 - 1
kernel/common/printk.h

@@ -122,4 +122,3 @@ static void putchar(unsigned int *fb, int Xsize, int x, int y, unsigned int FRco
 #define printk(...) printk_color( WHITE, BLACK, __VA_ARGS__ )
 
 int printk_color(unsigned int FRcolor, unsigned int BKcolor, const char*fmt, ...);
-

+ 3 - 3
kernel/exception/gate.h

@@ -76,7 +76,7 @@ void set_gate(ul *gate_selector_addr, ul attr, unsigned char ist, ul *code_addr)
  */
 void set_intr_gate(unsigned int n, unsigned char ist, void *addr)
 {
-    set_gate(IDT_Table + n, 0x8E, ist, &addr); // p=1,DPL=0, type=E
+    set_gate((ul*)(IDT_Table + n), 0x8E, ist, (ul*)(&addr)); // p=1,DPL=0, type=E
 }
 
 /**
@@ -88,7 +88,7 @@ void set_intr_gate(unsigned int n, unsigned char ist, void *addr)
  */
 void set_trap_gate(unsigned int n, unsigned char ist, void *addr)
 {
-    set_gate(IDT_Table + n, 0x8F, ist, &addr); // p=1,DPL=0, type=F
+    set_gate((ul*)(IDT_Table + n), 0x8F, ist, (ul*)(&addr)); // p=1,DPL=0, type=F
 }
 
 /**
@@ -100,7 +100,7 @@ void set_trap_gate(unsigned int n, unsigned char ist, void *addr)
  */
 void set_system_trap_gate(unsigned int n, unsigned char ist, void *addr)
 {
-    set_gate(IDT_Table + n, 0xEF, ist, &addr); // p=1,DPL=3, type=F
+    set_gate((ul*)(IDT_Table + n), 0xEF, ist, (ul*)(&addr)); // p=1,DPL=3, type=F
 }
 
 /**