Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
head_booke.h File Reference
#include <asm/ptrace.h>
#include <asm/kvm_asm.h>
#include <asm/kvm_booke_hv_asm.h>

Go to the source code of this file.

Data Structures

struct  exception_regs
 

Macros

#define SET_IVOR(vector_number, vector_label)
 
#define ALLOC_STACK_FRAME(reg, val)   addi reg,reg,val
 
#define THREAD_NORMSAVE(offset)   (THREAD_NORMSAVES + (offset * 4))
 
#define NORMAL_EXCEPTION_PROLOG(intno)
 
#define MC_STACK_BASE   mcheckirq_ctx
 
#define CRIT_STACK_BASE   critirq_ctx
 
#define DBG_STACK_BASE   dbgirq_ctx
 
#define EXC_LVL_FRAME_OVERHEAD   (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE)
 
#define BOOKE_LOAD_EXC_LEVEL_STACK(level)
 
#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, intno, exc_level_srr0, exc_level_srr1)
 
#define CRITICAL_EXCEPTION_PROLOG(intno)   EXC_LEVEL_EXCEPTION_PROLOG(CRIT, intno, SPRN_CSRR0, SPRN_CSRR1)
 
#define DEBUG_EXCEPTION_PROLOG   EXC_LEVEL_EXCEPTION_PROLOG(DBG, DEBUG, SPRN_DSRR0, SPRN_DSRR1)
 
#define MCHECK_EXCEPTION_PROLOG
 
#define GUEST_DOORBELL_EXCEPTION
 
#define START_EXCEPTION(label)
 
#define FINISH_EXCEPTION(func)
 
#define EXCEPTION(n, intno, label, hdlr, xfer)
 
#define CRITICAL_EXCEPTION(n, intno, label, hdlr)
 
#define MCHECK_EXCEPTION(n, label, hdlr)
 
#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret)
 
#define COPY_EE(d, s)   rlwimi d,s,0,16,16
 
#define NOCOPY(d, s)
 
#define EXC_XFER_STD(n, hdlr)
 
#define EXC_XFER_LITE(n, hdlr)
 
#define EXC_XFER_EE(n, hdlr)
 
#define EXC_XFER_EE_LITE(n, hdlr)
 
#define DEBUG_DEBUG_EXCEPTION
 
#define DEBUG_CRIT_EXCEPTION
 
#define DATA_STORAGE_EXCEPTION
 
#define INSTRUCTION_STORAGE_EXCEPTION
 
#define ALIGNMENT_EXCEPTION
 
#define PROGRAM_EXCEPTION
 
#define DECREMENTER_EXCEPTION
 
#define FP_UNAVAILABLE_EXCEPTION
 
#define STACK_EXC_LVL_FRAME_SIZE   _ALIGN_UP(sizeof (struct exception_regs), 16)
 

Macro Definition Documentation

#define ALIGNMENT_EXCEPTION
Value:
START_EXCEPTION(Alignment) \
NORMAL_EXCEPTION_PROLOG(ALIGNMENT); \
mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \
stw r4,_DEAR(r11); \
EXC_XFER_EE(0x0600, alignment_exception)

Definition at line 382 of file head_booke.h.

#define ALLOC_STACK_FRAME (   reg,
  val 
)    addi reg,reg,val

Definition at line 18 of file head_booke.h.

#define BOOKE_LOAD_EXC_LEVEL_STACK (   level)
Value:
lis r8,level##_STACK_BASE@ha; \
lwz r8,level##_STACK_BASE@l(r8); \

Definition at line 106 of file head_booke.h.

#define COPY_EE (   d,
  s 
)    rlwimi d,s,0,16,16

Definition at line 241 of file head_booke.h.

#define CRIT_STACK_BASE   critirq_ctx

Definition at line 91 of file head_booke.h.

#define CRITICAL_EXCEPTION (   n,
  intno,
  label,
  hdlr 
)
Value:
CRITICAL_EXCEPTION_PROLOG(intno); \
EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
NOCOPY, crit_transfer_to_handler, \
ret_from_crit_exc)

Definition at line 213 of file head_booke.h.

#define CRITICAL_EXCEPTION_PROLOG (   intno)    EXC_LEVEL_EXCEPTION_PROLOG(CRIT, intno, SPRN_CSRR0, SPRN_CSRR1)

Definition at line 170 of file head_booke.h.

#define DATA_STORAGE_EXCEPTION
Value:
START_EXCEPTION(DataStorage) \
NORMAL_EXCEPTION_PROLOG(DATA_STORAGE); \
mfspr r5,SPRN_ESR; /* Grab the ESR and save it */ \
stw r5,_ESR(r11); \
mfspr r4,SPRN_DEAR; /* Grab the DEAR */ \
EXC_XFER_LITE(0x0300, handle_page_fault)

Definition at line 365 of file head_booke.h.

#define DBG_STACK_BASE   dbgirq_ctx

Definition at line 94 of file head_booke.h.

#define DEBUG_CRIT_EXCEPTION

Definition at line 319 of file head_booke.h.

#define DEBUG_DEBUG_EXCEPTION

Definition at line 273 of file head_booke.h.

#define DEBUG_EXCEPTION_PROLOG   EXC_LEVEL_EXCEPTION_PROLOG(DBG, DEBUG, SPRN_DSRR0, SPRN_DSRR1)

Definition at line 172 of file head_booke.h.

