Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7013
b: refs/heads/master
c: 96e5924
h: refs/heads/master
i:
  7011: 7407c7c
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Sep 5, 2005
1 parent 978daa4 commit 12c3862
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 49 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49f9ebc894ecdb985475060d051a571dc231cce7
refs/heads/master: 96e59245e1abf3ea2e98c4b9ee2ebd975db653db
27 changes: 0 additions & 27 deletions trunk/arch/um/kernel/trap_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,30 +200,3 @@ void winch(int sig, union uml_pt_regs *regs)
void trap_init(void)
{
}

DEFINE_SPINLOCK(trap_lock);

static int trap_index = 0;

int next_trap_index(int limit)
{
int ret;

spin_lock(&trap_lock);
ret = trap_index;
if(++trap_index == limit)
trap_index = 0;
spin_unlock(&trap_lock);
return(ret);
}

/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
21 changes: 0 additions & 21 deletions trunk/arch/um/kernel/trap_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,14 @@ void kill_child_dead(int pid)
} while(1);
}

/* Unlocked - don't care if this is a bit off */
int nsegfaults = 0;

struct {
unsigned long address;
int is_write;
int pid;
unsigned long sp;
int is_user;
} segfault_record[1024];

void segv_handler(int sig, union uml_pt_regs *regs)
{
int index, max;
struct faultinfo * fi = UPT_FAULTINFO(regs);

if(UPT_IS_USER(regs) && !SEGV_IS_FIXABLE(fi)){
bad_segv(*fi, UPT_IP(regs));
return;
}
max = sizeof(segfault_record)/sizeof(segfault_record[0]);
index = next_trap_index(max);

nsegfaults++;
segfault_record[index].address = FAULT_ADDRESS(*fi);
segfault_record[index].pid = os_getpid();
segfault_record[index].is_write = FAULT_WRITE(*fi);
segfault_record[index].sp = UPT_SP(regs);
segfault_record[index].is_user = UPT_IS_USER(regs);
segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs);
}

Expand Down

0 comments on commit 12c3862

Please sign in to comment.