Commit Graph

40 Commits

Author SHA1 Message Date
Nicholas Nethercote
3e21a5a1fd Whoops, syscall.S is platform-specific, and so must go in x86-linux/ rather
than x86/.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2800
2004-10-19 14:23:46 +00:00
Nicholas Nethercote
4b44d1df7d Arch-abstraction:
- Moved all assembly files in coregrind/ into coregrind/x86/.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2799
2004-10-19 13:48:06 +00:00
Nicholas Nethercote
266836ab69 Arch-abstraction:
- Factored out the remaining arch-specific code from vg_libpthread.c.
- Also fixed up the build process for x86/libpthread.c, which was done
  wrongly in the previous commit.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2798
2004-10-19 13:18:00 +00:00
Nicholas Nethercote
7ac2403543 Arch-abstraction:
- Started out x86-specific libpthread code; began with spinlocks.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2797
2004-10-19 11:38:48 +00:00
Nicholas Nethercote
411cf69104 Arch-abstraction:
- just a couple more constants moved


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2784
2004-10-18 14:08:16 +00:00
Nicholas Nethercote
493933b1c6 Arch-abstraction: a nice change that removes the need for ume_entry.S. Instead
of using an assembly hack to find the stack pointer at startup, we find it from
argv.  It's much simpler, avoids linking games, is platform independent, and
works on PPC.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2782
2004-10-18 11:52:17 +00:00
Tom Hughes
e531fcba56 If a thread is waiting on a mutex or condition variable when a signal is
delivered that the thread state is temporarily changed from WaitMX or WaitCV
to Running while the signal handler is running. The original state is then
restored when the handler returns.

This patch forces the associated_mx and associated_cv values to be cleared
at the same time and the original values restored afterwards. Without this
the scheduler state will not be considered sane while the handler is running.

This is based on a patch from Kenneth Schalk and fixes a problem he had
with posting to a semaphore in a signal handler. It also allows a couple
of assertions in the scheduler sanity check to be uncommented.

BUG: 72082


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2778
2004-10-16 16:17:06 +00:00
Nicholas Nethercote
6ca6b576e1 Since we use "-Wl,-e,_ume_entry" when linking stage2, there is no need to
rename "_start" as "_ume_entry" in stage2.lds.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2766
2004-10-14 10:58:28 +00:00
Nicholas Nethercote
7942c92bd6 Some combined cleaning up and arch-abstraction, involving UME and start-up:
- removed some assumptions that arch==x86 in Makefile.am files

- removed ume_arch.h;  moved its contents into ume.h.  There was no need for
  these to be separate.

- moved ume_go.c into an x86/ subdir;  gave it the more meaningful name
  jmp_with_stack.c in the process (the corresponding function also got the name
  change)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2757
2004-10-13 17:55:31 +00:00
Nicholas Nethercote
fcae323a88 Arch-abstraction:
- move LDT stuff out of core, into x86-linux specific stuff.  Some of it
  (VG_(do_useseg)()?) may be really x86-specific, rather than
  x86/linux-specific, but that can be fixed later if it's really shared with
  another OS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2748
2004-10-13 13:05:20 +00:00
Nicholas Nethercote
b24f257005 Arch-abstraction:
- abstract out three ELF constants


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2741
2004-10-09 19:08:08 +00:00
Nicholas Nethercote
d0d1c64875 Arch-abstraction:
- abstract out all the SET_THREAD_REG macros


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2716
2004-09-13 16:11:09 +00:00
Nicholas Nethercote
db32bd76a1 Arch-abstraction:
- add file for x86-specific signal stuff.  Should have gone in with the last
  commit, whoops.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2715
2004-09-13 16:10:17 +00:00
Nicholas Nethercote
d286eeff03 Arch-abstraction:
- abstract out signal frame pushing/popping


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2713
2004-09-13 14:15:36 +00:00
Nicholas Nethercote
fe64d52a7b Arch-abstraction:
- in vg_scheduler.c, abstract out some stack manipulations.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2711
2004-09-13 13:16:40 +00:00
Nicholas Nethercote
68da16321d Arch-abstraction:
- in vg_symtab2.c, abstract out mentions of specific registers.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2703
2004-09-11 23:48:22 +00:00
Nicholas Nethercote
7615eab7a2 Arch-abstraction:
- abstract out some inline asm


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2696
2004-09-11 15:30:33 +00:00
Nicholas Nethercote
db64449073 Arch-abstraction:
- added x86-linux/core_platform.h
- factored out getting/setting of system call arguments, put it in
  platform-specific part.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2685
2004-09-10 17:42:11 +00:00
Nicholas Nethercote
0792fdf54d Arch-abstraction:
- add a new file x86/x86_private.h, a header for the x86-specific stuff that is
  not seen by the core.
