|
|
1.1 root 1: #ifndef SPARC32_CONTEXT_H
2: #define SPARC32_CONTEXT_H
3:
4: struct context {
5: /* General registers */
6: uint32_t regs[32];
7: uint32_t pc;
8: uint32_t npc;
9: #define REG_O0 8
10: #define REG_SP 14
11: #define SP_LOC(ctx) (&(ctx)->regs[REG_SP])
12: /* Flags */
13: /* Optional stack contents */
14: uint32_t return_addr;
15: uint32_t param[0];
16: };
17:
18: /* Create a new context in the given stack */
19: struct context *
20: init_context(uint8_t *stack, uint32_t stack_size, int num_param);
21:
22: /* Switch context */
23: struct context *switch_to(struct context *);
24:
25: /* Holds physical address of boot context */
26: extern unsigned long __boot_ctx;
27:
28: /* This can always be safely used to refer to the boot context */
29: #define boot_ctx ((struct context *) phys_to_virt(__boot_ctx))
30:
31: #endif /* SPARC32_CONTEXT_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.