From 5be93c2a24a4c19c8cc335e38f6f6712469004c4 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 30 Aug 2011 14:05:50 +0000 Subject: 2011-08-30 Peter Dufault * rtems/score/cpu.h: Add more context access functionality. Needed to get GDB debugger hooks working. --- cpukit/score/cpu/powerpc/rtems/score/cpu.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'cpukit/score/cpu/powerpc/rtems/score/cpu.h') diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h index 4b7cb91291..fa0ed90391 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h +++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h @@ -309,11 +309,25 @@ typedef struct { (_context)->gpr1 = _sp; \ } while (0) + #define PPC_CONTEXT_GET_CR( _context ) \ + (_context)->cr + + #define PPC_CONTEXT_GET_MSR( _context ) \ + (_context)->msr + #define PPC_CONTEXT_SET_MSR( _context, _msr ) \ do { \ (_context)->msr = _msr; \ } while (0) + #define PPC_CONTEXT_FIRST_SAVED_GPR 13 + + #define PPC_CONTEXT_GET_FIRST_SAVED( _context ) \ + (_context)->gpr13 + + #define PPC_CONTEXT_GET_PC( _context ) \ + (_context)->pc + #define PPC_CONTEXT_SET_PC( _context, _pc ) \ do { \ (_context)->pc = _pc; \ @@ -361,11 +375,25 @@ typedef struct { PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_SP ) = _sp; \ } while (0) + #define PPC_CONTEXT_GET_CR( _context ) \ + PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_CR ) + + #define PPC_CONTEXT_GET_MSR( _context ) \ + PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_MSR ) + #define PPC_CONTEXT_SET_MSR( _context, _msr ) \ do { \ PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_MSR ) = _msr; \ } while (0) + #define PPC_CONTEXT_FIRST_SAVED_GPR 14 + + #define PPC_CONTEXT_GET_FIRST_SAVED( _context ) \ + PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_GPR14 ) + + #define PPC_CONTEXT_GET_PC( _context ) \ + PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_LR ) + #define PPC_CONTEXT_SET_PC( _context, _pc ) \ do { \ PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_LR ) = _pc; \ -- cgit v1.2.3