Clean up types, removing the last of the old style typedefs and usages

上级 c47ea542
...@@ -124,9 +124,9 @@ cprintf(const char *fmt, ...) ...@@ -124,9 +124,9 @@ cprintf(const char *fmt, ...)
void void
puts(const char *s) puts(const char *s)
{ {
uint8 *p, *ep; u8 *p, *ep;
p = (uint8*)s; p = (u8*)s;
ep = p+strlen(s); ep = p+strlen(s);
for (; p < ep; p++) for (; p < ep; p++)
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
#define CRANGE_CHECKING 0 #define CRANGE_CHECKING 0
#define MINNLEVEL 10 #define MINNLEVEL 10
#define MARKED(x) (((uintptr) (x)) & 0x1) #define MARKED(x) (((uptr) (x)) & 0x1)
#define RANGE_MARK(x) ((struct clist_range *) (((uintptr) (x)) | 0x1)) #define RANGE_MARK(x) ((struct clist_range *) (((uptr) (x)) | 0x1))
#define RANGE_WOMARK(x) ((struct clist_range *) (((uintptr) (x)) & ~0x1)) #define RANGE_WOMARK(x) ((struct clist_range *) (((uptr) (x)) & ~0x1))
enum { crange_debug = 0 }; enum { crange_debug = 0 };
......
...@@ -118,7 +118,7 @@ void * ...@@ -118,7 +118,7 @@ void *
gc_move_to_tofree_cpu(int c, u64 epoch) gc_move_to_tofree_cpu(int c, u64 epoch)
{ {
struct gc *head; struct gc *head;
uint32 fe = (epoch - (NEPOCH-2)) % NEPOCH; u32 fe = (epoch - (NEPOCH-2)) % NEPOCH;
int cas; int cas;
assert(gc_state[c].delayed[fe].epoch == epoch-(NEPOCH-2)); // XXX race with setting epoch = 0 assert(gc_state[c].delayed[fe].epoch == epoch-(NEPOCH-2)); // XXX race with setting epoch = 0
// unhook list for fe epoch atomically; this shouldn't fail // unhook list for fe epoch atomically; this shouldn't fail
......
...@@ -412,7 +412,7 @@ kmalign(void **p, int align, u64 size) ...@@ -412,7 +412,7 @@ kmalign(void **p, int align, u64 size)
{ {
void *mem = kmalloc(size + (align-1) + sizeof(void*)); void *mem = kmalloc(size + (align-1) + sizeof(void*));
char *amem = ((char*)mem) + sizeof(void*); char *amem = ((char*)mem) + sizeof(void*);
amem += align - ((uintptr)amem & (align - 1)); amem += align - ((uptr)amem & (align - 1));
((void**)amem)[-1] = mem; ((void**)amem)[-1] = mem;
*p = amem; *p = amem;
return 0; return 0;
......
...@@ -124,5 +124,5 @@ struct taskstate ...@@ -124,5 +124,5 @@ struct taskstate
// and type bits. // and type bits.
#define INTDESC(cs, rip, bits) (struct intdesc){ \ #define INTDESC(cs, rip, bits) (struct intdesc){ \
(rip)&0xffff, (cs), 0, bits, ((rip)>>16)&0xffff, \ (rip)&0xffff, (cs), 0, bits, ((rip)>>16)&0xffff, \
(uint64)(rip)>>32, 0, \ (u64)(rip)>>32, 0, \
} }
typedef struct Mbdata Mbdata; typedef struct Mbdata Mbdata;
struct Mbdata struct Mbdata
{ {
uint32 flags; u32 flags;
uint32 mem_lower; // flag 0 u32 mem_lower; // flag 0
uint32 mem_upper; // flag 0 u32 mem_upper; // flag 0
uint32 boot_device; // flag 1 u32 boot_device; // flag 1
uint32 cmdline; // flag 2 u32 cmdline; // flag 2
uint32 mods_count; // flag 3 u32 mods_count; // flag 3
uint32 mods_addr; u32 mods_addr;
uint32 syms[4]; // flag 4, 5 u32 syms[4]; // flag 4, 5
uint32 mmap_length; // flag 6 u32 mmap_length; // flag 6
uint32 mmap_addr; u32 mmap_addr;
uint32 drives_length; // flag 7 u32 drives_length; // flag 7
uint32 drives_addr; u32 drives_addr;
uint32 config_table; // flag 8 u32 config_table; // flag 8
uint32 boot_loader_name; // flag 9 u32 boot_loader_name; // flag 9
uint32 apm_table; // flag 10 u32 apm_table; // flag 10
uint32 vbe_control_info; // flag 11 u32 vbe_control_info; // flag 11
uint32 vbe_mode_info; u32 vbe_mode_info;
uint32 vbe_mode; u32 vbe_mode;
uint32 vbe_interface_seg; u32 vbe_interface_seg;
uint32 vbe_interface_off; u32 vbe_interface_off;
uint32 vbe_interface_len; u32 vbe_interface_len;
}; };
typedef struct Mbmem Mbmem; typedef struct Mbmem Mbmem;
struct Mbmem struct Mbmem
{ {
uint64 base; u64 base;
uint64 length; u64 length;
uint32 type; u32 type;
}; };
typedef struct Mbmod Mbmod; typedef struct Mbmod Mbmod;
struct Mbmod struct Mbmod
{ {
uint32 start; u32 start;
uint32 end; u32 end;
uint32 name; u32 name;
};
typedef struct Page Page;
struct Page
{
Page *next; // only valid when page is on free list
}; };
...@@ -163,8 +163,8 @@ trap(struct trapframe *tf) ...@@ -163,8 +163,8 @@ trap(struct trapframe *tf)
void void
inittrap(void) inittrap(void)
{ {
uint64 entry; u64 entry;
uint32 bits; u32 bits;
int i; int i;
bits = INT_P | SEG_INTR64; // present, interrupt gate bits = INT_P | SEG_INTR64; // present, interrupt gate
......
typedef unsigned short uint16; typedef unsigned char u8;
typedef unsigned int uint32;
typedef long int64;
typedef unsigned long uint64;
typedef unsigned char uint8;
typedef uint64 uintptr;
typedef uint8 u8;
typedef char s8; typedef char s8;
typedef uint16 u16; typedef unsigned short u16;
typedef short s16; typedef short s16;
typedef uint32 u32; typedef unsigned int u32;
typedef int s32; typedef int s32;
typedef int64 s64; typedef unsigned long u64;
typedef uint64 u64; typedef long s64;
typedef uint64 uptr; typedef u64 uptr;
typedef uptr paddr; typedef uptr paddr;
typedef u64 pme_t; // Page Map Entry (refers to any entry in any level) // Page Map Entry (refers to any entry in any level)
typedef u64 pme_t;
typedef pme_t pml4e_t; typedef pme_t pml4e_t;
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论