mirror of
git://git.musl-libc.org/musl
synced 2025-03-05 11:17:27 +00:00
deduplicate TP_ADJ logic out of each arch, replace with TP_OFFSET
the only part of TP_ADJ that was not uniquely determined by TLS_ABOVE_TP was the 0x7000 adjustment used mainly on mips and powerpc variants.
This commit is contained in:
parent
19f8642494
commit
ea71a9004e
@ -7,6 +7,5 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 16
|
#define GAP_ABOVE_TP 16
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
|
|
||||||
|
|
||||||
#define MC_PC pc
|
#define MC_PC pc
|
||||||
|
@ -28,6 +28,5 @@ static inline pthread_t __pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 8
|
#define GAP_ABOVE_TP 8
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
|
|
||||||
|
|
||||||
#define MC_PC arm_pc
|
#define MC_PC arm_pc
|
||||||
|
@ -5,6 +5,4 @@ static inline struct pthread *__pthread_self()
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TP_ADJ(p) (p)
|
|
||||||
|
|
||||||
#define MC_PC gregs[REG_EIP]
|
#define MC_PC gregs[REG_EIP]
|
||||||
|
@ -6,8 +6,8 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 0
|
#define GAP_ABOVE_TP 0
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
|
|
||||||
|
|
||||||
|
#define TP_OFFSET 0x7000
|
||||||
#define DTP_OFFSET 0x8000
|
#define DTP_OFFSET 0x8000
|
||||||
|
|
||||||
#define MC_PC gregs[R_PC]
|
#define MC_PC gregs[R_PC]
|
||||||
|
@ -5,6 +5,4 @@ static inline struct pthread *__pthread_self()
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TP_ADJ(p) (p)
|
|
||||||
|
|
||||||
#define MC_PC regs.pc
|
#define MC_PC regs.pc
|
||||||
|
@ -12,8 +12,8 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 0
|
#define GAP_ABOVE_TP 0
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
|
|
||||||
|
|
||||||
|
#define TP_OFFSET 0x7000
|
||||||
#define DTP_OFFSET 0x8000
|
#define DTP_OFFSET 0x8000
|
||||||
|
|
||||||
#define MC_PC pc
|
#define MC_PC pc
|
||||||
|
@ -12,8 +12,8 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 0
|
#define GAP_ABOVE_TP 0
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
|
|
||||||
|
|
||||||
|
#define TP_OFFSET 0x7000
|
||||||
#define DTP_OFFSET 0x8000
|
#define DTP_OFFSET 0x8000
|
||||||
|
|
||||||
#define MC_PC pc
|
#define MC_PC pc
|
||||||
|
@ -12,8 +12,8 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 0
|
#define GAP_ABOVE_TP 0
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
|
|
||||||
|
|
||||||
|
#define TP_OFFSET 0x7000
|
||||||
#define DTP_OFFSET 0x8000
|
#define DTP_OFFSET 0x8000
|
||||||
|
|
||||||
#define MC_PC pc
|
#define MC_PC pc
|
||||||
|
@ -13,6 +13,5 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 0
|
#define GAP_ABOVE_TP 0
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
|
|
||||||
|
|
||||||
#define MC_PC regs.pc
|
#define MC_PC regs.pc
|
||||||
|
@ -7,8 +7,8 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 0
|
#define GAP_ABOVE_TP 0
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
|
|
||||||
|
|
||||||
|
#define TP_OFFSET 0x7000
|
||||||
#define DTP_OFFSET 0x8000
|
#define DTP_OFFSET 0x8000
|
||||||
|
|
||||||
// the kernel calls the ip "nip", it's the first saved value after the 32
|
// the kernel calls the ip "nip", it's the first saved value after the 32
|
||||||
|
@ -7,8 +7,8 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 0
|
#define GAP_ABOVE_TP 0
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
|
|
||||||
|
|
||||||
|
#define TP_OFFSET 0x7000
|
||||||
#define DTP_OFFSET 0x8000
|
#define DTP_OFFSET 0x8000
|
||||||
|
|
||||||
// the kernel calls the ip "nip", it's the first saved value after the 32
|
// the kernel calls the ip "nip", it's the first saved value after the 32
|
||||||
|
@ -7,7 +7,6 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 0
|
#define GAP_ABOVE_TP 0
|
||||||
#define TP_ADJ(p) ((char *)p + sizeof(struct pthread))
|
|
||||||
|
|
||||||
#define DTP_OFFSET 0x800
|
#define DTP_OFFSET 0x800
|
||||||
|
|
||||||
|
@ -9,6 +9,4 @@ static inline struct pthread *__pthread_self()
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TP_ADJ(p) (p)
|
|
||||||
|
|
||||||
#define MC_PC psw.addr
|
#define MC_PC psw.addr
|
||||||
|
@ -7,7 +7,6 @@ static inline struct pthread *__pthread_self()
|
|||||||
|
|
||||||
#define TLS_ABOVE_TP
|
#define TLS_ABOVE_TP
|
||||||
#define GAP_ABOVE_TP 8
|
#define GAP_ABOVE_TP 8
|
||||||
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
|
|
||||||
|
|
||||||
#define MC_PC sc_pc
|
#define MC_PC sc_pc
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ static inline struct pthread *__pthread_self()
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TP_ADJ(p) (p)
|
|
||||||
|
|
||||||
#define MC_PC gregs[REG_RIP]
|
#define MC_PC gregs[REG_RIP]
|
||||||
|
|
||||||
#define CANARY canary2
|
#define CANARY canary2
|
||||||
|
@ -5,6 +5,4 @@ static inline struct pthread *__pthread_self()
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TP_ADJ(p) (p)
|
|
||||||
|
|
||||||
#define MC_PC gregs[REG_RIP]
|
#define MC_PC gregs[REG_RIP]
|
||||||
|
@ -105,10 +105,20 @@ struct __timer {
|
|||||||
#define CANARY canary
|
#define CANARY canary
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TP_OFFSET
|
||||||
|
#define TP_OFFSET 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef DTP_OFFSET
|
#ifndef DTP_OFFSET
|
||||||
#define DTP_OFFSET 0
|
#define DTP_OFFSET 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TLS_ABOVE_TP
|
||||||
|
#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + TP_OFFSET)
|
||||||
|
#else
|
||||||
|
#define TP_ADJ(p) (p)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef tls_mod_off_t
|
#ifndef tls_mod_off_t
|
||||||
#define tls_mod_off_t size_t
|
#define tls_mod_off_t size_t
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user