Skip to content

Commit

Permalink
fixed warnings from trap.c
Browse files Browse the repository at this point in the history
  • Loading branch information
flaneur2020 committed Apr 5, 2012
1 parent 03fc333 commit d3b55a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/inc/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ uint time();
void timer_init();

// kern/syscall.c
void do_syscall();
int do_syscall(struct trap* tf);
void ltr(uint n);
void lldt(uint n);
void ljmp(ushort seg, uint offset);
Expand All @@ -77,7 +77,10 @@ int upush_argv(uint *esp, char **tmp);
int do_exec(char *path, char **argv);

// kern/signal.c
int issig();
void psig();
int sigsend(int pid, int n, int priv);
int sigsend_g(int pgrp, int n, int priv);
int do_kill(int pid, int sig);
int do_signal(int sig, void (*ufunc)(int));
int do_sigaction(int sig, struct sigaction *sa, struct sigaction *old_sa);
Expand Down
3 changes: 2 additions & 1 deletion src/kern/sysent.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int syserr(uint err){

/* common handlers for all syscalls, if an syserr raised,
* returns a negative number: 0 - cu->p_error. */
void do_syscall(struct trap *tf){
int do_syscall(struct trap *tf){
int ret;
int (*func)(struct trap *tf);

Expand All @@ -107,4 +107,5 @@ void do_syscall(struct trap *tf){
tf->eax = 0 - cu->p_error;
else
tf->eax = ret;
return 0;
}
7 changes: 4 additions & 3 deletions src/kern/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ struct idt_desc idt_desc;

// handlers to each int_no
// which inited as 0
static uint hwint_routines[256] = {0, };
static void* hwint_routines[256] = {0, };

static char *fault_str[] = {
static char *trap_str[] = {
"Division By Zero",
"Debug",
"Non Maskable Interrupt",
Expand Down Expand Up @@ -200,14 +200,15 @@ void dump_tf(struct trap *tf){
printk("cr2 = %x, ", cr2);
asm("mov %%ss, %%eax":"=a"(kern_ss));
printk("kern_ss = %x\n", kern_ss);
printk("trap_str: %s", trap_str[tf->int_no]);
}

/***********************************************************************************/

void idt_init(){
// init idt_desc
idt_desc.limit = (sizeof(struct gate_desc) * 256) - 1;
idt_desc.base = &idt;
idt_desc.base = (uint)&idt;
// init irq
irq_init();
// load intr vectors and lidt
Expand Down

0 comments on commit d3b55a4

Please sign in to comment.