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)
char *p, *q;
n = 0;
if( setjmp(bus_error_jmp) == 0 ){
if (setjmp(bus_error_jmp) == 0) {
debugger_fault_handler = handle_fault;
sync();
p = (char *) adrs;
q = (char *) buf;
p = (char *)adrs;
q = (char *)buf;
switch (size) {
case 2: *(short *)q = *(short *)p; break;
case 4: *(int *)q = *(int *)p; break;
case 2:
*(short *)q = *(short *)p;
break;
case 4:
*(int *)q = *(int *)p;
break;
case 8:
*(long *)q = *(long *)p;
break;
default:
for( ; n < size; ++n ) {
for( ; n < size; ++n) {
*q++ = *p++;
sync();
}
......@@ -1411,16 +1418,23 @@ mwrite(unsigned long adrs, void *buf, int size)
char *p, *q;
n = 0;
if( setjmp(bus_error_jmp) == 0 ){
if (setjmp(bus_error_jmp) == 0) {
debugger_fault_handler = handle_fault;
sync();
p = (char *) adrs;
q = (char *) buf;
switch (size) {
case 2: *(short *)p = *(short *)q; break;
case 4: *(int *)p = *(int *)q; break;
case 2:
*(short *)p = *(short *)q;
break;
case 4:
*(int *)p = *(int *)q;
break;
case 8:
*(long *)p = *(long *)q;
break;
default:
for( ; n < size; ++n ) {
for ( ; n < size; ++n) {
*p++ = *q++;
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