提交 8d068b51 创建 作者: Silas Boyd-Wickizer's avatar Silas Boyd-Wickizer

Fix things clang points out.

上级 999c53be
......@@ -10,6 +10,7 @@ QEMU ?= qemu-system-x86_64
CPUS ?= 4
NM = $(TOOLPREFIX)nm
#CC = $(TOOLPREFIX)clang
CC = $(TOOLPREFIX)gcc
AS = $(TOOLPREFIX)gas
LD = $(TOOLPREFIX)ld
......
......@@ -3,21 +3,18 @@
// Per-CPU state
struct cpu {
u8 id; // Local APIC ID; index into cpus[] below
int ncli; // Depth of pushcli nesting.
int intena; // Were interrupts enabled before pushcli?
u8 id; // Local APIC ID; index into cpus[] below
int ncli; // Depth of pushcli nesting.
int intena; // Were interrupts enabled before pushcli?
struct segdesc gdt[NSEGS]; // x86 global descriptor table
struct taskstate ts; // Used by x86 to find stack for interrupt
struct context *scheduler; // swtch() here to enter scheduler
u64 last_rcu_gc_ticks;
// Cpu-local storage variables; see below
struct cpu *cpu;
struct proc *proc; // The currently-running process.
struct kmem *kmem; // The per-core memory table
#if 0
#endif
} __mpalign__;
extern struct cpu cpus[NCPU];
......
......@@ -33,19 +33,19 @@
static u8 shiftcode[256] =
{
[0x1D] CTL,
[0x2A] SHIFT,
[0x36] SHIFT,
[0x38] ALT,
[0x9D] CTL,
[0xB8] ALT
[0x1D] = CTL,
[0x2A] = SHIFT,
[0x36] = SHIFT,
[0x38] = ALT,
[0x9D] = CTL,
[0xB8] = ALT
};
static u8 togglecode[256] =
{
[0x3A] CAPSLOCK,
[0x45] NUMLOCK,
[0x46] SCROLLLOCK
[0x3A] = CAPSLOCK,
[0x45] = NUMLOCK,
[0x46] = SCROLLLOCK
};
static u8 normalmap[256] =
......@@ -61,13 +61,13 @@ static u8 normalmap[256] =
NO, NO, NO, NO, NO, NO, NO, '7', // 0x40
'8', '9', '-', '4', '5', '6', '+', '1',
'2', '3', '0', '.', NO, NO, NO, NO, // 0x50
[0x9C] '\n', // KP_Enter
[0xB5] '/', // KP_Div
[0xC8] KEY_UP, [0xD0] KEY_DN,
[0xC9] KEY_PGUP, [0xD1] KEY_PGDN,
[0xCB] KEY_LF, [0xCD] KEY_RT,
[0x97] KEY_HOME, [0xCF] KEY_END,
[0xD2] KEY_INS, [0xD3] KEY_DEL
[0x9C] = '\n', // KP_Enter
[0xB5] = '/', // KP_Div
[0xC8] = KEY_UP, [0xD0] = KEY_DN,
[0xC9] = KEY_PGUP, [0xD1] = KEY_PGDN,
[0xCB] = KEY_LF, [0xCD] = KEY_RT,
[0x97] = KEY_HOME, [0xCF] = KEY_END,
[0xD2] = KEY_INS, [0xD3] = KEY_DEL
};
static u8 shiftmap[256] =
......@@ -83,13 +83,13 @@ static u8 shiftmap[256] =
NO, NO, NO, NO, NO, NO, NO, '7', // 0x40
'8', '9', '-', '4', '5', '6', '+', '1',
'2', '3', '0', '.', NO, NO, NO, NO, // 0x50
[0x9C] '\n', // KP_Enter
[0xB5] '/', // KP_Div
[0xC8] KEY_UP, [0xD0] KEY_DN,
[0xC9] KEY_PGUP, [0xD1] KEY_PGDN,
[0xCB] KEY_LF, [0xCD] KEY_RT,
[0x97] KEY_HOME, [0xCF] KEY_END,
[0xD2] KEY_INS, [0xD3] KEY_DEL
[0x9C] = '\n', // KP_Enter
[0xB5] = '/', // KP_Div
[0xC8] = KEY_UP, [0xD0] = KEY_DN,
[0xC9] = KEY_PGUP, [0xD1] = KEY_PGDN,
[0xCB] = KEY_LF, [0xCD] = KEY_RT,
[0x97] = KEY_HOME, [0xCF] = KEY_END,
[0xD2] = KEY_INS, [0xD3] = KEY_DEL
};
static u8 ctlmap[256] =
......@@ -101,12 +101,12 @@ static u8 ctlmap[256] =
C('D'), C('F'), C('G'), C('H'), C('J'), C('K'), C('L'), NO,
NO, NO, NO, C('\\'), C('Z'), C('X'), C('C'), C('V'),
C('B'), C('N'), C('M'), NO, NO, C('/'), NO, NO,
[0x9C] '\r', // KP_Enter
[0xB5] C('/'), // KP_Div
[0xC8] KEY_UP, [0xD0] KEY_DN,
[0xC9] KEY_PGUP, [0xD1] KEY_PGDN,
[0xCB] KEY_LF, [0xCD] KEY_RT,
[0x97] KEY_HOME, [0xCF] KEY_END,
[0xD2] KEY_INS, [0xD3] KEY_DEL
[0x9C] = '\r', // KP_Enter
[0xB5] = C('/'), // KP_Div
[0xC8] = KEY_UP, [0xD0] = KEY_DN,
[0xC9] = KEY_PGUP, [0xD1] = KEY_PGDN,
[0xCB] = KEY_LF, [0xCD] = KEY_RT,
[0x97] = KEY_HOME, [0xCF] = KEY_END,
[0xD2] = KEY_INS, [0xD3] = KEY_DEL
};
......@@ -112,7 +112,7 @@ struct taskstate
u64 ist[8];
u8 reserved1[10];
u16 iomba;
u8 iopb[];
u8 iopb[0];
} __attribute__ ((packed, aligned(16)));
#endif
......
......@@ -579,12 +579,12 @@ void *procdump(void *vk, void *v, void *arg)
struct proc *p = (struct proc *) v;
static char *states[] = {
[UNUSED] "unused",
[EMBRYO] "embryo",
[SLEEPING] "sleep ",
[RUNNABLE] "runble",
[RUNNING] "run ",
[ZOMBIE] "zombie"
[UNUSED] = "unused",
[EMBRYO] = "embryo",
[SLEEPING] = "sleep ",
[RUNNABLE] = "runble",
[RUNNING] = "run ",
[ZOMBIE] = "zombie"
};
char *state;
......
......@@ -18,11 +18,12 @@ char* strncpy(char *s, const char *t, int n);
#include "mtrace-magic.h"
#else
#define mtrace_lock_register(ip, x, name, op, y)
#define mtrace_label_register(t, r, x, y, z, ip)
#define mtrace_kstack_start(x, y)
#define mtrace_kstack_stop(x)
#define mtrace_kstack_pause(x)
#define mtrace_kstack_resume(x)
#define mtrace_call_set(x, y)
#define mtrace_lock_register(ip, x, name, op, y) do { } while (0)
#define mtrace_label_register(t, r, x, y, z, ip) do { } while (0)
#define mtrace_kstack_start(x, y) do { } while (0)
#define mtrace_kstack_stop(x) do { } while (0)
#define mtrace_kstack_pause(x) do { } while (0)
#define mtrace_kstack_resume(x) do { } while (0)
#define mtrace_call_set(x, y) do { } while (0)
#define RET_EIP() 0
#endif
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论