Define the static TLS as an array of long double. This will guarantee

that the TLS is 16-byte aligned, as well as guarantee that the thread
pointer is 16-byte aligned as it points to struct ia64_tp. Likewise,
struct tcb and struct ksd are also guaranteed to be 16-byte aligned
(if they weren't already).
This commit is contained in:
Marcel Moolenaar 2003-08-06 00:17:15 +00:00
parent 199d58cbfc
commit 119fb38770
2 changed files with 12 additions and 4 deletions

View File

@ -45,12 +45,16 @@ struct tcb;
struct tdv; /* We don't know what this is yet? */
/*
* tp points to one of these.
* tp points to one of these. We define the static TLS as an array
* of long double to enforce 16-byte alignment of the TLS memory,
* struct ia64_tp, struct tcb and also struct kcb. Both static and
* dynamic allocation of any of these structures will result in a
* valid, well-aligned thread pointer.
*/
struct ia64_tp {
struct tdv *tp_tdv; /* dynamic TLS */
struct tcb *tp_self;
char tp_tls[0]; /* static TLS */
long double tp_tls[0]; /* static TLS */
};
struct tcb {

View File

@ -45,12 +45,16 @@ struct tcb;
struct tdv; /* We don't know what this is yet? */
/*
* tp points to one of these.
* tp points to one of these. We define the static TLS as an array
* of long double to enforce 16-byte alignment of the TLS memory,
* struct ia64_tp, struct tcb and also struct kcb. Both static and
* dynamic allocation of any of these structures will result in a
* valid, well-aligned thread pointer.
*/
struct ia64_tp {
struct tdv *tp_tdv; /* dynamic TLS */
struct tcb *tp_self;
char tp_tls[0]; /* static TLS */
long double tp_tls[0]; /* static TLS */
};
struct tcb {