#define DECREMENTER_EXCEPTION
Value:
START_EXCEPTION(Decrementer) \
NORMAL_EXCEPTION_PROLOG(DECREMENTER); \
lis r0,TSR_DIS@h; /* Setup the DEC interrupt mask */ \
mtspr SPRN_TSR,r0; /* Clear the DEC interrupt */ \
EXC_XFER_LITE(0x0900, timer_interrupt)

Definition at line 398 of file head_booke.h.

#define EXC_LEVEL_EXCEPTION_PROLOG (   exc_level,
  intno,
  exc_level_srr0,
  exc_level_srr1 
)

Definition at line 120 of file head_booke.h.

#define EXC_LVL_FRAME_OVERHEAD   (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE)

Definition at line 96 of file head_booke.h.

#define EXC_XFER_EE (   n,
  hdlr 
)
Value:
EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \
ret_from_except_full)

Definition at line 252 of file head_booke.h.

#define EXC_XFER_EE_LITE (   n,
  hdlr 
)
Value:
EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
ret_from_except)

Definition at line 256 of file head_booke.h.

#define EXC_XFER_LITE (   n,
  hdlr 
)
Value:
EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
ret_from_except)

Definition at line 248 of file head_booke.h.

#define EXC_XFER_STD (   n,
  hdlr 
)
Value:
EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \
ret_from_except_full)

Definition at line 244 of file head_booke.h.

#define EXC_XFER_TEMPLATE (   hdlr,
  trap,
  msr,
  copyee,
  tfer,
  ret 
)
Value:
stw r10,_TRAP(r11); \
lis r10,msr@h; \
ori r10,r10,msr@l; \
copyee(r10, r9); \
bl tfer; \
.long hdlr; \
.long ret

Definition at line 231 of file head_booke.h.

#define EXCEPTION (   n,
  intno,
  label,
  hdlr,
  xfer 
)
Value:
NORMAL_EXCEPTION_PROLOG(intno); \
xfer(n, hdlr)

Definition at line 207 of file head_booke.h.

#define FINISH_EXCEPTION (   func)
Value:
bl transfer_to_handler_full; \
.long func; \
.long ret_from_except_full

Definition at line 202 of file head_booke.h.

#define FP_UNAVAILABLE_EXCEPTION
Value:
START_EXCEPTION(FloatingPointUnavailable) \
NORMAL_EXCEPTION_PROLOG(FP_UNAVAIL); \
beq 1f; \
bl load_up_fpu; /* if from user, just load it up */ \
b fast_exception_return; \
EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)

Definition at line 406 of file head_booke.h.

#define GUEST_DOORBELL_EXCEPTION
Value:
START_EXCEPTION(GuestDoorbell); \
mtspr SPRN_SPRG_WSCRATCH0, r10; /* save one register */ \
mfspr r10, SPRN_SPRG_THREAD; \
stw r11, THREAD_NORMSAVE(0)(r10); \
mfspr r11, SPRN_SRR1; \
stw r13, THREAD_NORMSAVE(2)(r10); \
mfcr r13; /* save CR in r13 for now */\
DO_KVM BOOKE_INTERRUPT_GUEST_DBELL SPRN_GSRR1; \
trap

Definition at line 184 of file head_booke.h.

#define INSTRUCTION_STORAGE_EXCEPTION
Value:
START_EXCEPTION(InstructionStorage) \
NORMAL_EXCEPTION_PROLOG(INST_STORAGE); \
mfspr r5,SPRN_ESR; /* Grab the ESR and save it */ \
stw r5,_ESR(r11); \
mr r4,r12; /* Pass SRR0 as arg2 */ \
li r5,0; /* Pass zero as arg3 */ \
EXC_XFER_LITE(0x0400, handle_page_fault)

Definition at line 373 of file head_booke.h.

#define MC_STACK_BASE   mcheckirq_ctx

Definition at line 90 of file head_booke.h.

#define MCHECK_EXCEPTION (   n,
  label,
  hdlr 
)
Value:
MCHECK_EXCEPTION_PROLOG; \
mfspr r5,SPRN_ESR; \
stw r5,_ESR(r11); \
EXC_XFER_TEMPLATE(hdlr, n+4, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
NOCOPY, mcheck_transfer_to_handler, \
ret_from_mcheck_exc)

Definition at line 221 of file head_booke.h.

#define MCHECK_EXCEPTION_PROLOG
Value:
EXC_LEVEL_EXCEPTION_PROLOG(MC, MACHINE_CHECK, \
SPRN_MCSRR0, SPRN_MCSRR1)

Definition at line 174 of file head_booke.h.

#define NOCOPY (   d,
  s 
)

Definition at line 242 of file head_booke.h.

#define NORMAL_EXCEPTION_PROLOG (   intno)

Definition at line 34 of file head_booke.h.

#define PROGRAM_EXCEPTION
Value:
START_EXCEPTION(Program) \
NORMAL_EXCEPTION_PROLOG(PROGRAM); \
mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \
stw r4,_ESR(r11); \
EXC_XFER_STD(0x0700, program_check_exception)

Definition at line 390 of file head_booke.h.

#define SET_IVOR (   vector_number,
  vector_label 
)
Value:
li r26,vector_label@l; \
mtspr SPRN_IVOR##vector_number,r26; \
sync

Definition at line 12 of file head_booke.h.

#define STACK_EXC_LVL_FRAME_SIZE   _ALIGN_UP(sizeof (struct exception_regs), 16)

Definition at line 433 of file head_booke.h.

#define START_EXCEPTION (   label)
Value:
.align 5; \

Definition at line 198 of file head_booke.h.

#define THREAD_NORMSAVE (   offset)    (THREAD_NORMSAVES + (offset * 4))

Definition at line 32 of file head_booke.h.