~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/openbios/arch/ppc/qemu/context.h

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef PPC_CONTEXT_H
 
2
#define PPC_CONTEXT_H
 
3
 
 
4
struct context {
 
5
#define SP_LOC(ctx) (&(ctx)->sp)
 
6
    unsigned long _sp;
 
7
    unsigned long return_addr;
 
8
    unsigned long sp;
 
9
    unsigned long pc;
 
10
    /* General registers */
 
11
    unsigned long regs[34];
 
12
#define REG_R3 3
 
13
#define REG_R5 8
 
14
#define REG_R6 9
 
15
#define REG_R7 10
 
16
    /* Flags */
 
17
    /* Optional stack contents */
 
18
    unsigned long param[0];
 
19
};
 
20
 
 
21
/* Create a new context in the given stack */
 
22
struct context *
 
23
init_context(uint8_t *stack, uint32_t stack_size, int num_param);
 
24
 
 
25
/* Switch context */
 
26
struct context *switch_to(struct context *);
 
27
 
 
28
/* Holds physical address of boot context */
 
29
extern unsigned long __boot_ctx;
 
30
 
 
31
/* This can always be safely used to refer to the boot context */
 
32
#define boot_ctx ((struct context *) phys_to_virt(__boot_ctx))
 
33
 
 
34
#endif /* PPC_CONTEXT_H */