Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
0003  * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
0004  * Licensed under the GPL
0005  */
0006 
0007 #ifndef __FAULTINFO_I386_H
0008 #define __FAULTINFO_I386_H
0009 
0010 /* this structure contains the full arch-specific faultinfo
0011  * from the traps.
0012  * On i386, ptrace_faultinfo unfortunately doesn't provide
0013  * all the info, since trap_no is missing.
0014  * All common elements are defined at the same position in
0015  * both structures, thus making it easy to copy the
0016  * contents without knowledge about the structure elements.
0017  */
0018 struct faultinfo {
0019         int error_code; /* in ptrace_faultinfo misleadingly called is_write */
0020         unsigned long cr2; /* in ptrace_faultinfo called addr */
0021         int trap_no; /* missing in ptrace_faultinfo */
0022 };
0023 
0024 #define FAULT_WRITE(fi) ((fi).error_code & 2)
0025 #define FAULT_ADDRESS(fi) ((fi).cr2)
0026 
0027 /* This is Page Fault */
0028 #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
0029 
0030 #define PTRACE_FULL_FAULTINFO 0
0031 
0032 #endif