Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13867
b: refs/heads/master
c: 548cceb
h: refs/heads/master
i:
  13865: d8fe6d1
  13863: 2b51d58
v: v3
  • Loading branch information
Paul Mackerras committed Nov 11, 2005
1 parent 1e12f16 commit a535d73
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22c841c9a465a6b29a6140fcc5dae9fdb3c8674d
refs/heads/master: 548ccebc2a79c780724529948c79de0613f96776
25 changes: 18 additions & 7 deletions trunk/arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,17 +1467,23 @@ read_spr(int n)
{
unsigned int instrs[2];
unsigned long (*code)(void);
unsigned long opd[3];
unsigned long ret = -1UL;
#ifdef CONFIG_PPC64
unsigned long opd[3];

instrs[0] = 0x7c6002a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6);
instrs[1] = 0x4e800020;
opd[0] = (unsigned long)instrs;
opd[1] = 0;
opd[2] = 0;
code = (unsigned long (*)(void)) opd;
#else
code = (unsigned long (*)(void)) instrs;
#endif

/* mfspr r3,n; blr */
instrs[0] = 0x7c6002a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6);
instrs[1] = 0x4e800020;
store_inst(instrs);
store_inst(instrs+1);
code = (unsigned long (*)(void)) opd;

if (setjmp(bus_error_jmp) == 0) {
catch_memory_errors = 1;
Expand All @@ -1499,16 +1505,21 @@ write_spr(int n, unsigned long val)
{
unsigned int instrs[2];
unsigned long (*code)(unsigned long);
#ifdef CONFIG_PPC64
unsigned long opd[3];

instrs[0] = 0x7c6003a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6);
instrs[1] = 0x4e800020;
opd[0] = (unsigned long)instrs;
opd[1] = 0;
opd[2] = 0;
code = (unsigned long (*)(unsigned long)) opd;
#else
code = (unsigned long (*)(unsigned long)) instrs;
#endif

instrs[0] = 0x7c6003a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6);
instrs[1] = 0x4e800020;
store_inst(instrs);
store_inst(instrs+1);
code = (unsigned long (*)(unsigned long)) opd;

if (setjmp(bus_error_jmp) == 0) {
catch_memory_errors = 1;
Expand Down

0 comments on commit a535d73

Please sign in to comment.