# endif
}
-VGA_REGPARM(1)
+VG_REGPARM(1)
static void ach_LOAD4 ( Addr a )
{
ac_helperc_ACCESS4 ( a, /*isWrite*/False );
}
-VGA_REGPARM(1)
+VG_REGPARM(1)
static void ach_STORE4 ( Addr a )
{
ac_helperc_ACCESS4 ( a, /*isWrite*/True );
}
-VGA_REGPARM(1)
+VG_REGPARM(1)
static void ach_LOAD2 ( Addr a )
{
ac_helperc_ACCESS2 ( a, /*isWrite*/False );
}
-VGA_REGPARM(1)
+VG_REGPARM(1)
static void ach_STORE2 ( Addr a )
{
ac_helperc_ACCESS2 ( a, /*isWrite*/True );
}
-VGA_REGPARM(1)
+VG_REGPARM(1)
static void ach_LOAD1 ( Addr a )
{
ac_helperc_ACCESS1 ( a, /*isWrite*/False );
}
-VGA_REGPARM(1)
+VG_REGPARM(1)
static void ach_STORE1 ( Addr a )
{
ac_helperc_ACCESS1 ( a, /*isWrite*/True );
# endif
}
-VGA_REGPARM(2)
+VG_REGPARM(2)
static void ach_LOADN ( Addr addr, SizeT size )
{
ac_fpu_ACCESS_check ( addr, size, /*isWrite*/False );
}
-VGA_REGPARM(2)
+VG_REGPARM(2)
static void ach_STOREN ( Addr addr, SizeT size )
{
ac_fpu_ACCESS_check ( addr, size, /*isWrite*/True );
}
-void VGA_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
- Bool all_caches_clo_defined)
+void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
+ Bool all_caches_clo_defined)
{
Int res;
#include "cg_arch.h"
-void VGA_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
- Bool all_caches_clo_defined)
+void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
+ Bool all_caches_clo_defined)
{
// XXX: I1 and D1 are vaguely plausible, although they could really be
// anything. However, most (all?) ARMs don't have an L2 cache. But
//.. }
-void VGA_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
- Bool all_caches_clo_defined)
+void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
+ Bool all_caches_clo_defined)
{
tl_assert(0);
}
-void VGA_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
- Bool all_caches_clo_defined)
+void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
+ Bool all_caches_clo_defined)
{
Int res;
// Gives the configuration of I1, D1 and L2 caches. They get overridden
// by any cache configurations specified on the command line.
-void VGA_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
- Bool all_caches_clo_defined);
+void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
+ Bool all_caches_clo_defined);
#endif // __CG_ARCH_H
/*--- Cache simulation functions ---*/
/*------------------------------------------------------------*/
-static VGA_REGPARM(1)
+static VG_REGPARM(1)
void log_1I_0D_cache_access(instr_info* n)
{
//VG_(printf)("1I_0D : CCaddr=0x%x, iaddr=0x%x, isize=%u\n",
VGP_POPCC(VgpCacheSimulate);
}
-static VGA_REGPARM(2)
+static VG_REGPARM(2)
void log_1I_1Dr_cache_access(instr_info* n, Addr data_addr)
{
//VG_(printf)("1I_1Dr: CCaddr=%p, iaddr=%p, isize=%u, daddr=%p, dsize=%u\n",
VGP_POPCC(VgpCacheSimulate);
}
-static VGA_REGPARM(2)
+static VG_REGPARM(2)
void log_1I_1Dw_cache_access(instr_info* n, Addr data_addr)
{
//VG_(printf)("1I_1Dw: CCaddr=%p, iaddr=%p, isize=%u, daddr=%p, dsize=%u\n",
VGP_POPCC(VgpCacheSimulate);
}
-static VGA_REGPARM(3)
+static VG_REGPARM(3)
void log_1I_2D_cache_access(instr_info* n, Addr data_addr1, Addr data_addr2)
{
//VG_(printf)("1I_2D: CCaddr=%p, iaddr=%p, isize=%u, daddr1=%p, daddr2=%p, dsize=%u\n",
// Nb: instrLen will be zero if Vex failed to decode it.
tl_assert( 0 == instrLen ||
- (instrLen >= VGA_MIN_INSTR_SZB &&
- instrLen <= VGA_MAX_INSTR_SZB) );
+ (instrLen >= VG_MIN_INSTR_SZB &&
+ instrLen <= VG_MAX_INSTR_SZB) );
// Large (eg. 28B, 108B, 512B on x86) data-sized instructions will be
// done inaccurately, but they're very rare and this avoids errors from
// Set the cache config (using auto-detection, if supported by the
// architecture)
- VGA_(configure_caches)( I1c, D1c, L2c, (3 == n_clos) );
+ VG_(configure_caches)( I1c, D1c, L2c, (3 == n_clos) );
// Then replace with any defined on the command line.
if (DEFINED(clo_I1_cache)) { *I1c = clo_I1_cache; }
the kernel as the stack pointer moves down. Initially, a 1-page
(4k) stack is allocated. When SP moves below that for the first
time, presumably a page fault occurs. The kernel detects that the
- faulting address is in the range from SP - VGA_STACK_REDZONE_SZB
+ faulting address is in the range from SP - VG_STACK_REDZONE_SZB
upwards to the current valid stack. It then extends the stack
segment downwards for enough to cover the faulting address, and
resumes the process (invisibly). The process is unaware of any of
unwritable.
Just to record the SP boundary conditions somewhere convenient:
- SP - VGA_STACK_REDZONE_SZB always points to the lowest live byte in
- the stack. All addresses below SP - VGA_STACK_REDZONE_SZB are not
+ SP - VG_STACK_REDZONE_SZB always points to the lowest live byte in
+ the stack. All addresses below SP - VG_STACK_REDZONE_SZB are not
live; those at and above it are.
- We do not concern ourselves here with the VGA_STACK_REDZONE_SZB
+ We do not concern ourselves here with the VG_STACK_REDZONE_SZB
bias; that is handled by new_mem_stack/die_mem_stack.
*/
tracked by the tool, and one of the specialised cases
(eg. new_mem_stack_4) isn't used in preference.
*/
-VGA_REGPARM(2)
+VG_REGPARM(2)
void VG_(unknown_SP_update)( Addr old_SP, Addr new_SP )
{
static Int moans = 3;
/*--- pointercheck ---*/
/*------------------------------------------------------------*/
-Bool VGA_(setup_pointercheck)(Addr client_base, Addr client_end)
+Bool VG_(setup_pointercheck)(Addr client_base, Addr client_end)
{
vg_assert(0 != client_end);
#if defined(VGP_x86_linux)
&& ehdr->e_ident[EI_MAG1] == 'E'
&& ehdr->e_ident[EI_MAG2] == 'L'
&& ehdr->e_ident[EI_MAG3] == 'F');
- ok &= (ehdr->e_ident[EI_CLASS] == VGA_ELF_CLASS
- && ehdr->e_ident[EI_DATA] == VGA_ELF_ENDIANNESS
+ ok &= (ehdr->e_ident[EI_CLASS] == VG_ELF_CLASS
+ && ehdr->e_ident[EI_DATA] == VG_ELF_ENDIANNESS
&& ehdr->e_ident[EI_VERSION] == EV_CURRENT);
ok &= (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN);
- ok &= (ehdr->e_machine == VGA_ELF_MACHINE);
+ ok &= (ehdr->e_machine == VG_ELF_MACHINE);
ok &= (ehdr->e_version == EV_CURRENT);
ok &= (ehdr->e_shstrndx != SHN_UNDEF);
ok &= (ehdr->e_shoff != 0 && ehdr->e_shnum != 0);
#include "pub_core_libcbase.h"
#include "pub_core_machine.h"
-#define INSTR_PTR(regs) ((regs).vex.VGA_INSTR_PTR)
-#define STACK_PTR(regs) ((regs).vex.VGA_STACK_PTR)
-#define FRAME_PTR(regs) ((regs).vex.VGA_FRAME_PTR)
+#define INSTR_PTR(regs) ((regs).vex.VG_INSTR_PTR)
+#define STACK_PTR(regs) ((regs).vex.VG_STACK_PTR)
+#define FRAME_PTR(regs) ((regs).vex.VG_FRAME_PTR)
Addr VG_(get_SP) ( ThreadId tid )
{
//--------------------------------------------------------------
if (VG_(clo_pointercheck))
VG_(clo_pointercheck) =
- VGA_(setup_pointercheck)( VG_(client_base), VG_(client_end));
+ VG_(setup_pointercheck)( VG_(client_base), VG_(client_end));
//--------------------------------------------------------------
// register client stack
/* As a result of the following call, the last thread standing
eventually winds up running VG_(shutdown_actions_NORETURN) just
below. */
- VGP_(main_thread_wrapper_NORETURN)(1);
+ VG_(main_thread_wrapper_NORETURN)(1);
/*NOTREACHED*/
vg_assert(0);
//:: /* Called from generated code via helper */
//:: void VG_(wrap_before)(ThreadState *tst, const FuncWrapper *wrapper)
//:: {
-//:: Addr retaddr = VGA_RETADDR(tst->arch);
-//:: Addr argp = (Addr)&VGA_FUNC_ARG(tst->arch, 0);
+//:: Addr retaddr = VG_RETADDR(tst->arch);
+//:: Addr argp = (Addr)&VG_FUNC_ARG(tst->arch, 0);
//:: void *nonce = NULL;
//:: Bool mf = VG_(my_fault);
//:: VG_(my_fault) = True;
//::
//:: if (wrapper->before) {
-//:: va_list args = VGA_VA_LIST(tst->arch);
+//:: va_list args = VG_VA_LIST(tst->arch);
//:: nonce = (*wrapper->before)(args);
//:: }
//::
//:: /* Called from generated code via helper */
//:: void VG_(wrap_after)(ThreadState *tst)
//:: {
-//:: Addr EIP = VGA_INSTR_PTR(tst->arch); /* instruction after call */
-//:: Addr ESP = VGA_STACK_PTR(tst->arch); /* pointer to args */
-//:: Word ret = VGA_RETVAL(tst->arch); /* return value */
+//:: Addr EIP = VG_INSTR_PTR(tst->arch); /* instruction after call */
+//:: Addr ESP = VG_STACK_PTR(tst->arch); /* pointer to args */
+//:: Word ret = VG_RETVAL(tst->arch); /* return value */
//:: struct call_instance *call;
//:: Bool mf = VG_(my_fault);
//::
vki_sigset_t savedmask;
vg_assert(tid >= 0 && tid < VG_N_THREADS);
- VGP_(cleanup_thread)(&VG_(threads)[tid].arch);
+ VG_(cleanup_thread)(&VG_(threads)[tid].arch);
VG_(threads)[tid].tid = tid;
/* Leave the thread in Zombie, so that it doesn't get reallocated
/*
This causes all threads to forceably exit. They aren't actually
dead by the time this returns; you need to call
- VGA_(reap_threads)() to wait for them.
+ VG_(reap_threads)() to wait for them.
*/
void VG_(nuke_all_threads_except) ( ThreadId me, VgSchedReturnCode src )
{
------------------------------------------------------------------ */
#if defined(VGA_x86)
-# define VGA_CLREQ_ARGS guest_EAX
-# define VGA_CLREQ_RET guest_EDX
+# define VG_CLREQ_ARGS guest_EAX
+# define VG_CLREQ_RET guest_EDX
#elif defined(VGA_amd64)
-# define VGA_CLREQ_ARGS guest_RAX
-# define VGA_CLREQ_RET guest_RDX
+# define VG_CLREQ_ARGS guest_RAX
+# define VG_CLREQ_RET guest_RDX
#elif defined(VGA_arm)
-# define VGA_CLREQ_ARGS guest_R0
-# define VGA_CLREQ_RET guest_R0
+# define VG_CLREQ_ARGS guest_R0
+# define VG_CLREQ_RET guest_R0
#elif defined(VGA_ppc32)
-# define VGA_CLREQ_ARGS guest_GPR4
-# define VGA_CLREQ_RET guest_GPR3
+# define VG_CLREQ_ARGS guest_GPR4
+# define VG_CLREQ_RET guest_GPR3
#else
# error Unknown arch
#endif
-#define CLREQ_ARGS(regs) ((regs).vex.VGA_CLREQ_ARGS)
-#define CLREQ_RET(regs) ((regs).vex.VGA_CLREQ_RET)
-#define O_CLREQ_RET (offsetof(VexGuestArchState, VGA_CLREQ_RET))
+#define CLREQ_ARGS(regs) ((regs).vex.VG_CLREQ_ARGS)
+#define CLREQ_RET(regs) ((regs).vex.VG_CLREQ_RET)
+#define O_CLREQ_RET (offsetof(VexGuestArchState, VG_CLREQ_RET))
// These macros write a value to a client's thread register, and tell the
// tool that it's happened (if necessary).
VG_(threads)[tid].status == VgTs_Zombie)
continue;
- remains = VGA_(stack_unused)(tid);
+ remains = VG_(stack_unused)(tid);
if (remains < VKI_PAGE_SIZE)
VG_(message)(Vg_DebugMsg,
"WARNING: Thread %d is within %d bytes "
/* For tracking memory events, indicate the entire frame has been
allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VGA_STACK_REDZONE_SZB,
- size + VGA_STACK_REDZONE_SZB );
+ VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
+ size + VG_STACK_REDZONE_SZB );
return True;
}
/* Set the thread so it will next run the handler. */
/* tst->m_rsp = rsp; also notify the tool we've updated RSP */
VG_(set_SP)(tid, rsp);
- VG_TRACK( post_reg_write, Vg_CoreSignal, tid, O_STACK_PTR, sizeof(Addr));
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tid, VG_O_STACK_PTR, sizeof(Addr));
//VG_(printf)("handler = %p\n", handler);
tst->arch.vex.guest_RIP = (Addr) handler;
size = restore_rt_sigframe(tst, (struct rt_sigframe *)rsp, &sigNo);
- VG_TRACK( die_mem_stack_signal, rsp - VGA_STACK_REDZONE_SZB,
- size + VGA_STACK_REDZONE_SZB );
+ VG_TRACK( die_mem_stack_signal, rsp - VG_STACK_REDZONE_SZB,
+ size + VG_STACK_REDZONE_SZB );
if (VG_(clo_trace_signals))
VG_(message)(
Vg_DebugMsg,
- "VGA_(signal_return) (thread %d): isRT=%d valid magic; RIP=%p",
+ "VG_(signal_return) (thread %d): isRT=%d valid magic; RIP=%p",
tid, isRT, tst->arch.vex.guest_RIP);
/* tell the tools */
//:: /*--- Making coredumps ---*/
//:: /*------------------------------------------------------------*/
//::
-//:: void VGA_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs,
+//:: void VG_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs,
//:: const arch_thread_t* arch)
//:: {
//:: regs->rflags = arch->m_rflags;
//:: VG_(memcpy)(fpu, from, sizeof(*fpu));
//:: }
//::
-//:: void VGA_(fill_elffpregs_from_tst)( vki_elf_fpregset_t* fpu,
+//:: void VG_(fill_elffpregs_from_tst)( vki_elf_fpregset_t* fpu,
//:: const arch_thread_t* arch)
//:: {
//:: fill_fpu(fpu, (const Char *)&arch->m_sse);
//:: }
//::
-//:: void VGA_(fill_elffpxregs_from_tst) ( vki_elf_fpxregset_t* xfpu,
+//:: void VG_(fill_elffpxregs_from_tst) ( vki_elf_fpxregset_t* xfpu,
//:: const arch_thread_t* arch )
//:: {
//:: VG_(memcpy)(xfpu, arch->m_sse.state, sizeof(*xfpu));
}
#endif
-void VGA_(push_signal_frame)(ThreadId tid, Addr esp_top_of_frame,
+void VG_(push_signal_frame)(ThreadId tid, Addr esp_top_of_frame,
const vki_siginfo_t *siginfo,
void *handler, UInt flags,
const vki_sigset_t *mask)
/* Set the thread so it will next run the handler. */
/* tst->m_esp = esp; also notify the tool we've updated ESP */
STACK_PTR(VG_(threads)[tid].arch) = esp;
- VG_TRACK( post_reg_write, Vg_CoreSignal, tid, O_STACK_PTR, sizeof(Addr));
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tid, VG_O_STACK_PTR, sizeof(Addr));
tst->arch.vex.guest_EIP = (Addr) handler;
/* This thread needs to be marked runnable, but we leave that the
#endif
}
-Int VGA_(pop_signal_frame)(ThreadId tid)
+Int VG_(pop_signal_frame)(ThreadId tid)
{
I_die_here;
#if 0
/*
//.. #define SET_SIGNAL_ESP(zztid, zzval) \
//.. SET_THREAD_REG(zztid, zzval, STACK_PTR, post_reg_write, \
-//.. Vg_CoreSignal, zztid, O_STACK_PTR, sizeof(Addr))
+//.. Vg_CoreSignal, zztid, VG_O_STACK_PTR, sizeof(Addr))
*/
//.. /* Extend the stack segment downwards if needed so as to ensure the
//.. new signal frames are mapped to something. Return a Bool
//.. if (VG_(clo_trace_signals))
//.. VG_(message)(
//.. Vg_DebugMsg,
-//.. "VGA_(signal_return) (thread %d): isRT=%d valid magic; EIP=%p",
+//.. "VG_(signal_return) (thread %d): isRT=%d valid magic; EIP=%p",
//.. tid, isRT, tst->arch.vex.guest_EIP);
//..
//.. /* tell the tools */
//:: /*--- Making coredumps ---*/
//:: /*------------------------------------------------------------*/
//::
-//:: void VGA_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs,
+//:: void VG_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs,
//:: const arch_thread_t* arch)
//:: {
//:: regs->eflags = arch->m_eflags;
//:: VG_(memcpy)(fpu, from, sizeof(*fpu));
//:: }
//::
-//:: void VGA_(fill_elffpregs_from_tst)( vki_elf_fpregset_t* fpu,
+//:: void VG_(fill_elffpregs_from_tst)( vki_elf_fpregset_t* fpu,
//:: const arch_thread_t* arch)
//:: {
//:: fill_fpu(fpu, (const Char *)&arch->m_sse);
//:: }
//::
-//:: void VGA_(fill_elffpxregs_from_tst) ( vki_elf_fpxregset_t* xfpu,
+//:: void VG_(fill_elffpxregs_from_tst) ( vki_elf_fpxregset_t* xfpu,
//:: const arch_thread_t* arch )
//:: {
//:: VG_(memcpy)(xfpu, arch->m_sse.state, sizeof(*xfpu));
/* For tracking memory events, indicate the entire frame has been
allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VGA_STACK_REDZONE_SZB,
- size + VGA_STACK_REDZONE_SZB );
+ VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
+ size + VG_STACK_REDZONE_SZB );
return True;
}
/* Set the thread so it will next run the handler. */
/* tst->m_esp = esp; also notify the tool we've updated ESP */
VG_(set_SP)(tid, esp);
- VG_TRACK( post_reg_write, Vg_CoreSignal, tid, O_STACK_PTR, sizeof(Addr));
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tid, VG_O_STACK_PTR, sizeof(Addr));
//VG_(printf)("handler = %p\n", handler);
tst->arch.vex.guest_EIP = (Addr) handler;
else
size = restore_rt_sigframe(tst, (struct rt_sigframe *)esp, &sigNo);
- VG_TRACK( die_mem_stack_signal, esp - VGA_STACK_REDZONE_SZB,
- size + VGA_STACK_REDZONE_SZB );
+ VG_TRACK( die_mem_stack_signal, esp - VG_STACK_REDZONE_SZB,
+ size + VG_STACK_REDZONE_SZB );
if (VG_(clo_trace_signals))
VG_(message)(
Vg_DebugMsg,
- "VGA_(signal_return) (thread %d): isRT=%d valid magic; EIP=%p",
+ "VG_(signal_return) (thread %d): isRT=%d valid magic; EIP=%p",
tid, isRT, tst->arch.vex.guest_EIP);
/* tell the tools */
//:: /*--- Making coredumps ---*/
//:: /*------------------------------------------------------------*/
//::
-//:: void VGA_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs,
+//:: void VG_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs,
//:: const arch_thread_t* arch)
//:: {
//:: regs->eflags = arch->m_eflags;
//:: VG_(memcpy)(fpu, from, sizeof(*fpu));
//:: }
//::
-//:: void VGA_(fill_elffpregs_from_tst)( vki_elf_fpregset_t* fpu,
+//:: void VG_(fill_elffpregs_from_tst)( vki_elf_fpregset_t* fpu,
//:: const arch_thread_t* arch)
//:: {
//:: fill_fpu(fpu, (const Char *)&arch->m_sse);
//:: }
//::
-//:: void VGA_(fill_elffpxregs_from_tst) ( vki_elf_fpxregset_t* xfpu,
+//:: void VG_(fill_elffpxregs_from_tst) ( vki_elf_fpxregset_t* xfpu,
//:: const arch_thread_t* arch )
//:: {
//:: VG_(memcpy)(xfpu, arch->m_sse.state, sizeof(*xfpu));
} SigQueue;
#if defined(VGP_x86_linux)
-# define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.eip)
-# define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.esp)
-# define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.ebp)
-# define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.eax)
-# define VGP_UCONTEXT_SYSCALL_SYSRES(uc) \
+# define VG_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.eip)
+# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.esp)
+# define VG_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.ebp)
+# define VG_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.eax)
+# define VG_UCONTEXT_SYSCALL_SYSRES(uc) \
/* Convert the value in uc_mcontext.eax into a SysRes. */ \
VG_(mk_SysRes_x86_linux)( (uc)->uc_mcontext.eax )
#elif defined(VGP_amd64_linux)
-# define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.rip)
-# define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.rsp)
-# define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.rbp)
-# define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.rax)
-# define VGP_UCONTEXT_SYSCALL_SYSRES(uc) \
+# define VG_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.rip)
+# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.rsp)
+# define VG_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.rbp)
+# define VG_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.rax)
+# define VG_UCONTEXT_SYSCALL_SYSRES(uc) \
/* Convert the value in uc_mcontext.rax into a SysRes. */ \
VG_(mk_SysRes_amd64_linux)( (uc)->uc_mcontext.rax )
#elif defined(VGP_arm_linux)
-# define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.arm_pc)
-# define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.arm_sp)
-# define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.arm_fp)
-# define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.arm_r0)
-# error VGP_UCONTEXT_SYSCALL_RET undefined for ARM/Linux
+# define VG_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.arm_pc)
+# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.arm_sp)
+# define VG_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.arm_fp)
+# define VG_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.arm_r0)
+# error VG_UCONTEXT_SYSCALL_RET undefined for ARM/Linux
#elif defined(VGP_ppc32_linux)
-# define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.mc_gregs[VKI_PT_NIP])
-# define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.mc_gregs[1])
-# define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.mc_gregs[1])
-# define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.mc_gregs[0])
-# define VGP_UCONTEXT_SYSCALL_SYSRES(uc) \
+# define VG_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.mc_gregs[VKI_PT_NIP])
+# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.mc_gregs[1])
+# define VG_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.mc_gregs[1])
+# define VG_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.mc_gregs[0])
+# define VG_UCONTEXT_SYSCALL_SYSRES(uc) \
/* Convert the values in uc_mcontext r3,cr into a SysRes. */ \
VG_(mk_SysRes_ppc32_linux)( (uc)->uc_mcontext.mc_gregs[3], \
(uc)->uc_mcontext.mc_gregs[VKI_PT_CCR] )
VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/True );
} else {
- esp_top_of_frame = VG_(get_SP)(tid) - VGA_STACK_REDZONE_SZB;
+ esp_top_of_frame = VG_(get_SP)(tid) - VG_STACK_REDZONE_SZB;
/* Signal delivery to tools */
VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/False );
VG_(memset)(ehdr, 0, sizeof(*ehdr));
VG_(memcpy)(ehdr->e_ident, ELFMAG, SELFMAG);
- ehdr->e_ident[EI_CLASS] = VGA_ELF_CLASS;
- ehdr->e_ident[EI_DATA] = VGA_ELF_ENDIANNESS;
+ ehdr->e_ident[EI_CLASS] = VG_ELF_CLASS;
+ ehdr->e_ident[EI_DATA] = VG_ELF_ENDIANNESS;
ehdr->e_ident[EI_VERSION] = EV_CURRENT;
ehdr->e_type = ET_CORE;
- ehdr->e_machine = VGA_ELF_MACHINE;
+ ehdr->e_machine = VG_ELF_MACHINE;
ehdr->e_version = EV_CURRENT;
ehdr->e_entry = 0;
ehdr->e_phoff = sizeof(Elf32_Ehdr);
vg_assert(sizeof(*regs) == sizeof(prs->pr_reg));
- VGA_(fill_elfregs_from_tst)(regs, &tst->arch);
+ VG_(fill_elfregs_from_tst)(regs, &tst->arch);
}
static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu)
{
- VGA_(fill_elffpregs_from_tst)(fpu, &tst->arch);
+ VG_(fill_elffpregs_from_tst)(fpu, &tst->arch);
}
static void fill_xfpu(const ThreadState *tst, vki_elf_fpxregset_t *xfpu)
{
- VGA_(fill_elffpxregs_from_tst)(xfpu, &tst->arch);
+ VG_(fill_elffpxregs_from_tst)(xfpu, &tst->arch);
}
static void make_coredump(ThreadId tid, const vki_siginfo_t *si, UInt max_size)
/* Update thread state properly */
VG_(fixup_guest_state_after_syscall_interrupted)(
tid,
- VGP_UCONTEXT_INSTR_PTR(uc),
- VGP_UCONTEXT_SYSCALL_NUM(uc),
- VGP_UCONTEXT_SYSCALL_SYSRES(uc),
+ VG_UCONTEXT_INSTR_PTR(uc),
+ VG_UCONTEXT_SYSCALL_NUM(uc),
+ VG_UCONTEXT_SYSCALL_SYSRES(uc),
!!(scss.scss_per_sig[sigNo].scss_flags & VKI_SA_RESTART)
);
if (VG_(clo_trace_signals)) {
VG_(message)(Vg_DebugMsg, "signal %d arrived ... si_code=%d, EIP=%p, eip=%p",
sigNo, info->si_code, VG_(get_IP)(tid),
- VGP_UCONTEXT_INSTR_PTR(uc) );
+ VG_UCONTEXT_INSTR_PTR(uc) );
}
vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
VG_(shadow_base), VG_(shadow_end));
}
if (info->si_code == 1 /* SEGV_MAPERR */
- && fault >= (esp - VGA_STACK_REDZONE_SZB)
+ && fault >= (esp - VG_STACK_REDZONE_SZB)
&& fault < VG_(client_end)) {
/* If the fault address is above esp but below the current known
stack segment base, and it was a fault because there was
nothing mapped there (as opposed to a permissions fault),
then extend the stack segment.
*/
- Addr base = VG_PGROUNDDN(esp - VGA_STACK_REDZONE_SZB);
+ Addr base = VG_PGROUNDDN(esp - VG_STACK_REDZONE_SZB);
if (VG_(extend_stack)(base, VG_(threads)[tid].client_stack_szB)) {
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg,
VG_(message)(Vg_DebugMsg,
"si_code=%x; Faulting address: %p; sp: %p",
info->si_code, info->_sifields._sigfault._addr,
- VGP_UCONTEXT_STACK_PTR(uc));
+ VG_UCONTEXT_STACK_PTR(uc));
if (0)
VG_(kill_self)(sigNo); /* generate a core dump */
vg_assert(tid != 0);
VG_(core_panic_at)("Killed by fatal signal",
- VGP_UCONTEXT_INSTR_PTR(uc),
- VGP_UCONTEXT_STACK_PTR(uc),
- VGP_UCONTEXT_FRAME_PTR(uc));
+ VG_UCONTEXT_INSTR_PTR(uc),
+ VG_UCONTEXT_STACK_PTR(uc),
+ VG_UCONTEXT_FRAME_PTR(uc));
}
}
do {
Addr ip = ips[i];
if (i > 0)
- ip -= VGA_MIN_INSTR_SZB; // point to calling line
+ ip -= VG_MIN_INSTR_SZB; // point to calling line
// Stop after "main"; if main() is recursive, stop after last main().
if ( ! VG_(clo_show_below_main)) {
/* These are defined in the relevant platform-specific files --
syswrap-arch-os.c */
-extern const SyscallTableEntry VGP_(syscall_table)[];
+extern const SyscallTableEntry ML_(syscall_table)[];
-extern const UInt VGP_(syscall_table_size);
+extern const UInt ML_(syscall_table_size);
/* ---------------------------------------------------------------------
sigprocmasks failed (there's no way to determine which one
failed).
- VGA_(interrupted_syscall)() does the thread state fixup in the
+ VG_(interrupted_syscall)() does the thread state fixup in the
case where we were interrupted by a signal.
Prototype:
- Int VGA_(do_syscall_for_client_WRK(
+ Int VG_(do_syscall_for_client_WRK(
Int syscallno, // rdi
void* guest_state, // rsi
const vki_sigset_t *sysmask, // rdx
/* from vki_arch.h */
#define VKI_SIG_SETMASK 2
-.globl VGA_(do_syscall_for_client_WRK)
-VGA_(do_syscall_for_client_WRK):
+.globl VG_(do_syscall_for_client_WRK)
+VG_(do_syscall_for_client_WRK):
/* save callee-saved regs */
pushq %rbx
pushq %rbp
ret
.section .rodata
-/* export the ranges so that VGA_(interrupted_syscall) can do the
+/* export the ranges so that VG_(interrupted_syscall) can do the
right thing */
-.globl VGA_(blksys_setup)
-.globl VGA_(blksys_restart)
-.globl VGA_(blksys_complete)
-.globl VGA_(blksys_committed)
-.globl VGA_(blksys_finished)
-VGA_(blksys_setup): .quad 1b
-VGA_(blksys_restart): .quad 2b
-VGA_(blksys_complete): .quad 3b
-VGA_(blksys_committed): .quad 4b
-VGA_(blksys_finished): .quad 5b
+.globl VG_(blksys_setup)
+.globl VG_(blksys_restart)
+.globl VG_(blksys_complete)
+.globl VG_(blksys_committed)
+.globl VG_(blksys_finished)
+VG_(blksys_setup): .quad 1b
+VG_(blksys_restart): .quad 2b
+VG_(blksys_complete): .quad 3b
+VG_(blksys_committed): .quad 4b
+VG_(blksys_finished): .quad 5b
.previous
/* Let the linker know we don't need an executable stack */
sigprocmasks failed (there's no way to determine which one
failed).
- VGA_(interrupted_syscall)() does the thread state fixup in the
+ VG_(interrupted_syscall)() does the thread state fixup in the
case where we were interrupted by a signal.
Prototype:
- Int VGA_(do_syscall_for_client_WRK)(
+ Int VG_(do_syscall_for_client_WRK)(
Int syscallno, // r3
void* guest_state, // r4
const vki_sigset_t *sysmask, // r5
/* from vki_arch.h */
#define VKI_SIG_SETMASK 2
-.globl VGA_(do_syscall_for_client_WRK)
-VGA_(do_syscall_for_client_WRK):
+.globl VG_(do_syscall_for_client_WRK)
+VG_(do_syscall_for_client_WRK):
/* make a stack frame */
stwu 1,-32(1)
stw 31,28(1)
VG_(fixup_guest_state_after_syscall_interrupted) can do the
right thing */
-.globl VGA_(blksys_setup)
-.globl VGA_(blksys_restart)
-.globl VGA_(blksys_complete)
-.globl VGA_(blksys_committed)
-.globl VGA_(blksys_finished)
-VGA_(blksys_setup): .long 1b
-VGA_(blksys_restart): .long 2b
-VGA_(blksys_complete): .long 3b
-VGA_(blksys_committed): .long 4b
-VGA_(blksys_finished): .long 5b
+.globl VG_(blksys_setup)
+.globl VG_(blksys_restart)
+.globl VG_(blksys_complete)
+.globl VG_(blksys_committed)
+.globl VG_(blksys_finished)
+VG_(blksys_setup): .long 1b
+VG_(blksys_restart): .long 2b
+VG_(blksys_complete): .long 3b
+VG_(blksys_committed): .long 4b
+VG_(blksys_finished): .long 5b
.previous
sigprocmasks failed (there's no way to determine which one
failed).
- VGA_(interrupted_syscall)() does the thread state fixup in the
+ VG_(interrupted_syscall)() does the thread state fixup in the
case where we were interrupted by a signal.
Prototype:
- Int VGA_(do_syscall_for_client_WRK)(
+ Int VG_(do_syscall_for_client_WRK)(
Int syscallno, // 0
void* guest_state, // 4
const vki_sigset_t *sysmask, // 8
/* from vki_arch.h */
#define VKI_SIG_SETMASK 2
-.globl VGA_(do_syscall_for_client_WRK)
-VGA_(do_syscall_for_client_WRK):
+.globl VG_(do_syscall_for_client_WRK)
+VG_(do_syscall_for_client_WRK):
/* save callee-saved regs */
push %esi
push %edi
VG_(fixup_guest_state_after_syscall_interrupted) can do the
right thing */
-.globl VGA_(blksys_setup)
-.globl VGA_(blksys_restart)
-.globl VGA_(blksys_complete)
-.globl VGA_(blksys_committed)
-.globl VGA_(blksys_finished)
-VGA_(blksys_setup): .long 1b
-VGA_(blksys_restart): .long 2b
-VGA_(blksys_complete): .long 3b
-VGA_(blksys_committed): .long 4b
-VGA_(blksys_finished): .long 5b
+.globl VG_(blksys_setup)
+.globl VG_(blksys_restart)
+.globl VG_(blksys_complete)
+.globl VG_(blksys_committed)
+.globl VG_(blksys_finished)
+VG_(blksys_setup): .long 1b
+VG_(blksys_restart): .long 2b
+VG_(blksys_complete): .long 3b
+VG_(blksys_committed): .long 4b
+VG_(blksys_finished): .long 5b
.previous
/* Let the linker know we don't need an executable stack */
/* NB: this is identical the the x86 version. */
/* Return how many bytes of this stack have not been used */
-SSizeT VGA_(stack_unused)(ThreadId tid)
+SSizeT VG_(stack_unused)(ThreadId tid)
{
ThreadState *tst = VG_(get_ThreadState)(tid);
UWord* p;
Allocate a stack for the main thread, and run it all the way to the
end.
*/
-void VGP_(main_thread_wrapper_NORETURN)(ThreadId tid)
+void VG_(main_thread_wrapper_NORETURN)(ThreadId tid)
{
VG_(debugLog)(1, "syswrap-amd64-linux",
- "entering VGP_(main_thread_wrapper_NORETURN)\n");
+ "entering VG_(main_thread_wrapper_NORETURN)\n");
UWord* rsp = allocstack(tid);
if (res.isError) {
/* clone failed */
- VGP_(cleanup_thread)(&ctst->arch);
+ VG_(cleanup_thread)(&ctst->arch);
ctst->status = VgTs_Empty;
}
More thread stuff
------------------------------------------------------------------ */
-void VGP_(cleanup_thread) ( ThreadArchState *arch )
+void VG_(cleanup_thread) ( ThreadArchState *arch )
{
}
// When implementing these wrappers, you need to work out if the wrapper is
// generic, Linux-only (but arch-independent), or AMD64/Linux only.
-const SyscallTableEntry VGP_(syscall_table)[] = {
+const SyscallTableEntry ML_(syscall_table)[] = {
GENXY(__NR_read, sys_read), // 0
GENX_(__NR_write, sys_write), // 1
GENXY(__NR_open, sys_open), // 2
// (__NR_waitid, sys_waitid), // 247
};
-const UInt VGP_(syscall_table_size) =
- sizeof(VGP_(syscall_table)) / sizeof(VGP_(syscall_table)[0]);
+const UInt ML_(syscall_table_size) =
+ sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]);
/*--------------------------------------------------------------------*/
/*--- end ---*/
// XXX: this function and these variables should be assembly code! See the
// x86 version.
-const Addr VGA_(sys_before), VGA_(sys_restarted),
- VGA_(sys_after), VGA_(sys_done);
-void VGA_(do_thread_syscall)(UWord sys,
- UWord arg1, UWord arg2, UWord arg3,
- UWord arg4, UWord arg5, UWord arg6,
- UWord *result, /*enum PXState*/Int *statep,
- /*enum PXState*/Int poststate)
+const Addr VG_(sys_before), VG_(sys_restarted),
+ VG_(sys_after), VG_(sys_done);
+void VG_(do_thread_syscall)(UWord sys,
+ UWord arg1, UWord arg2, UWord arg3,
+ UWord arg4, UWord arg5, UWord arg6,
+ UWord *result, /*enum PXState*/Int *statep,
+ /*enum PXState*/Int poststate)
{
I_die_here;
}
(ARG1 == (VKI_CLONE_CHILD_CLEARTID|VKI_CLONE_CHILD_SETTID|VKI_SIGCHLD)
|| ARG1 == (VKI_CLONE_PARENT_SETTID|VKI_SIGCHLD)))
{
- VGA_(gen_sys_fork_before)(tid, tst);
+ VG_(gen_sys_fork_before)(tid, tst);
SET_RESULT( VG_(do_syscall5)(SYSNO, ARG1, ARG2, ARG3, ARG4, ARG5) );
- VGA_(gen_sys_fork_after) (tid, tst);
+ VG_(gen_sys_fork_after) (tid, tst);
} else {
VG_(unimplemented)
("clone(): not supported by Valgrind.\n "
//
// XXX: look at the x86-linux one to see how to do it.
-const struct SyscallTableEntry VGA_(syscall_table)[] = {
+const struct SyscallTableEntry ML_(syscall_table)[] = {
// (restart_syscall) // 0
GENX_(__NR_exit, sys_exit), // 1
LINX_(__NR_mount, sys_mount), // 21
PLAX_(__NR_clone, sys_clone), // 120
};
-const UInt VGA_(syscall_table_size) =
- sizeof(VGA_(syscall_table)) / sizeof(VGA_(syscall_table)[0]);
+const UInt ML_(syscall_table_size) =
+ sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]);
/*--------------------------------------------------------------------*/
/*--- end ---*/
/* Note: the PRE() and POST() wrappers are for the actual functions
implementing the system calls in the OS kernel. These mostly have
names like sys_write(); a few have names like old_mmap(). See the
- comment for VGA_(syscall_table)[] for important info about the __NR_foo
+ comment for ML_(syscall_table)[] for important info about the __NR_foo
constants and their relationship to the sys_foo() functions.
Some notes about names used for syscalls and args:
VG_(fixup_guest_state_after_syscall_interrupted) below for details.
*/
extern
-void VGA_(do_syscall_for_client_WRK)( Int syscallno,
- void* guest_state,
- const vki_sigset_t *syscall_mask,
- const vki_sigset_t *restore_mask,
- Int nsigwords );
+void VG_(do_syscall_for_client_WRK)( Int syscallno,
+ void* guest_state,
+ const vki_sigset_t *syscall_mask,
+ const vki_sigset_t *restore_mask,
+ Int nsigwords );
static
void do_syscall_for_client ( Int syscallno,
const vki_sigset_t* syscall_mask )
{
vki_sigset_t saved;
- VGA_(do_syscall_for_client_WRK)(
+ VG_(do_syscall_for_client_WRK)(
syscallno, &tst->arch.vex,
syscall_mask, &saved, _VKI_NSIG_WORDS * sizeof(UWord)
);
{
const SyscallTableEntry* sys = &bad_sys;
- if (syscallno < VGP_(syscall_table_size) &&
- VGP_(syscall_table)[syscallno].before != NULL)
- sys = &VGP_(syscall_table)[syscallno];
+ if (syscallno < ML_(syscall_table_size) &&
+ ML_(syscall_table)[syscallno].before != NULL)
+ sys = &ML_(syscall_table)[syscallno];
return sys;
}
*/
-/* These are addresses within VGA_(_do_syscall_for_client). See syscall.S for
+/* These are addresses within VG_(_do_syscall_for_client). See syscall.S for
details. */
-extern const Addr VGA_(blksys_setup);
-extern const Addr VGA_(blksys_restart);
-extern const Addr VGA_(blksys_complete);
-extern const Addr VGA_(blksys_committed);
-extern const Addr VGA_(blksys_finished);
+extern const Addr VG_(blksys_setup);
+extern const Addr VG_(blksys_restart);
+extern const Addr VG_(blksys_complete);
+extern const Addr VG_(blksys_committed);
+extern const Addr VG_(blksys_finished);
/* Back up guest state to restart a system call. */
/* Figure out what the state of the syscall was by examining the
(real) IP at the time of the signal, and act accordingly. */
- if (ip < VGA_(blksys_setup) || ip >= VGA_(blksys_finished)) {
+ if (ip < VG_(blksys_setup) || ip >= VG_(blksys_finished)) {
VG_(printf)(" not in syscall (%p - %p)\n",
- VGA_(blksys_setup), VGA_(blksys_finished));
+ VG_(blksys_setup), VG_(blksys_finished));
/* Looks like we weren't in a syscall at all. Hmm. */
vg_assert(sci->status.what != SsIdle);
return;
Hence: */
vg_assert(sci->status.what != SsIdle);
- if (ip >= VGA_(blksys_setup) && ip < VGA_(blksys_restart)) {
+ if (ip >= VG_(blksys_setup) && ip < VG_(blksys_restart)) {
/* syscall hasn't even started; go around again */
if (debug)
VG_(printf)(" not started: restart\n");
}
else
- if (ip == VGA_(blksys_restart)) {
+ if (ip == VG_(blksys_restart)) {
/* We're either about to run the syscall, or it was interrupted
and the kernel restarted it. Restart if asked, otherwise
EINTR it. */
}
else
- if (ip >= VGA_(blksys_complete) && ip < VGA_(blksys_committed)) {
+ if (ip >= VG_(blksys_complete) && ip < VG_(blksys_committed)) {
/* Syscall complete, but result hasn't been written back yet.
Write the SysRes we were supplied with back to the guest
state. */
}
else
- if (ip >= VGA_(blksys_committed) && ip < VGA_(blksys_finished)) {
+ if (ip >= VG_(blksys_committed) && ip < VG_(blksys_finished)) {
/* Result committed, but the signal mask has not been restored;
we expect our caller (the signal handler) will have fixed
this up. */
/* NB: this is identical the the amd64 version. */
/* Return how many bytes of this stack have not been used */
-SSizeT VGA_(stack_unused)(ThreadId tid)
+SSizeT VG_(stack_unused)(ThreadId tid)
{
ThreadState *tst = VG_(get_ThreadState)(tid);
UWord* p;
Allocate a stack for the main thread, and run it all the way to the
end.
*/
-void VGP_(main_thread_wrapper_NORETURN)(ThreadId tid)
+void VG_(main_thread_wrapper_NORETURN)(ThreadId tid)
{
VG_(debugLog)(1, "syscalls-ppc32-linux",
- "entering VGP_(main_thread_wrapper_NORETURN)\n");
+ "entering VG_(main_thread_wrapper_NORETURN)\n");
UWord* sp = allocstack(tid);
//.. If the clone call specifies a NULL esp for the new thread, then
//.. it actually gets a copy of the parent's esp.
//.. */
-//.. VGA_(setup_child)( &ctst->arch, &ptst->arch );
+//.. VG_(setup_child)( &ctst->arch, &ptst->arch );
//..
//.. /* Make sys_clone appear to have returned Success(0) in the
//.. child. */
//.. out:
//.. if (ret < 0) {
//.. /* clone failed */
-//.. VGA_(cleanup_thread)(&ctst->arch);
+//.. VG_(cleanup_thread)(&ctst->arch);
//.. ctst->status = VgTs_Empty;
//.. }
//..
More thread stuff
------------------------------------------------------------------ */
-void VGP_(cleanup_thread) ( ThreadArchState* arch )
+void VG_(cleanup_thread) ( ThreadArchState* arch )
{
//.. /* Release arch-specific resources held by this thread. */
//.. /* On x86, we have to dump the LDT and GDT. */
}
-//.. void VGA_(setup_child) ( /*OUT*/ ThreadArchState *child,
+//.. void VG_(setup_child) ( /*OUT*/ ThreadArchState *child,
//.. /*IN*/ ThreadArchState *parent )
//.. {
//.. /* We inherit our parent's guest state. */
//..
//.. /* This is only so that the EIP is (might be) useful to report if
//.. something goes wrong in the sigreturn */
-//.. VGA_(restart_syscall)(&tst->arch);
+//.. VG_(restart_syscall)(&tst->arch);
//..
//.. VG_(sigframe_destroy)(tid, False);
//..
//..
//.. /* This is only so that the EIP is (might be) useful to report if
//.. something goes wrong in the sigreturn */
-//.. VGA_(restart_syscall)(&tst->arch);
+//.. VG_(restart_syscall)(&tst->arch);
//..
//.. VG_(sigframe_destroy)(tid, False);
//..
// arch/OS combination, eg. */* (generic), */Linux (Linux only), ?/?
// (unknown).
-const SyscallTableEntry VGP_(syscall_table)[] = {
+const SyscallTableEntry ML_(syscall_table)[] = {
//.. (restart_syscall) // 0
GENX_(__NR_exit, sys_exit), // 1
//.. GENX_(__NR_fork, sys_fork), // 2
// __NR_kexec_load // 268
};
-const UInt VGP_(syscall_table_size) =
- sizeof(VGP_(syscall_table)) / sizeof(VGP_(syscall_table)[0]);
+const UInt ML_(syscall_table_size) =
+ sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]);
/*--------------------------------------------------------------------*/
/*--- end ---*/
/* NB: this is identical the the amd64 version. */
/* Return how many bytes of this stack have not been used */
-SSizeT VGA_(stack_unused)(ThreadId tid)
+SSizeT VG_(stack_unused)(ThreadId tid)
{
ThreadState *tst = VG_(get_ThreadState)(tid);
UWord* p;
Allocate a stack for the main thread, and run it all the way to the
end.
*/
-void VGP_(main_thread_wrapper_NORETURN)(ThreadId tid)
+void VG_(main_thread_wrapper_NORETURN)(ThreadId tid)
{
VG_(debugLog)(1, "syswrap-x86-linux",
- "entering VGP_(main_thread_wrapper_NORETURN)\n");
+ "entering VG_(main_thread_wrapper_NORETURN)\n");
UWord* esp = allocstack(tid);
out:
if (res.isError) {
/* clone failed */
- VGP_(cleanup_thread)(&ctst->arch);
+ VG_(cleanup_thread)(&ctst->arch);
ctst->status = VgTs_Empty;
}
More thread stuff
------------------------------------------------------------------ */
-void VGP_(cleanup_thread) ( ThreadArchState* arch )
+void VG_(cleanup_thread) ( ThreadArchState* arch )
{
/* Release arch-specific resources held by this thread. */
/* On x86, we have to dump the LDT and GDT. */
// arch/OS combination, eg. */* (generic), */Linux (Linux only), ?/?
// (unknown).
-const SyscallTableEntry VGP_(syscall_table)[] = {
+const SyscallTableEntry ML_(syscall_table)[] = {
//zz // (restart_syscall) // 0
GENX_(__NR_exit, sys_exit), // 1
GENX_(__NR_fork, sys_fork), // 2
GENX_(__NR_sys_kexec_load, sys_ni_syscall), // 283
};
-const UInt VGP_(syscall_table_size) =
- sizeof(VGP_(syscall_table)) / sizeof(VGP_(syscall_table)[0]);
+const UInt ML_(syscall_table_size) =
+ sizeof(ML_(syscall_table)) / sizeof(ML_(syscall_table)[0]);
/*--------------------------------------------------------------------*/
/*--- end ---*/
}
#define DEF2(fn, args...) \
-void VG_(fn)(VGA_REGPARM(1) void(*f)(args)) \
+void VG_(fn)(VG_REGPARM(1) void(*f)(args)) \
{ \
VG_(tdict).fn = f; \
}
fprintf(stderr, "valgrind: %s: bad ELF magic number\n", filename);
return NULL;
}
- if (e->e.e_ident[EI_CLASS] != VGA_ELF_CLASS) {
+ if (e->e.e_ident[EI_CLASS] != VG_ELF_CLASS) {
fprintf(stderr,
"valgrind: wrong ELF executable class "
"(eg. 32-bit instead of 64-bit)\n");
return NULL;
}
- if (e->e.e_ident[EI_DATA] != VGA_ELF_ENDIANNESS) {
+ if (e->e.e_ident[EI_DATA] != VG_ELF_ENDIANNESS) {
fprintf(stderr, "valgrind: executable has wrong endian-ness\n");
return NULL;
}
return NULL;
}
- if (e->e.e_machine != VGA_ELF_MACHINE) {
+ if (e->e.e_machine != VG_ELF_MACHINE) {
fprintf(stderr, "valgrind: executable is not for "
"this architecture\n");
return NULL;
extern void VG_(handle_stack_deregister)(UWord id);
extern void VG_(handle_stack_change)(UWord id, Addr start, Addr end);
-extern VGA_REGPARM(2)
+extern VG_REGPARM(2)
void VG_(unknown_SP_update) ( Addr old_SP, Addr new_SP );
///* Search /proc/self/maps for changes which aren't reflected in the
const UChar *filename ) );
// Pointercheck
-extern Bool VGA_(setup_pointercheck) ( Addr client_base, Addr client_end );
+extern Bool VG_(setup_pointercheck) ( Addr client_base, Addr client_end );
#endif // __PUB_CORE_ASPACEMGR_H
/*--------------------------------------------------------------------*/
-/*--- end pub_core_aspacemgr.h ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
#include "pub_tool_machine.h"
#if defined(VGA_x86)
-# define VGA_ELF_ENDIANNESS ELFDATA2LSB
-# define VGA_ELF_MACHINE EM_386
-# define VGA_ELF_CLASS ELFCLASS32
+# define VG_ELF_ENDIANNESS ELFDATA2LSB
+# define VG_ELF_MACHINE EM_386
+# define VG_ELF_CLASS ELFCLASS32
#elif defined(VGA_amd64)
-# define VGA_ELF_ENDIANNESS ELFDATA2LSB
-# define VGA_ELF_MACHINE EM_X86_64
-# define VGA_ELF_CLASS ELFCLASS64
+# define VG_ELF_ENDIANNESS ELFDATA2LSB
+# define VG_ELF_MACHINE EM_X86_64
+# define VG_ELF_CLASS ELFCLASS64
#elif defined(VGA_arm)
-# define VGA_ELF_ENDIANNESS ELFDATA2LSB
-# define VGA_ELF_MACHINE EM_ARM
-# define VGA_ELF_CLASS ELFCLASS32
+# define VG_ELF_ENDIANNESS ELFDATA2LSB
+# define VG_ELF_MACHINE EM_ARM
+# define VG_ELF_CLASS ELFCLASS32
#elif defined(VGA_ppc32)
-# define VGA_ELF_ENDIANNESS ELFDATA2MSB
-# define VGA_ELF_MACHINE EM_PPC
-# define VGA_ELF_CLASS ELFCLASS32
+# define VG_ELF_ENDIANNESS ELFDATA2MSB
+# define VG_ELF_MACHINE EM_PPC
+# define VG_ELF_CLASS ELFCLASS32
#else
# error Unknown arch
#endif
#if defined(VGA_x86)
-# define VGA_INSTR_PTR guest_EIP
-# define VGA_STACK_PTR guest_ESP
-# define VGA_FRAME_PTR guest_EBP
+# define VG_INSTR_PTR guest_EIP
+# define VG_STACK_PTR guest_ESP
+# define VG_FRAME_PTR guest_EBP
#elif defined(VGA_amd64)
-# define VGA_INSTR_PTR guest_RIP
-# define VGA_STACK_PTR guest_RSP
-# define VGA_FRAME_PTR guest_RBP
+# define VG_INSTR_PTR guest_RIP
+# define VG_STACK_PTR guest_RSP
+# define VG_FRAME_PTR guest_RBP
#elif defined(VGA_arm)
// XXX: Not sure, but I think:
// r11 = frame pointer
// r13 = stack pointer
// r14 = link register
// r15 = program counter
-# define VGA_INSTR_PTR guest_R15
-# define VGA_STACK_PTR guest_R13
-# define VGA_FRAME_PTR guest_R11
+# define VG_INSTR_PTR guest_R15
+# define VG_STACK_PTR guest_R13
+# define VG_FRAME_PTR guest_R11
#elif defined(VGA_ppc32)
-# define VGA_INSTR_PTR guest_CIA
-# define VGA_STACK_PTR guest_GPR1
-# define VGA_FRAME_PTR guest_GPR1 // No frame ptr for PPC
+# define VG_INSTR_PTR guest_CIA
+# define VG_STACK_PTR guest_GPR1
+# define VG_FRAME_PTR guest_GPR1 // No frame ptr for PPC
#else
# error Unknown arch
#endif
// Offsets for the Vex state
-#define O_STACK_PTR (offsetof(VexGuestArchState, VGA_STACK_PTR))
+#define VG_O_STACK_PTR (offsetof(VexGuestArchState, VG_STACK_PTR))
#endif // __PUB_CORE_MACHINE_H
//--------------------------------------------------------------------
// Return how many bytes of a thread's Valgrind stack are unused
-extern SSizeT VGA_(stack_unused)(ThreadId tid);
+extern SSizeT VG_(stack_unused)(ThreadId tid);
// Allocates a stack for the first thread, then runs it,
// as if the thread had been set up by clone()
-extern void VGP_(main_thread_wrapper_NORETURN)(ThreadId tid);
+extern void VG_(main_thread_wrapper_NORETURN)(ThreadId tid);
extern void VG_(client_syscall) ( ThreadId tid );
extern void VG_(reap_threads)(ThreadId self);
// Release resources held by this thread
-extern void VGP_(cleanup_thread) ( ThreadArchState* );
+extern void VG_(cleanup_thread) ( ThreadArchState* );
/* fd leakage calls. */
extern void VG_(init_preopened_fds) ( void );
void (*track_die_mem_brk) (Addr, SizeT);
void (*track_die_mem_munmap) (Addr, SizeT);
- void VGA_REGPARM(1) (*track_new_mem_stack_4) (Addr);
- void VGA_REGPARM(1) (*track_new_mem_stack_8) (Addr);
- void VGA_REGPARM(1) (*track_new_mem_stack_12)(Addr);
- void VGA_REGPARM(1) (*track_new_mem_stack_16)(Addr);
- void VGA_REGPARM(1) (*track_new_mem_stack_32)(Addr);
+ void VG_REGPARM(1) (*track_new_mem_stack_4) (Addr);
+ void VG_REGPARM(1) (*track_new_mem_stack_8) (Addr);
+ void VG_REGPARM(1) (*track_new_mem_stack_12)(Addr);
+ void VG_REGPARM(1) (*track_new_mem_stack_16)(Addr);
+ void VG_REGPARM(1) (*track_new_mem_stack_32)(Addr);
void (*track_new_mem_stack)(Addr, SizeT);
- void VGA_REGPARM(1) (*track_die_mem_stack_4) (Addr);
- void VGA_REGPARM(1) (*track_die_mem_stack_8) (Addr);
- void VGA_REGPARM(1) (*track_die_mem_stack_12)(Addr);
- void VGA_REGPARM(1) (*track_die_mem_stack_16)(Addr);
- void VGA_REGPARM(1) (*track_die_mem_stack_32)(Addr);
+ void VG_REGPARM(1) (*track_die_mem_stack_4) (Addr);
+ void VG_REGPARM(1) (*track_die_mem_stack_8) (Addr);
+ void VG_REGPARM(1) (*track_die_mem_stack_12)(Addr);
+ void VG_REGPARM(1) (*track_die_mem_stack_16)(Addr);
+ void VG_REGPARM(1) (*track_die_mem_stack_32)(Addr);
void (*track_die_mem_stack)(Addr, SizeT);
void (*track_ban_mem_stack)(Addr, SizeT);
static void hg_mem_write(Addr a, SizeT data_size, ThreadId tid);
__attribute__((unused))
-static void hg_mem_help_read_1(Addr a) VGA_REGPARM(1);
+static void hg_mem_help_read_1(Addr a) VG_REGPARM(1);
__attribute__((unused))
-static void hg_mem_help_read_2(Addr a) VGA_REGPARM(1);
+static void hg_mem_help_read_2(Addr a) VG_REGPARM(1);
__attribute__((unused))
-static void hg_mem_help_read_4(Addr a) VGA_REGPARM(1);
+static void hg_mem_help_read_4(Addr a) VG_REGPARM(1);
__attribute__((unused))
-static void hg_mem_help_read_N(Addr a, SizeT size) VGA_REGPARM(2);
+static void hg_mem_help_read_N(Addr a, SizeT size) VG_REGPARM(2);
__attribute__((unused))
-static void hg_mem_help_write_1(Addr a, UInt val) VGA_REGPARM(2);
+static void hg_mem_help_write_1(Addr a, UInt val) VG_REGPARM(2);
__attribute__((unused))
-static void hg_mem_help_write_2(Addr a, UInt val) VGA_REGPARM(2);
+static void hg_mem_help_write_2(Addr a, UInt val) VG_REGPARM(2);
__attribute__((unused))
-static void hg_mem_help_write_4(Addr a, UInt val) VGA_REGPARM(2);
+static void hg_mem_help_write_4(Addr a, UInt val) VG_REGPARM(2);
__attribute__((unused))
-static void hg_mem_help_write_N(Addr a, SizeT size) VGA_REGPARM(2);
+static void hg_mem_help_write_N(Addr a, SizeT size) VG_REGPARM(2);
__attribute__((unused))
static void bus_lock(void);
tl_assert(u_in->val2 < ntemps);
stackref[u_in->val2] = (u_in->size == 4 &&
- (u_in->val1 == VGA_R_STACK_PTR ||
- u_in->val1 == VGA_R_FRAME_PTR));
+ (u_in->val1 == VG_R_STACK_PTR ||
+ u_in->val1 == VG_R_FRAME_PTR));
VG_(copy_UInstr)(cb, u_in);
break;
#undef DEBUG_STATE
-VGA_REGPARM(1) static void hg_mem_help_read_1(Addr a)
+VG_REGPARM(1) static void hg_mem_help_read_1(Addr a)
{
hg_mem_read(a, 1, VG_(get_running_tid)());
}
-VGA_REGPARM(1) static void hg_mem_help_read_2(Addr a)
+VG_REGPARM(1) static void hg_mem_help_read_2(Addr a)
{
hg_mem_read(a, 2, VG_(get_running_tid)());
}
-VGA_REGPARM(1) static void hg_mem_help_read_4(Addr a)
+VG_REGPARM(1) static void hg_mem_help_read_4(Addr a)
{
hg_mem_read(a, 4, VG_(get_running_tid)());
}
-VGA_REGPARM(2) static void hg_mem_help_read_N(Addr a, SizeT size)
+VG_REGPARM(2) static void hg_mem_help_read_N(Addr a, SizeT size)
{
hg_mem_read(a, size, VG_(get_running_tid)());
}
-VGA_REGPARM(2) static void hg_mem_help_write_1(Addr a, UInt val)
+VG_REGPARM(2) static void hg_mem_help_write_1(Addr a, UInt val)
{
if (*(UChar *)a != val)
hg_mem_write(a, 1, VG_(get_running_tid)());
}
-VGA_REGPARM(2) static void hg_mem_help_write_2(Addr a, UInt val)
+VG_REGPARM(2) static void hg_mem_help_write_2(Addr a, UInt val)
{
if (*(UShort *)a != val)
hg_mem_write(a, 2, VG_(get_running_tid)());
}
-VGA_REGPARM(2) static void hg_mem_help_write_4(Addr a, UInt val)
+VG_REGPARM(2) static void hg_mem_help_write_4(Addr a, UInt val)
{
if (*(UInt *)a != val)
hg_mem_write(a, 4, VG_(get_running_tid)());
}
-VGA_REGPARM(2) static void hg_mem_help_write_N(Addr a, SizeT size)
+VG_REGPARM(2) static void hg_mem_help_write_N(Addr a, SizeT size)
{
hg_mem_write(a, size, VG_(get_running_tid)());
}
#define VG_WORDSIZE VEX_HOST_WORDSIZE
#if defined(VGA_x86)
-# define VGA_REGPARM(n) __attribute__((regparm(n)))
-#elif defined(VGA_amd64) || defined(VGA_arm)
-# define VGA_REGPARM(n) /* */
-#elif defined(VGA_ppc32)
-# define VGA_REGPARM(n) /* */
+# define VG_REGPARM(n) __attribute__((regparm(n)))
+#elif defined(VGA_amd64) || defined(VGA_arm) || defined(VGA_ppc32)
+# define VG_REGPARM(n) /* */
#else
# error Unknown arch
#endif
#define VG_(str) VGAPPEND(vgPlain_, str)
#define ML_(str) VGAPPEND(vgModuleLocal_, str)
-#define VGA_(str) VGAPPEND(vgArch_, str)
-#define VGO_(str) VGAPPEND(vgOS_, str)
-#define VGP_(str) VGAPPEND(vgPlatform_, str)
-
#endif /* __PUB_TOOL_BASICS_ASM_H */
/*--------------------------------------------------------------------*/
#ifndef __PUB_TOOL_MACHINE_H
#define __PUB_TOOL_MACHINE_H
-/* VGA_STACK_REDZONE_SZB: how many bytes below the stack pointer are validly
+/* VG_STACK_REDZONE_SZB: how many bytes below the stack pointer are validly
* addressible? */
#if defined(VGA_x86)
-# define VGA_MIN_INSTR_SZB 1
-# define VGA_MAX_INSTR_SZB 16
-# define VGA_STACK_REDZONE_SZB 0
+# define VG_MIN_INSTR_SZB 1
+# define VG_MAX_INSTR_SZB 16
+# define VG_STACK_REDZONE_SZB 0
#elif defined(VGA_amd64)
-# define VGA_MIN_INSTR_SZB 1
-# define VGA_MAX_INSTR_SZB 16
-# define VGA_STACK_REDZONE_SZB 128
+# define VG_MIN_INSTR_SZB 1
+# define VG_MAX_INSTR_SZB 16
+# define VG_STACK_REDZONE_SZB 128
#elif defined(VGA_arm)
-# define VGA_MIN_INSTR_SZB 4
-# define VGA_MAX_INSTR_SZB 4
-# define VGA_STACK_REDZONE_SZB 0
+# define VG_MIN_INSTR_SZB 4
+# define VG_MAX_INSTR_SZB 4
+# define VG_STACK_REDZONE_SZB 0
#elif defined(VGA_ppc32)
-# define VGA_MIN_INSTR_SZB 4
-# define VGA_MAX_INSTR_SZB 4
-# define VGA_STACK_REDZONE_SZB 0
+# define VG_MIN_INSTR_SZB 4
+# define VG_MAX_INSTR_SZB 4
+# define VG_STACK_REDZONE_SZB 0
#else
# error Unknown arch
#endif
specialising can optimise things significantly. If any of the
specialised cases are defined, the general case must be defined too.
- Nb: all the specialised ones must use the VGA_REGPARM(n) attribute.
+ Nb: all the specialised ones must use the VG_REGPARM(n) attribute.
*/
-void VG_(track_new_mem_stack_4) (VGA_REGPARM(1) void(*f)(Addr new_ESP));
-void VG_(track_new_mem_stack_8) (VGA_REGPARM(1) void(*f)(Addr new_ESP));
-void VG_(track_new_mem_stack_12)(VGA_REGPARM(1) void(*f)(Addr new_ESP));
-void VG_(track_new_mem_stack_16)(VGA_REGPARM(1) void(*f)(Addr new_ESP));
-void VG_(track_new_mem_stack_32)(VGA_REGPARM(1) void(*f)(Addr new_ESP));
-void VG_(track_new_mem_stack) (void(*f)(Addr a, SizeT len));
-
-void VG_(track_die_mem_stack_4) (VGA_REGPARM(1) void(*f)(Addr die_ESP));
-void VG_(track_die_mem_stack_8) (VGA_REGPARM(1) void(*f)(Addr die_ESP));
-void VG_(track_die_mem_stack_12)(VGA_REGPARM(1) void(*f)(Addr die_ESP));
-void VG_(track_die_mem_stack_16)(VGA_REGPARM(1) void(*f)(Addr die_ESP));
-void VG_(track_die_mem_stack_32)(VGA_REGPARM(1) void(*f)(Addr die_ESP));
-void VG_(track_die_mem_stack) (void(*f)(Addr a, SizeT len));
+void VG_(track_new_mem_stack_4) (VG_REGPARM(1) void(*f)(Addr new_ESP));
+void VG_(track_new_mem_stack_8) (VG_REGPARM(1) void(*f)(Addr new_ESP));
+void VG_(track_new_mem_stack_12)(VG_REGPARM(1) void(*f)(Addr new_ESP));
+void VG_(track_new_mem_stack_16)(VG_REGPARM(1) void(*f)(Addr new_ESP));
+void VG_(track_new_mem_stack_32)(VG_REGPARM(1) void(*f)(Addr new_ESP));
+void VG_(track_new_mem_stack) (void(*f)(Addr a, SizeT len));
+
+void VG_(track_die_mem_stack_4) (VG_REGPARM(1) void(*f)(Addr die_ESP));
+void VG_(track_die_mem_stack_8) (VG_REGPARM(1) void(*f)(Addr die_ESP));
+void VG_(track_die_mem_stack_12)(VG_REGPARM(1) void(*f)(Addr die_ESP));
+void VG_(track_die_mem_stack_16)(VG_REGPARM(1) void(*f)(Addr die_ESP));
+void VG_(track_die_mem_stack_32)(VG_REGPARM(1) void(*f)(Addr die_ESP));
+void VG_(track_die_mem_stack) (void(*f)(Addr a, SizeT len));
/* Used for redzone at end of thread stacks */
void VG_(track_ban_mem_stack) (void(*f)(Addr a, SizeT len));
Bool (*is_valid_aligned_word) ( Addr )
);
-extern VGA_REGPARM(1) void MAC_(new_mem_stack_4) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(die_mem_stack_4) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(new_mem_stack_8) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(die_mem_stack_8) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(new_mem_stack_12) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(die_mem_stack_12) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(new_mem_stack_16) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(die_mem_stack_16) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(new_mem_stack_32) ( Addr old_ESP );
-extern VGA_REGPARM(1) void MAC_(die_mem_stack_32) ( Addr old_ESP );
-extern void MAC_(die_mem_stack) ( Addr a, SizeT len);
-extern void MAC_(new_mem_stack) ( Addr a, SizeT len);
+extern VG_REGPARM(1) void MAC_(new_mem_stack_4) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(die_mem_stack_4) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(new_mem_stack_8) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(die_mem_stack_8) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(new_mem_stack_12) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(die_mem_stack_12) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(new_mem_stack_16) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(die_mem_stack_16) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(new_mem_stack_32) ( Addr old_ESP );
+extern VG_REGPARM(1) void MAC_(die_mem_stack_32) ( Addr old_ESP );
+extern void MAC_(die_mem_stack) ( Addr a, SizeT len);
+extern void MAC_(new_mem_stack) ( Addr a, SizeT len);
extern void* MAC_(malloc) ( ThreadId tid, SizeT n );
extern void* MAC_(__builtin_new) ( ThreadId tid, SizeT n );
ALIGNED8_NEW, ALIGNED8_DIE, \
UNALIGNED_NEW, UNALIGNED_DIE) \
\
-void VGA_REGPARM(1) MAC_(new_mem_stack_4)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(new_mem_stack_4)(Addr new_SP) \
{ \
PROF_EVENT(110, "new_mem_stack_4"); \
if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
} else { \
- UNALIGNED_NEW ( -VGA_STACK_REDZONE_SZB + new_SP, 4 ); \
+ UNALIGNED_NEW ( -VG_STACK_REDZONE_SZB + new_SP, 4 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(die_mem_stack_4)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(die_mem_stack_4)(Addr new_SP) \
{ \
PROF_EVENT(120, "die_mem_stack_4"); \
if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-4 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-4 ); \
} else { \
- UNALIGNED_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-4, 4 ); \
+ UNALIGNED_DIE ( -VG_STACK_REDZONE_SZB + new_SP-4, 4 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(new_mem_stack_8)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(new_mem_stack_8)(Addr new_SP) \
{ \
PROF_EVENT(111, "new_mem_stack_8"); \
if (VG_IS_8_ALIGNED(new_SP)) { \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
} else if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+4 ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP+4 ); \
} else { \
- UNALIGNED_NEW ( -VGA_STACK_REDZONE_SZB + new_SP, 8 ); \
+ UNALIGNED_NEW ( -VG_STACK_REDZONE_SZB + new_SP, 8 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(die_mem_stack_8)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(die_mem_stack_8)(Addr new_SP) \
{ \
PROF_EVENT(121, "die_mem_stack_8"); \
if (VG_IS_8_ALIGNED(new_SP)) { \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-8 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-8 ); \
} else if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-8 ); \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-4 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-8 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-4 ); \
} else { \
- UNALIGNED_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-8, 8 ); \
+ UNALIGNED_DIE ( -VG_STACK_REDZONE_SZB + new_SP-8, 8 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(new_mem_stack_12)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(new_mem_stack_12)(Addr new_SP) \
{ \
PROF_EVENT(112, "new_mem_stack_12"); \
if (VG_IS_8_ALIGNED(new_SP)) { \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+8 ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP+8 ); \
} else if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+4 ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+4 ); \
} else { \
- UNALIGNED_NEW ( -VGA_STACK_REDZONE_SZB + new_SP, 12 ); \
+ UNALIGNED_NEW ( -VG_STACK_REDZONE_SZB + new_SP, 12 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(die_mem_stack_12)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(die_mem_stack_12)(Addr new_SP) \
{ \
PROF_EVENT(122, "die_mem_stack_12"); \
/* Note the -12 in the test */ \
if (VG_IS_8_ALIGNED(new_SP-12)) { \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-12 ); \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-4 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-12 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-4 ); \
} else if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-12 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-8 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-12 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-8 ); \
} else { \
- UNALIGNED_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-12, 12 ); \
+ UNALIGNED_DIE ( -VG_STACK_REDZONE_SZB + new_SP-12, 12 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(new_mem_stack_16)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(new_mem_stack_16)(Addr new_SP) \
{ \
PROF_EVENT(113, "new_mem_stack_16"); \
if (VG_IS_8_ALIGNED(new_SP)) { \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+8 ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+8 ); \
} else if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+4 ); \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+12 ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+4 ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP+12 ); \
} else { \
- UNALIGNED_NEW ( -VGA_STACK_REDZONE_SZB + new_SP, 16 ); \
+ UNALIGNED_NEW ( -VG_STACK_REDZONE_SZB + new_SP, 16 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(die_mem_stack_16)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(die_mem_stack_16)(Addr new_SP) \
{ \
PROF_EVENT(123, "die_mem_stack_16"); \
if (VG_IS_8_ALIGNED(new_SP)) { \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-16 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-8 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-16 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-8 ); \
} else if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-16 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-12 ); \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-4 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-16 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-12 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-4 ); \
} else { \
- UNALIGNED_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-16, 16 ); \
+ UNALIGNED_DIE ( -VG_STACK_REDZONE_SZB + new_SP-16, 16 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(new_mem_stack_32)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(new_mem_stack_32)(Addr new_SP) \
{ \
PROF_EVENT(114, "new_mem_stack_32"); \
if (VG_IS_8_ALIGNED(new_SP)) { \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+8 ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+16 ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+24 ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+8 ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+16 ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+24 ); \
} else if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+4 ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+12 ); \
- ALIGNED8_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+20 ); \
- ALIGNED4_NEW ( -VGA_STACK_REDZONE_SZB + new_SP+28 ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+4 ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+12 ); \
+ ALIGNED8_NEW ( -VG_STACK_REDZONE_SZB + new_SP+20 ); \
+ ALIGNED4_NEW ( -VG_STACK_REDZONE_SZB + new_SP+28 ); \
} else { \
- UNALIGNED_NEW ( -VGA_STACK_REDZONE_SZB + new_SP, 32 ); \
+ UNALIGNED_NEW ( -VG_STACK_REDZONE_SZB + new_SP, 32 ); \
} \
} \
\
-void VGA_REGPARM(1) MAC_(die_mem_stack_32)(Addr new_SP) \
+void VG_REGPARM(1) MAC_(die_mem_stack_32)(Addr new_SP) \
{ \
PROF_EVENT(124, "die_mem_stack_32"); \
if (VG_IS_8_ALIGNED(new_SP)) { \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-32 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-24 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-16 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP- 8 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-32 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-24 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-16 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP- 8 ); \
} else if (VG_IS_4_ALIGNED(new_SP)) { \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-32 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-28 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-20 ); \
- ALIGNED8_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-12 ); \
- ALIGNED4_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-4 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-32 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-28 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-20 ); \
+ ALIGNED8_DIE ( -VG_STACK_REDZONE_SZB + new_SP-12 ); \
+ ALIGNED4_DIE ( -VG_STACK_REDZONE_SZB + new_SP-4 ); \
} else { \
- UNALIGNED_DIE ( -VGA_STACK_REDZONE_SZB + new_SP-32, 32 ); \
+ UNALIGNED_DIE ( -VG_STACK_REDZONE_SZB + new_SP-32, 32 ); \
} \
} \
\
void MAC_(new_mem_stack) ( Addr a, SizeT len ) \
{ \
PROF_EVENT(115, "new_mem_stack"); \
- UNALIGNED_NEW ( -VGA_STACK_REDZONE_SZB + a, len ); \
+ UNALIGNED_NEW ( -VG_STACK_REDZONE_SZB + a, len ); \
} \
\
void MAC_(die_mem_stack) ( Addr a, SizeT len ) \
{ \
PROF_EVENT(125, "die_mem_stack"); \
- UNALIGNED_DIE ( -VGA_STACK_REDZONE_SZB + a, len ); \
+ UNALIGNED_DIE ( -VG_STACK_REDZONE_SZB + a, len ); \
}
#endif /* __MAC_SHARED_H */
/*------------------------------------------------------------*/
/* Functions defined in mc_main.c */
-extern VGA_REGPARM(1) void MC_(helperc_complain_undef) ( HWord );
+extern VG_REGPARM(1) void MC_(helperc_complain_undef) ( HWord );
extern void MC_(helperc_value_check8_fail) ( void );
extern void MC_(helperc_value_check4_fail) ( void );
extern void MC_(helperc_value_check1_fail) ( void );
extern void MC_(helperc_value_check0_fail) ( void );
-extern VGA_REGPARM(1) void MC_(helperc_STOREV8) ( Addr, ULong );
-extern VGA_REGPARM(2) void MC_(helperc_STOREV4) ( Addr, UWord );
-extern VGA_REGPARM(2) void MC_(helperc_STOREV2) ( Addr, UWord );
-extern VGA_REGPARM(2) void MC_(helperc_STOREV1) ( Addr, UWord );
+extern VG_REGPARM(1) void MC_(helperc_STOREV8) ( Addr, ULong );
+extern VG_REGPARM(2) void MC_(helperc_STOREV4) ( Addr, UWord );
+extern VG_REGPARM(2) void MC_(helperc_STOREV2) ( Addr, UWord );
+extern VG_REGPARM(2) void MC_(helperc_STOREV1) ( Addr, UWord );
-extern VGA_REGPARM(1) UWord MC_(helperc_LOADV1) ( Addr );
-extern VGA_REGPARM(1) UWord MC_(helperc_LOADV2) ( Addr );
-extern VGA_REGPARM(1) UWord MC_(helperc_LOADV4) ( Addr );
-extern VGA_REGPARM(1) ULong MC_(helperc_LOADV8) ( Addr );
+extern VG_REGPARM(1) UWord MC_(helperc_LOADV1) ( Addr );
+extern VG_REGPARM(1) UWord MC_(helperc_LOADV2) ( Addr );
+extern VG_REGPARM(1) UWord MC_(helperc_LOADV4) ( Addr );
+extern VG_REGPARM(1) ULong MC_(helperc_LOADV8) ( Addr );
extern void MC_(helperc_MAKE_STACK_UNINIT) ( Addr base, UWord len );
/* ------------------------ Size = 8 ------------------------ */
-VGA_REGPARM(1)
+VG_REGPARM(1)
ULong MC_(helperc_LOADV8) ( Addr aA )
{
PROF_EVENT(200, "helperc_LOADV8");
# endif
}
-VGA_REGPARM(1)
+VG_REGPARM(1)
void MC_(helperc_STOREV8) ( Addr aA, ULong vbytes )
{
PROF_EVENT(210, "helperc_STOREV8");
/* ------------------------ Size = 4 ------------------------ */
-VGA_REGPARM(1)
+VG_REGPARM(1)
UWord MC_(helperc_LOADV4) ( Addr aA )
{
PROF_EVENT(220, "helperc_LOADV4");
# endif
}
-VGA_REGPARM(2)
+VG_REGPARM(2)
void MC_(helperc_STOREV4) ( Addr aA, UWord vbytes )
{
PROF_EVENT(230, "helperc_STOREV4");
/* ------------------------ Size = 2 ------------------------ */
-VGA_REGPARM(1)
+VG_REGPARM(1)
UWord MC_(helperc_LOADV2) ( Addr aA )
{
PROF_EVENT(240, "helperc_LOADV2");
# endif
}
-VGA_REGPARM(2)
+VG_REGPARM(2)
void MC_(helperc_STOREV2) ( Addr aA, UWord vbytes )
{
PROF_EVENT(250, "helperc_STOREV2");
/* ------------------------ Size = 1 ------------------------ */
-VGA_REGPARM(1)
+VG_REGPARM(1)
UWord MC_(helperc_LOADV1) ( Addr aA )
{
PROF_EVENT(260, "helperc_LOADV1");
}
-VGA_REGPARM(2)
+VG_REGPARM(2)
void MC_(helperc_STOREV1) ( Addr aA, UWord vbyte )
{
PROF_EVENT(270, "helperc_STOREV1");
mc_record_value_error ( VG_(get_running_tid)(), 8 );
}
-VGA_REGPARM(1) void MC_(helperc_complain_undef) ( HWord sz )
+VG_REGPARM(1) void MC_(helperc_complain_undef) ( HWord sz )
{
mc_record_value_error ( VG_(get_running_tid)(), (Int)sz );
}