From: Nicholas Nethercote Date: Wed, 18 Aug 2004 23:11:45 +0000 (+0000) Subject: Rename VGOFF_(tls) to VGOFF_(tls_ptr) to make it clear it's not the same as X-Git-Tag: svn/VALGRIND_2_2_0~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef872d393b9833334489b06db2e766ec30842000;p=thirdparty%2Fvalgrind.git Rename VGOFF_(tls) to VGOFF_(tls_ptr) to make it clear it's not the same as ThreadState.tls. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2593 --- diff --git a/coregrind/vg_include.h b/coregrind/vg_include.h index f19a1ace95..7bd817f394 100644 --- a/coregrind/vg_include.h +++ b/coregrind/vg_include.h @@ -1614,7 +1614,7 @@ extern Int VGOFF_(sh_eflags); extern Int VGOFF_(ldt); /* This thread's TLS pointer. */ -extern Int VGOFF_(tls); +extern Int VGOFF_(tls_ptr); /* Nb: Most helper offsets are in include/vg_skin.h, for use by tools */ diff --git a/coregrind/vg_ldt.c b/coregrind/vg_ldt.c index 4af6f11095..ba9b245bfe 100644 --- a/coregrind/vg_ldt.c +++ b/coregrind/vg_ldt.c @@ -200,7 +200,7 @@ Addr VG_(do_useseg) ( UInt seg_selector, Addr virtual_addr ) /* Come up with a suitable GDT entry. We look at the thread's TLS array, which is pointed to by a VG_(baseBlock) entry. */ - the_tls = (VgLdtEntry*)VG_(baseBlock)[VGOFF_(tls)]; + the_tls = (VgLdtEntry*)VG_(baseBlock)[VGOFF_(tls_ptr)]; base = (Addr)wine_ldt_get_base ( &the_tls[seg_selector-VKI_GDT_TLS_MIN] ); limit = (UInt)wine_ldt_get_limit ( &the_tls[seg_selector-VKI_GDT_TLS_MIN] ); } else { diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index f80a75bca3..a0f96932de 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -2103,7 +2103,7 @@ Int VGOFF_(m_eflags) = INVALID_OFFSET; Int VGOFF_(m_dflag) = INVALID_OFFSET; Int VGOFF_(m_ssestate) = INVALID_OFFSET; Int VGOFF_(ldt) = INVALID_OFFSET; -Int VGOFF_(tls) = INVALID_OFFSET; +Int VGOFF_(tls_ptr) = INVALID_OFFSET; Int VGOFF_(m_cs) = INVALID_OFFSET; Int VGOFF_(m_ss) = INVALID_OFFSET; Int VGOFF_(m_ds) = INVALID_OFFSET; @@ -2374,7 +2374,7 @@ static void init_baseBlock ( Addr client_eip, Addr esp_at_startup ) VGOFF_(ldt) = alloc_BaB_1_set((UInt)NULL); /* TLS pointer: pretend the root thread has no TLS array for now. */ - VGOFF_(tls) = alloc_BaB_1_set((UInt)NULL); + VGOFF_(tls_ptr) = alloc_BaB_1_set((UInt)NULL); /* segment registers */ VGOFF_(m_cs) = alloc_BaB_1_set(0); diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index 94adac15d2..fbe80dd0dc 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -296,7 +296,7 @@ static void load_thread_state ( ThreadId tid ) vg_assert(vg_tid_currently_in_baseBlock == VG_INVALID_THREADID); VG_(baseBlock)[VGOFF_(ldt)] = (UInt)VG_(threads)[tid].ldt; - VG_(baseBlock)[VGOFF_(tls)] = (UInt)VG_(threads)[tid].tls; + VG_(baseBlock)[VGOFF_(tls_ptr)] = (UInt)VG_(threads)[tid].tls; VG_(baseBlock)[VGOFF_(m_cs)] = VG_(threads)[tid].m_cs; VG_(baseBlock)[VGOFF_(m_ss)] = VG_(threads)[tid].m_ss; VG_(baseBlock)[VGOFF_(m_ds)] = VG_(threads)[tid].m_ds; @@ -383,13 +383,13 @@ static void save_thread_state ( ThreadId tid ) syscall, in which case we will correctly be updating VG_(threads)[tid].tls. This printf happens iff the following assertion fails. */ - if ((void*)VG_(threads)[tid].tls != (void*)VG_(baseBlock)[VGOFF_(tls)]) - VG_(printf)("VG_(threads)[%d].tls=%p VG_(baseBlock)[VGOFF_(tls)]=%p\n", + if ((void*)VG_(threads)[tid].tls != (void*)VG_(baseBlock)[VGOFF_(tls_ptr)]) + VG_(printf)("VG_(threads)[%d].tls=%p VG_(baseBlock)[VGOFF_(tls_ptr)]=%p\n", tid, (void*)VG_(threads)[tid].tls, - (void*)VG_(baseBlock)[VGOFF_(tls)]); + (void*)VG_(baseBlock)[VGOFF_(tls_ptr)]); vg_assert((void*)VG_(threads)[tid].tls - == (void*)VG_(baseBlock)[VGOFF_(tls)]); + == (void*)VG_(baseBlock)[VGOFF_(tls_ptr)]); VG_(threads)[tid].m_cs = VG_(baseBlock)[VGOFF_(m_cs)]; VG_(threads)[tid].m_ss = VG_(baseBlock)[VGOFF_(m_ss)]; @@ -440,7 +440,7 @@ static void save_thread_state ( ThreadId tid ) /* Fill it up with junk. */ VG_(baseBlock)[VGOFF_(ldt)] = junk; - VG_(baseBlock)[VGOFF_(tls)] = junk; + VG_(baseBlock)[VGOFF_(tls_ptr)] = junk; VG_(baseBlock)[VGOFF_(m_cs)] = junk; VG_(baseBlock)[VGOFF_(m_ss)] = junk; VG_(baseBlock)[VGOFF_(m_ds)] = junk; @@ -586,7 +586,7 @@ void VG_(scheduler_init) ( void ) /* Copy VG_(baseBlock) state to tid_main's slot. */ vg_tid_currently_in_baseBlock = tid_main; vg_tid_last_in_baseBlock = tid_main; - VG_(baseBlock)[VGOFF_(tls)] = (UInt)VG_(threads)[tid_main].tls; + VG_(baseBlock)[VGOFF_(tls_ptr)] = (UInt)VG_(threads)[tid_main].tls; save_thread_state ( tid_main ); VG_(threads)[tid_main].stack_highest_word @@ -1922,7 +1922,7 @@ void do__apply_in_new_thread ( ThreadId parent_tid, /* Initialise the thread's TLS array */ VG_(clear_TLS_for_thread)( VG_(threads)[tid].tls ); - VG_(baseBlock)[VGOFF_(tls)] = (UInt)VG_(threads)[tid].tls; + VG_(baseBlock)[VGOFF_(tls_ptr)] = (UInt)VG_(threads)[tid].tls; save_thread_state(tid); vg_tid_last_in_baseBlock = tid;