4 /* KLUDGE: There is strong family resemblance in the signal context
5 * stuff in FreeBSD and OpenBSD, but in detail they're different in
6 * almost every line of code. It would be nice to find some way to
7 * factor out the commonality better; failing that, it might be best
8 * just to split this generic-BSD code into one variant for each BSD.
10 * KLUDGE II: this split has begun with the addition of the Darwin BSD
11 * flavour, with the cross-architecture complications that this
12 * entails; unfortunately, currently the situation is worse, not
13 * better, than in the above paragraph. */
16 os_context_register_addr(os_context_t *context, int offset)
20 return CONTEXT_ADDR_FROM_STEM(eax);
22 return CONTEXT_ADDR_FROM_STEM(ecx);
24 return CONTEXT_ADDR_FROM_STEM(edx);
26 return CONTEXT_ADDR_FROM_STEM(ebx);
28 return CONTEXT_ADDR_FROM_STEM(esp);
30 return CONTEXT_ADDR_FROM_STEM(ebp);
32 return CONTEXT_ADDR_FROM_STEM(esi);
34 return CONTEXT_ADDR_FROM_STEM(edi);
41 os_context_sp_addr(os_context_t *context)
43 return CONTEXT_ADDR_FROM_STEM(esp);
47 /* FIXME: If this can be a no-op on BSD/x86, then it
48 * deserves a more precise name.
50 * (Perhaps os_prepare_data_area_to_be_executed()?) */
52 os_flush_icache(os_vm_address_t address, os_vm_size_t length)