public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI
@ 2022-11-23 14:41 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-11-23 14:41 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e5b22d23d1bacd467bf3bb3aaad2209b73606dc9
commit e5b22d23d1bacd467bf3bb3aaad2209b73606dc9
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Fri Jun 11 12:52:26 2021 +0100
cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI
The CHERI pure capability programming model for C requires special
definition of {u}intptr_t.
Only the pure capability model is supported for hosted compilation,
but for freestanding compilation there is limited support for other
(hybrid capability) programming models too, which require new
{u}intcap_t type definitions.
Diff:
---
posix/bits/types.h | 4 ++++
stdlib/stdint.h | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/posix/bits/types.h b/posix/bits/types.h
index f912e77a02..e315dfd779 100644
--- a/posix/bits/types.h
+++ b/posix/bits/types.h
@@ -204,7 +204,11 @@ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
typedef char *__caddr_t;
/* Duplicates info from stdint.h but this is used in unistd.h. */
+#ifdef __CHERI_PURE_CAPABILITY__
+__STD_TYPE __intcap_t __intptr_t;
+#else
__STD_TYPE __SWORD_TYPE __intptr_t;
+#endif
/* Duplicate info from sys/socket.h. */
__STD_TYPE __U32_TYPE __socklen_t;
diff --git a/stdlib/stdint.h b/stdlib/stdint.h
index 2d666f79fd..b80b6bbac1 100644
--- a/stdlib/stdint.h
+++ b/stdlib/stdint.h
@@ -84,10 +84,22 @@ typedef unsigned long long int uint_fast64_t;
/* Types for `void *' pointers. */
#if __WORDSIZE == 64
# ifndef __intptr_t_defined
+# ifdef __CHERI_PURE_CAPABILITY__
+typedef __intcap_t intptr_t;
+# else
typedef long int intptr_t;
+# endif
# define __intptr_t_defined
# endif
+# ifdef __CHERI_PURE_CAPABILITY__
+typedef __uintcap_t uintptr_t;
+# else
typedef unsigned long int uintptr_t;
+# endif
+# if defined __CHERI__ && !defined __CHERI_PURE_CAPABILITY__
+typedef __uintcap_t uintcap_t;
+typedef __intcap_t intcap_t;
+# endif
#else
# ifndef __intptr_t_defined
typedef int intptr_t;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI
@ 2022-10-27 13:51 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-27 13:51 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1564a64fbe61c21b6b54ed8eacf8c9f82a41e20b
commit 1564a64fbe61c21b6b54ed8eacf8c9f82a41e20b
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Fri Jun 11 12:52:26 2021 +0100
cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI
The CHERI pure capability programming model for C requires special
definition of {u}intptr_t.
Only the pure capability model is supported for hosted compilation,
but for freestanding compilation there is limited support for other
(hybrid capability) programming models too, which require new
{u}intcap_t type definitions.
Diff:
---
posix/bits/types.h | 4 ++++
stdlib/stdint.h | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/posix/bits/types.h b/posix/bits/types.h
index f912e77a02..e315dfd779 100644
--- a/posix/bits/types.h
+++ b/posix/bits/types.h
@@ -204,7 +204,11 @@ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
typedef char *__caddr_t;
/* Duplicates info from stdint.h but this is used in unistd.h. */
+#ifdef __CHERI_PURE_CAPABILITY__
+__STD_TYPE __intcap_t __intptr_t;
+#else
__STD_TYPE __SWORD_TYPE __intptr_t;
+#endif
/* Duplicate info from sys/socket.h. */
__STD_TYPE __U32_TYPE __socklen_t;
diff --git a/stdlib/stdint.h b/stdlib/stdint.h
index 2d666f79fd..b80b6bbac1 100644
--- a/stdlib/stdint.h
+++ b/stdlib/stdint.h
@@ -84,10 +84,22 @@ typedef unsigned long long int uint_fast64_t;
/* Types for `void *' pointers. */
#if __WORDSIZE == 64
# ifndef __intptr_t_defined
+# ifdef __CHERI_PURE_CAPABILITY__
+typedef __intcap_t intptr_t;
+# else
typedef long int intptr_t;
+# endif
# define __intptr_t_defined
# endif
+# ifdef __CHERI_PURE_CAPABILITY__
+typedef __uintcap_t uintptr_t;
+# else
typedef unsigned long int uintptr_t;
+# endif
+# if defined __CHERI__ && !defined __CHERI_PURE_CAPABILITY__
+typedef __uintcap_t uintcap_t;
+typedef __intcap_t intcap_t;
+# endif
#else
# ifndef __intptr_t_defined
typedef int intptr_t;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI
@ 2022-10-26 15:12 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:12 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=581cfdbbb8aa00ee95c3e6e8d7804ca6ee9edcc5
commit 581cfdbbb8aa00ee95c3e6e8d7804ca6ee9edcc5
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Fri Jun 11 12:52:26 2021 +0100
cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI
The CHERI pure capability programming model for C requires special
definition of {u}intptr_t.
Only the pure capability model is supported for hosted compilation,
but for freestanding compilation there is limited support for other
(hybrid capability) programming models too, which require new
{u}intcap_t type definitions.
Diff:
---
posix/bits/types.h | 4 ++++
stdlib/stdint.h | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/posix/bits/types.h b/posix/bits/types.h
index f912e77a02..e315dfd779 100644
--- a/posix/bits/types.h
+++ b/posix/bits/types.h
@@ -204,7 +204,11 @@ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
typedef char *__caddr_t;
/* Duplicates info from stdint.h but this is used in unistd.h. */
+#ifdef __CHERI_PURE_CAPABILITY__
+__STD_TYPE __intcap_t __intptr_t;
+#else
__STD_TYPE __SWORD_TYPE __intptr_t;
+#endif
/* Duplicate info from sys/socket.h. */
__STD_TYPE __U32_TYPE __socklen_t;
diff --git a/stdlib/stdint.h b/stdlib/stdint.h
index 2d666f79fd..b80b6bbac1 100644
--- a/stdlib/stdint.h
+++ b/stdlib/stdint.h
@@ -84,10 +84,22 @@ typedef unsigned long long int uint_fast64_t;
/* Types for `void *' pointers. */
#if __WORDSIZE == 64
# ifndef __intptr_t_defined
+# ifdef __CHERI_PURE_CAPABILITY__
+typedef __intcap_t intptr_t;
+# else
typedef long int intptr_t;
+# endif
# define __intptr_t_defined
# endif
+# ifdef __CHERI_PURE_CAPABILITY__
+typedef __uintcap_t uintptr_t;
+# else
typedef unsigned long int uintptr_t;
+# endif
+# if defined __CHERI__ && !defined __CHERI_PURE_CAPABILITY__
+typedef __uintcap_t uintcap_t;
+typedef __intcap_t intcap_t;
+# endif
#else
# ifndef __intptr_t_defined
typedef int intptr_t;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [glibc/arm/morello/main] cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI
@ 2022-08-05 19:30 Szabolcs Nagy
0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-08-05 19:30 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=93c554530045f8a27ee2b9645d7913115deee6f4
commit 93c554530045f8a27ee2b9645d7913115deee6f4
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Fri Jun 11 12:52:26 2021 +0100
cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI
The CHERI pure capability programming model for C requires special
definition of {u}intptr_t.
Only the pure capability model is supported for hosted compilation,
but for freestanding compilation there is limited support for other
(hybrid capability) programming models too, which require new
{u}intcap_t type definitions.
Diff:
---
posix/bits/types.h | 4 ++++
stdlib/stdint.h | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/posix/bits/types.h b/posix/bits/types.h
index f912e77a02..e315dfd779 100644
--- a/posix/bits/types.h
+++ b/posix/bits/types.h
@@ -204,7 +204,11 @@ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
typedef char *__caddr_t;
/* Duplicates info from stdint.h but this is used in unistd.h. */
+#ifdef __CHERI_PURE_CAPABILITY__
+__STD_TYPE __intcap_t __intptr_t;
+#else
__STD_TYPE __SWORD_TYPE __intptr_t;
+#endif
/* Duplicate info from sys/socket.h. */
__STD_TYPE __U32_TYPE __socklen_t;
diff --git a/stdlib/stdint.h b/stdlib/stdint.h
index 2d666f79fd..b80b6bbac1 100644
--- a/stdlib/stdint.h
+++ b/stdlib/stdint.h
@@ -84,10 +84,22 @@ typedef unsigned long long int uint_fast64_t;
/* Types for `void *' pointers. */
#if __WORDSIZE == 64
# ifndef __intptr_t_defined
+# ifdef __CHERI_PURE_CAPABILITY__
+typedef __intcap_t intptr_t;
+# else
typedef long int intptr_t;
+# endif
# define __intptr_t_defined
# endif
+# ifdef __CHERI_PURE_CAPABILITY__
+typedef __uintcap_t uintptr_t;
+# else
typedef unsigned long int uintptr_t;
+# endif
+# if defined __CHERI__ && !defined __CHERI_PURE_CAPABILITY__
+typedef __uintcap_t uintcap_t;
+typedef __intcap_t intcap_t;
+# endif
#else
# ifndef __intptr_t_defined
typedef int intptr_t;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-23 14:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 14:41 [glibc/arm/morello/main] cheri: headers: Define {u}intptr_t and {u}intcap_t for CHERI Szabolcs Nagy
-- strict thread matches above, loose matches on Subject: below --
2022-10-27 13:51 Szabolcs Nagy
2022-10-26 15:12 Szabolcs Nagy
2022-08-05 19:30 Szabolcs Nagy
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).