Commit d2429752 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: handle 8 byte loads and stores atomically in xmon

parent ac8efbdc
...@@ -1381,16 +1381,23 @@ mread(unsigned long adrs, void *buf, int size) ...@@ -1381,16 +1381,23 @@ mread(unsigned long adrs, void *buf, int size)
char *p, *q; char *p, *q;
n = 0; n = 0;
if( setjmp(bus_error_jmp) == 0 ){ if (setjmp(bus_error_jmp) == 0) {
debugger_fault_handler = handle_fault; debugger_fault_handler = handle_fault;
sync(); sync();
p = (char *) adrs; p = (char *)adrs;
q = (char *) buf; q = (char *)buf;
switch (size) { switch (size) {
case 2: *(short *)q = *(short *)p; break; case 2:
case 4: *(int *)q = *(int *)p; break; *(short *)q = *(short *)p;
break;
case 4:
*(int *)q = *(int *)p;
break;
case 8:
*(long *)q = *(long *)p;
break;
default: default:
for( ; n < size; ++n ) { for( ; n < size; ++n) {
*q++ = *p++; *q++ = *p++;
sync(); sync();
} }
...@@ -1411,16 +1418,23 @@ mwrite(unsigned long adrs, void *buf, int size) ...@@ -1411,16 +1418,23 @@ mwrite(unsigned long adrs, void *buf, int size)
char *p, *q; char *p, *q;
n = 0; n = 0;
if( setjmp(bus_error_jmp) == 0 ){ if (setjmp(bus_error_jmp) == 0) {
debugger_fault_handler = handle_fault; debugger_fault_handler = handle_fault;
sync(); sync();
p = (char *) adrs; p = (char *) adrs;
q = (char *) buf; q = (char *) buf;
switch (size) { switch (size) {
case 2: *(short *)p = *(short *)q; break; case 2:
case 4: *(int *)p = *(int *)q; break; *(short *)p = *(short *)q;
break;
case 4:
*(int *)p = *(int *)q;
break;
case 8:
*(long *)p = *(long *)q;
break;
default: default:
for( ; n < size; ++n ) { for ( ; n < size; ++n) {
*p++ = *q++; *p++ = *q++;
sync(); sync();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment