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