unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: mengqinggang <mengqinggang@loongson.cn>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org
Cc: xuchenghua@loongson.cn, caiyinyu@loongson.cn,
	chenglulu@loongson.cn, cailulu@loongson.cn, xry111@xry111.site,
	i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn,
	wanglei@loongson.cn, hejinyang@loongson.cn
Subject: Re: [PATCH v4] LoongArch: Add support for TLS Descriptors
Date: Fri, 26 Apr 2024 15:20:37 +0800	[thread overview]
Message-ID: <5605cad1-2c5f-dca7-a43b-2f0ce4db5167@loongson.cn> (raw)
In-Reply-To: <8f57e7d3-3549-494e-b13f-421e71e0c572@linaro.org>


在 2024/4/5 上午2:46, Adhemerval Zanella Netto 写道:
> diff --git a/sysdeps/loongarch/tlsdesc.sym b/sysdeps/loongarch/tlsdesc.sym
> new file mode 100644
> index 0000000000..a0b945e449
> --- /dev/null
> +++ b/sysdeps/loongarch/tlsdesc.sym
> @@ -0,0 +1,28 @@
> +#include <stddef.h>
> +#include <sysdep.h>
> +#include <tls.h>
> +#include <link.h>
> +#include <dl-tlsdesc.h>
> +
> +#define SHARED 1
> +
> +#include <ldsodefs.h>
> +
> +#define GLRO_offsetof(name) offsetof (struct rtld_global_ro, _##name)
> +
> +--
> +
> +-- Abuse tls.h macros to derive offsets relative to the thread register.
> +
> +TLSDESC_ARG		offsetof(struct tlsdesc, arg)
> +TLSDESC_GEN_COUNT	offsetof(struct tlsdesc_dynamic_arg, gen_count)
> +TLSDESC_MODID		offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
> +TLSDESC_MODOFF		offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
> +TCBHEAD_DTV		offsetof(tcbhead_t, dtv)
> +DTV_COUNTER		offsetof(dtv_t, counter)
> +TLS_DTV_UNALLOCATED	TLS_DTV_UNALLOCATED
> +TLS_DTV_OFFSET		TLS_DTV_OFFSET
> +SIZE_OF_DTV		sizeof(tcbhead_t)
> +GLRO_DL_HWCAP_OFFSET    GLRO_offsetof (dl_hwcap)
> +HWCAP_LOONGARCH_LSX	HWCAP_LOONGARCH_LSX
> +HWCAP_LOONGARCH_LASX	HWCAP_LOONGARCH_LASX
> Ok, although I would expect you can include hwcap.h on assembly files.
>
Include hwcap.h gets an error:
     error: #error "Never include <bits/hwcap.h> directly; use 
<sys/auxv.h> instead.
But auxv.h  has c code.


      reply	other threads:[~2024-04-26  7:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-31  7:36 [PATCH v4] LoongArch: Add support for TLS Descriptors mengqinggang
2024-04-04 18:46 ` Adhemerval Zanella Netto
2024-04-26  7:20   ` mengqinggang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5605cad1-2c5f-dca7-a43b-2f0ce4db5167@loongson.cn \
    --to=mengqinggang@loongson.cn \
    --cc=adhemerval.zanella@linaro.org \
    --cc=cailulu@loongson.cn \
    --cc=caiyinyu@loongson.cn \
    --cc=chenglulu@loongson.cn \
    --cc=hejinyang@loongson.cn \
    --cc=i.swmail@xen0n.name \
    --cc=libc-alpha@sourceware.org \
    --cc=luweining@loongson.cn \
    --cc=maskray@google.com \
    --cc=wanglei@loongson.cn \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).