5 /* KLUDGE: There is strong family resemblance in the signal context
6 * stuff in FreeBSD and OpenBSD, but in detail they're different in
7 * almost every line of code. It would be nice to find some way to
8 * factor out the commonality better; failing that, it might be best
9 * just to split this generic-BSD code into one variant for each BSD.
11 * KLUDGE II: this split has begun with the addition of the Darwin BSD
12 * flavour, with the cross-architecture complications that this
13 * entails; unfortunately, currently the situation is worse, not
14 * better, than in the above paragraph. */
17 os_context_register_addr(os_context_t *context, int offset)
21 return CONTEXT_ADDR_FROM_STEM(eax);
23 return CONTEXT_ADDR_FROM_STEM(ecx);
25 return CONTEXT_ADDR_FROM_STEM(edx);
27 return CONTEXT_ADDR_FROM_STEM(ebx);
29 return CONTEXT_ADDR_FROM_STEM(esp);
31 return CONTEXT_ADDR_FROM_STEM(ebp);
33 return CONTEXT_ADDR_FROM_STEM(esi);
35 return CONTEXT_ADDR_FROM_STEM(edi);
42 os_context_sp_addr(os_context_t *context)
44 return CONTEXT_ADDR_FROM_STEM(esp);
48 /* FIXME: If this can be a no-op on BSD/x86, then it
49 * deserves a more precise name.
51 * (Perhaps os_prepare_data_area_to_be_executed()?) */
53 os_flush_icache(os_vm_address_t address, os_vm_size_t length)