211 Commits

Author SHA1 Message Date
Nicholas Nethercote
ba41261f08 Converted modify_ldt() and init_module(); the old code for init_module() was
seemingly totally wrong, as the man page doesn't reflect the real kernel code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3009
2004-11-15 16:40:40 +00:00
Nicholas Nethercote
a0ce711edb Converted more syscalls
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3004
2004-11-15 14:32:12 +00:00
Nicholas Nethercote
ad980e636a Converted a few more, including clone() which I'm not at all sure about, and
ipc() which is done too simplistically.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3002
2004-11-15 12:28:58 +00:00
Nicholas Nethercote
8e2be498fc Converted a couple more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2991
2004-11-14 17:03:47 +00:00
Nicholas Nethercote
e0c74bbbfa converted a few more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2987
2004-11-14 13:42:51 +00:00
Tom Hughes
8448d42efa Add support for most of the console driver ioctls. This fixes one of
the ioctls complained about in bug 93096 as well as one that came up
on the mailing list a few weeks ago.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2982
2004-11-13 00:36:15 +00:00
Nicholas Nethercote
66213608e7 converted some more
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2976
2004-11-12 19:55:08 +00:00
Nicholas Nethercote
be04c2e5d9 Remove unnecessary comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2971
2004-11-12 17:13:17 +00:00
Nicholas Nethercote
691c66f51d Converted lookup_dcookie.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2966
2004-11-12 13:29:24 +00:00
Nicholas Nethercote
9f628720a2 Converted a bunch more syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2960
2004-11-11 18:00:47 +00:00
Nicholas Nethercote
746332ff63 Minor VKI_* fixups.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2943
2004-11-06 16:31:43 +00:00
Nicholas Nethercote
1c674f8d7c Get rid of compile errors and warnings (ahem).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2925
2004-11-04 19:10:43 +00:00
Nicholas Nethercote
e59b9df749 64-bit cleanness: introduced OffT type for off_t, used it in a few important
places.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2922
2004-11-04 18:39:22 +00:00
Nicholas Nethercote
528046b537 64-bit cleanness: make the hash-table have UWord keys instead of UInt keys.
Allows addresses as keys.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2916
2004-11-04 16:39:43 +00:00
Nicholas Nethercote
d8fc746ba4 64-bit cleanness: Yet more UInt-->SizeT changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2910
2004-11-03 18:10:37 +00:00
Nicholas Nethercote
c73601d666 64-bit cleanness:
- Use SizeT instead of UInt for new_mem_stack and all the related functions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2908
2004-11-02 13:29:50 +00:00
Nicholas Nethercote
e245f2aeb0 64-bit cleanness: Converted malloc() et al to use SizeT rather than Int.
This required some tricks with casting to maintain Memcheck's silly (ie.
negative) arg checking.  The allocator was also changed accordingly. It
should now be able to allocate more than 4GB blocks on 64-bit platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2906
2004-11-02 12:36:02 +00:00
Nicholas Nethercote
db131cacab unbreak compilation...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2900
2004-11-01 19:36:46 +00:00
Nicholas Nethercote
e0ff83bc39 - Make find_auxv() word-size independent.
- Introduced a new file, basic_types.h, for the basic types (eg. Int, Word).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2896
2004-11-01 18:22:05 +00:00
Nicholas Nethercote
a11072f0f9 Do 'struct termios' properly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2891
2004-11-01 16:22:00 +00:00
Tom Hughes
459c7429d6 Ignore generated makefiles.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2889
2004-11-01 09:52:12 +00:00
Nicholas Nethercote
c4cf15dc21 Arch-abstraction:
- Added include/x86-linux/ and include/linux/ subdirectories, with Makefile.am
  files.

- Overhauled the definitions of kernel types.  include/vg_kerneliface.h is now
  three files, include/linux/vki.h, include/x86-linux/vki_arch.h, and
  include/x86-linux/vki_arch_posixtypes.h.  These files separate the
  common/Linux and x86/Linux parts cleanly.  All code is copied verbatim from
  the relevant kernel headers, except that VKI_/vki_ prefixes are added as
  necessary to distinguish them from glibc types.  (This is done consistently,
  unlike previously when some types did not have the prefixes.)

  All code is clearly marked to show which particular header file it came from,
  and the Linux version used.  (I used 2.6.8.1, the most recent stable release,
  for all of them.)

  A few of the types changed;  this is because they changed between the older
  versions of Linux and the current 2.6.8.1.  I checked that all these changes
  were ok with respect to backwards compatibility for our purposes.

