Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/gdb_machdep.c
Show All 30 Lines | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/kdb.h> | #include <sys/kdb.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/signal.h> | #include <sys/signal.h> | ||||
#include <machine/cpufunc.h> | |||||
#include <machine/frame.h> | #include <machine/frame.h> | ||||
#include <machine/gdb_machdep.h> | #include <machine/gdb_machdep.h> | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
#include <machine/psl.h> | #include <machine/psl.h> | ||||
#include <machine/reg.h> | #include <machine/reg.h> | ||||
#include <machine/specialreg.h> | |||||
#include <machine/trap.h> | #include <machine/trap.h> | ||||
#include <machine/frame.h> | #include <machine/frame.h> | ||||
#include <machine/endian.h> | #include <machine/endian.h> | ||||
#include <gdb/gdb.h> | #include <gdb/gdb.h> | ||||
void * | void * | ||||
gdb_cpu_getreg(int regnum, size_t *regsz) | gdb_cpu_getreg(int regnum, size_t *regsz) | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | gdb_cpu_signal(int type, int code) | ||||
case 11: return (SIGSEGV); /* Segment not present. */ | case 11: return (SIGSEGV); /* Segment not present. */ | ||||
case 12: return (SIGSEGV); /* Stack exception. */ | case 12: return (SIGSEGV); /* Stack exception. */ | ||||
case 13: return (SIGSEGV); /* General protection. */ | case 13: return (SIGSEGV); /* General protection. */ | ||||
case 14: return (SIGSEGV); /* Page fault. */ | case 14: return (SIGSEGV); /* Page fault. */ | ||||
case 16: return (SIGEMT); /* Coprocessor error. */ | case 16: return (SIGEMT); /* Coprocessor error. */ | ||||
} | } | ||||
return (SIGEMT); | return (SIGEMT); | ||||
} | } | ||||
void * | |||||
gdb_begin_write(void) | |||||
{ | |||||
u_long cr0save; | |||||
cr0save = rcr0(); | |||||
load_cr0(cr0save & ~CR0_WP); | |||||
return ((void *)cr0save); | |||||
} | |||||
void | |||||
gdb_end_write(void *arg) | |||||
{ | |||||
load_cr0((u_long)arg); | |||||
} | |||||