]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Arch-abstraction:
authorNicholas Nethercote <n.nethercote@gmail.com>
Wed, 13 Oct 2004 13:05:20 +0000 (13:05 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Wed, 13 Oct 2004 13:05:20 +0000 (13:05 +0000)
- 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

coregrind/Makefile.am
coregrind/core.h
coregrind/x86-linux/Makefile.am
coregrind/x86-linux/core_platform.h
coregrind/x86-linux/ldt.c [moved from coregrind/vg_ldt.c with 99% similarity]
coregrind/x86/core_arch.h

index 00aad6ff3d280edbdcdcee4b9a5fece2219cd2ea..03782b410e45b66bf33932d0f70be3f5a8f7c732 100644 (file)
@@ -79,7 +79,6 @@ stage2_SOURCES = \
        vg_toolint.c \
        vg_translate.c \
        vg_transtab.c \
-       vg_ldt.c \
        vg_cpuid.S
 stage2_DEPENDENCIES = $(srcdir)/valgrind.vs x86/stage2.lds
 stage2_LDFLAGS=-Wl,--export-dynamic -Wl,-e,_ume_entry  -g \
@@ -92,6 +91,7 @@ stage2_LDADD= \
        demangle/dyn-string.o \
        demangle/safe-ctype.o \
        ${VG_ARCH}/libarch.a \
+       ${VG_PLATFORM}/libplatform.a \
        -ldl
 
 vg_intercept.c: $(srcdir)/gen_intercepts.pl $(srcdir)/vg_intercept.c.base
index bc75b09f7441ff37dcfb46f4128685edd2f12fc9..01808080957352b560788675bcc3bd4930a09440 100644 (file)
@@ -607,25 +607,6 @@ struct vg_mallocfunc_info {
 
 extern Bool VG_(sk_malloc_called_by_scheduler);
 
-/* ---------------------------------------------------------------------
-   Exports of vg_ldt.c
-   ------------------------------------------------------------------ */
-
-/* Simulate the modify_ldt syscall. */
-extern Int VG_(sys_modify_ldt) ( ThreadId tid,
-                                 Int func, void* ptr, UInt bytecount );
-
-/* Simulate the {get,set}_thread_area syscalls. */
-extern Int VG_(sys_set_thread_area) ( ThreadId tid,
-                                      struct vki_modify_ldt_ldt_s* info );
-extern Int VG_(sys_get_thread_area) ( ThreadId tid,
-                                      struct vki_modify_ldt_ldt_s* info );
-
-/* Called from generated code.  Given a segment selector and a virtual
-   address, return a linear address, and do limit checks too. */
-extern Addr VG_(do_useseg) ( UInt seg_selector, Addr virtual_addr );
-
-
 /* ---------------------------------------------------------------------
    Exports of vg_libpthread.c
    ------------------------------------------------------------------ */
index 31e8cc5a01a6db562f6174d5a84642df76bbc60c..451e4dc4521be72ee626424158dd9d0ee0a7971b 100644 (file)
@@ -6,3 +6,9 @@ AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer -g
 noinst_HEADERS = \
        core_platform.h \
        vki_unistd.h
+
+noinst_LIBRARIES = libplatform.a
+
+
+libplatform_a_SOURCES = \
+       ldt.c
index c7bb37a3e038e3614cdfacf721b59c16e71ee905..6ffe040c6b04036d525b7c0d8408a89cd241dd77 100644 (file)
 
 #endif   // __X86_LINUX_CORE_PLATFORM_H
 
+/* ---------------------------------------------------------------------
+   Exports of vg_ldt.c
+   ------------------------------------------------------------------ */
+
+// XXX: eventually all these should be x86-private, and not visible to the
+// core (except maybe do_useseg()?)
+
+/* Simulate the modify_ldt syscall. */
+extern Int VG_(sys_modify_ldt) ( ThreadId tid,
+                                 Int func, void* ptr, UInt bytecount );
+
+/* Simulate the {get,set}_thread_area syscalls. */
+extern Int VG_(sys_set_thread_area) ( ThreadId tid,
+                                      struct vki_modify_ldt_ldt_s* info );
+extern Int VG_(sys_get_thread_area) ( ThreadId tid,
+                                      struct vki_modify_ldt_ldt_s* info );
+
+/* Called from generated code.  Given a segment selector and a virtual
+   address, return a linear address, and do limit checks too. */
+extern Addr VG_(do_useseg) ( UInt seg_selector, Addr virtual_addr );
+
+
+
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
 /*--------------------------------------------------------------------*/
similarity index 99%
rename from coregrind/vg_ldt.c
rename to coregrind/x86-linux/ldt.c
index d83c9f36004fec5ffbc3bf3fec0e6dd551a2b0b8..42b976bd541b1757ba8eff452d017ebe10c23e1c 100644 (file)
@@ -91,7 +91,6 @@
 /* The size of each LDT entry == sizeof(VgLdtEntry) */
 #define VG_LDT_ENTRY_SIZE     8
 
-
 /* Allocate and deallocate LDTs for threads. */
 
 /* Create an LDT.  If the parent_ldt is NULL, zero out the
index 019279808d00795f9635bdbd6bf05ec552416d5b..d3469f5a8dbdfd2d180073ee0ca9b70266d86891 100644 (file)
@@ -193,9 +193,11 @@ extern void VG_(helper_AAM);
 extern void VG_(helper_cmpxchg8b);
 
 /* ---------------------------------------------------------------------
-   Exports of vg_ldt.c
+   LDT type             
    ------------------------------------------------------------------ */
 
+// XXX: eventually this will be x86-private, not seen by the core(?)
+
 /* This is the hardware-format for a segment descriptor, ie what the
    x86 actually deals with.  It is 8 bytes long.  It's ugly.  */
 
@@ -223,7 +225,6 @@ typedef struct _LDT_ENTRY {
     LdtEnt;
 } VgLdtEntry;
 
-
 /* ---------------------------------------------------------------------
    Constants pertaining to the simulated CPU state, VG_(baseBlock),
    which need to go here to avoid ugly circularities.