12 #include <linux/linkage.h>
13 #include <linux/sched.h>
14 #include <asm/ptrace.h>
17 #define BREAKINST 0x5730
22 static const int h8300_register_offset[] = {
35 return *(
unsigned short *)(task->
thread.esp0 + h8300_register_offset[regno]);
37 return *(
unsigned long *)(task->
thread.esp0 + h8300_register_offset[regno]);
44 unsigned short oldccr;
49 oldccr = *(
unsigned short *)(task->
thread.esp0 + h8300_register_offset[regno]);
53 *(
unsigned short *)(task->
thread.esp0 + h8300_register_offset[regno]) =
data;
56 *(
unsigned long *)(task->
thread.esp0 + h8300_register_offset[regno]) =
data;
65 if((
long)child->
thread.breakinfo.addr != -1
L) {
66 *child->
thread.breakinfo.addr = child->
thread.breakinfo.inst;
67 child->
thread.breakinfo.addr = (
unsigned short *)-1
L;
93 #define OPTABLE(ptn,msk,len,jmp) \
101 static const struct optable optable_0[] = {
134 static const struct optable optable_1[] = {
141 static const struct optable optable_2[] = {
146 static const struct optable optable_3[] = {
153 static const struct optable optable_4[] = {
158 static const struct optables_list {
162 #define OPTABLES(no) \
164 .ptr = optable_##no, \
165 .size = sizeof(optable_##no) / sizeof(struct optable), \
176 0x00,0x40,0x01,0x04,0x02,0x08,0x10,0x20
195 cond &= condmask[reson >> 1];
205 unsigned char *fetch_p;
210 op = optables[0].ptr;
211 op_len = optables[0].size;
212 fetch_p = (
unsigned char *)pc;
217 op = optables[-op->
length].ptr;
218 op_len = optables[-op->
length].size + 1;
225 addr = *(
unsigned long *)pc;
226 return (
unsigned short *)(addr & 0x00ffffff);
229 return (
unsigned short *)(*(
unsigned long *)addr);
239 return (
unsigned short *)(*(sp+2) & 0x00ffffff);
241 regno = (*pc >> 4) & 0x07;
246 return (
unsigned short *)
addr;
248 if (inst == 0x55 || isbranch(child,inst & 0x0f))
249 pc = (
unsigned short *)((
unsigned long)pc +
250 ((
signed char)(*fetch_p)));
253 if (inst == 0x5c || isbranch(child,(*fetch_p & 0xf0) >> 4))
254 pc = (
unsigned short *)((
unsigned long)pc +
255 ((
signed short)(*(pc+1))));
261 }
while(--op_len > 0);
269 unsigned short *nextpc;
271 child->
thread.breakinfo.addr = nextpc;
272 child->
thread.breakinfo.inst = *nextpc;
278 if ((
unsigned long)
current->thread.breakinfo.addr == bp) {