libthr: Remove the DTV_OFFSET macro.
This macro is confusing as it is not related to the similarly named TLS_DTV_OFFSET. Instead, replace its one use with the desired expression which is the same on all platforms. Reviewed by: kib, emaste, jrtc27 Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33345
This commit is contained in:
parent
e735fa3212
commit
5d8176337e
@ -38,10 +38,8 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <machine/sysarch.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define CPU_SPINWAIT
|
||||
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
|
||||
|
||||
/*
|
||||
* Variant I tcb. The structure layout is fixed, don't blindly
|
||||
|
@ -41,8 +41,6 @@
|
||||
|
||||
#define CPU_SPINWAIT __asm __volatile("pause")
|
||||
|
||||
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
|
||||
|
||||
/*
|
||||
* Variant II tcb, first two members are required by rtld,
|
||||
* %fs points to the structure.
|
||||
|
@ -36,10 +36,8 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <machine/sysarch.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define CPU_SPINWAIT
|
||||
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
|
||||
|
||||
/*
|
||||
* Variant I tcb. The structure layout is fixed, don't blindly
|
||||
|
@ -41,8 +41,6 @@
|
||||
|
||||
#define CPU_SPINWAIT __asm __volatile("pause")
|
||||
|
||||
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
|
||||
|
||||
/*
|
||||
* Variant II tcb, first two members are required by rtld,
|
||||
* %gs points to the structure.
|
||||
|
@ -38,10 +38,8 @@
|
||||
#include <sys/types.h>
|
||||
#include <machine/sysarch.h>
|
||||
#include <machine/tls.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define CPU_SPINWAIT
|
||||
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
|
||||
|
||||
/*
|
||||
* Variant I tcb. The structure layout is fixed, don't blindly
|
||||
|
@ -35,12 +35,10 @@
|
||||
#ifndef _PTHREAD_MD_H_
|
||||
#define _PTHREAD_MD_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define CPU_SPINWAIT
|
||||
|
||||
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
|
||||
#ifdef __powerpc64__
|
||||
#define TP_OFFSET 0x7010
|
||||
#else
|
||||
|
@ -42,10 +42,8 @@
|
||||
#define _PTHREAD_MD_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define CPU_SPINWAIT
|
||||
#define DTV_OFFSET offsetof(struct tcb, tcb_dtv)
|
||||
#define TP_OFFSET sizeof(struct tcb)
|
||||
|
||||
/*
|
||||
|
@ -55,7 +55,7 @@ int _thread_size_key = sizeof(struct pthread_key);
|
||||
int _thread_off_key_allocated = offsetof(struct pthread_key, allocated);
|
||||
int _thread_off_key_destructor = offsetof(struct pthread_key, destructor);
|
||||
int _thread_max_keys = PTHREAD_KEYS_MAX;
|
||||
int _thread_off_dtv = DTV_OFFSET;
|
||||
int _thread_off_dtv = offsetof(struct tcb, tcb_dtv);
|
||||
int _thread_off_state = offsetof(struct pthread, state);
|
||||
int _thread_state_running = PS_RUNNING;
|
||||
int _thread_state_zoombie = PS_DEAD;
|
||||
|
Loading…
Reference in New Issue
Block a user