- move some LDT function decls into x86_private.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2683
2004-09-10 16:31:11 +00:00
Nicholas Nethercote
d544b7d93d Arch-abstraction:
- move some LDT constants into the x86-specific code.
- abstract out uses of LDT and TLS in vg_scheduler into the x86-specific code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2682
2004-09-10 15:33:32 +00:00
Nicholas Nethercote
0a67ac22b4 Redo the regs setting for db-attach, in a way that works for PPC, which doesn't
support ptrace(SETREGS,...).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2678
2004-09-09 13:40:31 +00:00
Nicholas Nethercote
0c56e65d07 Arch-abstraction:
- factored out pointercheck setup.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2671
2004-09-07 22:38:23 +00:00
Nicholas Nethercote
d5e1fb3c1d Arch-abstraction:
- factored out the setting of machine registers used when attaching the
  debugger.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2670
2004-09-07 22:22:39 +00:00
Nicholas Nethercote
28864b7564 Arch-abstraction:
- moved a lot of the baseBlock initialisation into x86/, including all the
  VGOFF variables, and all the x86 asm helper functions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2668
2004-09-06 16:43:37 +00:00
Nicholas Nethercote
cc5d7881d8 Arch-abstraction: made vg_execontext.c arch-independent, based on Paul
Mackerras's work.

- introduced arch-neutral macros for getting the instruction/frame/stack
  pointers.

- renamed ExeContext.eips as ExeContext.ips

- renamed esp/ebp/eip to sp/fp/ip in several related files and arch-neutralised
  various comments

- introduced arch-neutral macros for walking the stack


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2663
2004-09-05 21:32:37 +00:00
Nicholas Nethercote
8762c939f2 Simplify calculation of VG_(shadow_end) to avoid an obscure bug on Paul M's PPC
port caused by rounding errors.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2661
2004-09-04 15:53:35 +00:00
Nicholas Nethercote
b392873e38 Removed x86/ume_archdefs.h; moved CLIENT_BASE into x86/core_arch.h.
(CLIENT_BASE wasn't really part of UME.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2659
2004-09-03 23:25:33 +00:00
Nicholas Nethercote
e8b7f64002 Removed x86/ume_arch_defs.c, which just defined the never-used variable
CLIENT_START.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2658
2004-09-03 14:24:22 +00:00
Nicholas Nethercote
18355ff96b Arch-abstraction:
- Added include/x86/:  contains tool_arch.h, Makefile.am, .cvsignore.

- Added coregrind/x86/state.c.  Contains some arch-specific code for dealing
  with x86 registers -- eg. setting up the baseBlock, loading/saving the whole
  register state.  It is compiled into coregrind/x86/libarch.a and linked via
  ${VG_ARCH} with the core.

  Relatedly, also added coregrind/x86/{core_arch.h,core_arch_asm.h}.

- Correspondingly abstracted the register state out of ThreadState.  This
  affected every place that touches registers, and there are a lot of them.
  (Eventually all the register touching should be abstracted out in an
  arch-neutral way, but not yet;  one step at a time.)

- Added some declarations about register loading/saving functions to core.h;
  all architectures will have to provide these functions.

- Rejigged the build system so that the arch-specific stuff is all done via
  ${VG_ARCH}, rather than naming e.g. x86/ directly.  Appropriate -I arguments
  are used so that all the headers are found, etc.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2656
2004-09-03 13:45:29 +00:00
Nicholas Nethercote
cd1a723aa0 Makefile.am minor correction
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2602
2004-08-23 15:42:21 +00:00
Tom Hughes
414846a941 Removed all uses of nested functions as they only work with gcc and
cause the stack to be marked as executable in order for them to work.

All assembler files have also had a declaration added so that the
object they generate will be marked as not needing an executable stack.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2446
2004-06-27 17:37:21 +00:00
Nicholas Nethercote
41dd3b13ee Fix broken "make dist".
Doesn't fix "make distcheck", however, because this happens:

  /usr/bin/ld: cannot open linker script file ../../coregrind/x86/stage2.lds:
  No such file or directory

For some reason I can't work out, that file is built when you make in a CVS
tree, or manually from a "make dist" tarball, but not when you "make
distcheck".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2239
2004-02-05 14:27:36 +00:00
Jeremy Fitzhardinge
2c56057c32 Add some comments
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2205
2004-01-19 21:47:25 +00:00
Julian Seward
9a14969e96 Add copyright notices to new files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2175
2004-01-04 03:46:11 +00:00
Jeremy Fitzhardinge
f9cff4f423 It seems newer linkers have scripts which mention the base address twice
on one line.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2149
2003-12-24 01:50:51 +00:00
Jeremy Fitzhardinge
1c4717d8bd Make sure we use gcc's ld, not whatever random ld we happen to find in the path.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2148
2003-12-23 01:15:01 +00:00
Dirk Mueller
4ed09ea00c ignore
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2124
2003-12-17 13:28:12 +00:00
Dirk Mueller
fe0b4d3681 ignore
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2123
2003-12-17 13:18:24 +00:00
Jeremy Fitzhardinge
1f4c6deede Auto-generate stage2.lds so that the linker script matches the local
linker.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2122
2003-12-16 22:26:45 +00:00
Jeremy Fitzhardinge
822231c4b0 Add and delete all the files which need adding and deleting.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2119
2003-12-16 02:14:00 +00:00