- vg_unsafe.h has been removed;  we are no longer including any kernel headers,
  as we have our own copies for everything.  This is because installed kernel
  headers are not reliable, and often cause compilation problems. (bug
  #92420 is a recent example)

- Removed some no-longer-needed header-presence tests from configure.in.

- Some code in the rest of Valgrind was changed to account for some slight
  changes in the names of our VKI_/vki_ kernel constants and types.

- Updated README_MISSING_SYSCALL_OR_IOCTL accordingly.

- Fixed off-by-one error with VKI_GDT_ENTRY_TLS_MAX (merged from stable branch)

The end result is that the kernel types situation should be much clearer, and
similar files can be created relatively easily for other architectures as
necessary.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2884
2004-10-31 18:48:21 +00:00
Nicholas Nethercote
02549cec80 Code formatting changes only.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2850
2004-10-26 13:00:12 +00:00
Nicholas Nethercote
2488e54254 Comment cleanups only.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2849
2004-10-26 12:56:58 +00:00
Nicholas Nethercote
7627b3fcbe tweak
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2838
2004-10-25 19:33:26 +00:00
Nicholas Nethercote
d1f87f21f0 Arch-abstraction:
- Make Helgrind totally arch-agnostic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2815
2004-10-20 10:58:09 +00:00
Nicholas Nethercote
102a2ee374 Update
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2806
2004-10-19 17:30:47 +00:00
Nicholas Nethercote
bf0340373c Arch-abstraction: fix up valgrind.h for future inclusion of other
architectures.  Had to recast it as valgrind.h.in;  now at configure time the
appropriate #define is set so that the appropriate snippet of assembly code is
chosen.  It's done this way rather than with x86/ etc. directories like the
rest of Valgrind, because this header file must stand alone for inclusion by
other programs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2794
2004-10-18 18:07:49 +00:00
Nicholas Nethercote
0067b11b99 Remove unused macros.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2719
2004-09-14 11:55:36 +00:00
Nicholas Nethercote
4ecc334c35 Arch-abstraction:
- Moved VG_MAX_REALREGS into x86/ part.
- Tweaked basic types so they're suitable for both 32-bit and 64-bit platforms.
  Main change was to change 'Addr' to "unsigned long" which is the same size as
  a pointer.  Had to make a couple of minor changes to accommodate this.
  Also, introduced 'UWord' and 'Word' types which will be necessary for making
  code 64-bit clean.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2669
2004-09-07 10:17:02 +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
49eea042c1 Arch-abstraction: introduce constants for min and max instruction sizes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2660
2004-09-04 15:28:37 +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
3dc0e6069d Tweak some comments.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2651
2004-09-02 15:49:09 +00:00
Nicholas Nethercote
90369deb78 Arch-abstraction:
- renamed "vg_constants.h" as "core_asm.h".
- renamed "vg_constants_skin.h" as "tool_asm.h".
- renamed "mc_constants.h" as "mc_asm.h".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2650
2004-09-02 15:37:39 +00:00
Nicholas Nethercote
2221d976a8 Arch-abstraction: whoops II, forgot to add the (residual) vg_skin.h, which just
points to tool.h.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2649
2004-09-02 08:55:34 +00:00
Nicholas Nethercote
10d04230ef Arch-abstraction: Whoops, forgot to add tool.h.base. Also updated .cvsignore.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2648
2004-09-02 08:54:27 +00:00
Nicholas Nethercote
13a74aa53a Arch-abstraction: renamed "vg_skin.h" as "tool.h". Kept a residual vg_skin.h
(which just #includes tool.h) for backward-compatibility.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2647
2004-09-02 08:51:43 +00:00
Nicholas Nethercote
6a5de86389 Arch-abstraction: renamed "vg_include.h" as "core.h" (a few that I missed in
my previous commit).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2645
2004-09-02 08:10:13 +00:00
Tom Hughes
476075730e Add vki_itimerspec definition for POSIX timer support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2631
2004-08-30 20:31:35 +00:00
Tom Hughes
dbff330cf4 Removed comma at the end of an enumerator list - this is allowed
in C99 but not in C89 except as a GNU extension so it's probably
best not to rely on it.

Patch from Jeroen N. Witmond <jnw@xs4all.nl>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2617
2004-08-25 13:25:30 +00:00
Nicholas Nethercote
a2b3609df7 Small step in factoring out arch-specific code: replace
__attribute((regparm(n))) with REGPARM(n) everywhere.  REGPARM() is defined in
vg_skin.h, but will eventually be defined separately for each arch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2601
2004-08-23 15:06:23 +00:00
Tom Hughes
546afbe696 Add support for the POSIX message queue system calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2585
2004-08-14 18:52:27 +00:00
Nicholas Nethercote
db16c95eb8 Remove no-longer-used prefixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2565
2004-08-04 10:07:47 +00:00
Nicholas Nethercote
38ff4e69d1 Comment changes only: s/skin/tool/
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2555
2004-08-03 13:29:09 +00:00
Tom Hughes
f10c38f7e5 Modify the ipc system call so that only those calls which may block
are treated as blocking.

This fixes bug #86000 because shmat is no longer treated as blocking
and it is therefore no longer possible for two threads to try and use
the same address for the shared memory segment.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2536
2004-07-29 22:40:07 +00:00
Tom Hughes
1afbb3fc45 Modified the fcntl system call so that only those reason codes which
can block (ie F_SETLKW) are treated as blocking.

This resolves the F_SETOWN problem described in bug #85969.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2535
2004-07-29 21:20:11 +00:00
Nicholas Nethercote
43f025c169 Add another C call helper.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2510
2004-07-19 08:18:00 +00:00
Tom Hughes
6374702f6c Commit missing kernel interface definitions for async I/O calls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2486
2004-07-16 06:03:24 +00:00