Skip to content

Commit

Permalink
posix_types.h: add __kernel_uintptr_t to UAPI posix_types.h
Browse files Browse the repository at this point in the history
This will allow us to replace uintptr_t with __kernel_uintptr_t in
exported headers. I think this is acceptable because we already have
__kernel_ptrdiff_t.

Define __kernel_uintptr_t in the same ways as __kernel_ptrdiff_t
but with 'unsigned' qualifier.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
masahir0y authored and intel-lab-lkp committed Apr 4, 2022
1 parent c03ce3e commit e8154d9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/h8300/include/uapi/asm/posix_types.h
Expand Up @@ -7,6 +7,7 @@
typedef unsigned long __kernel_size_t;
typedef long __kernel_ssize_t;
typedef long __kernel_ptrdiff_t;
typedef unsigned long __kernel_uintptr_t;

#include <asm-generic/posix_types.h>

Expand Down
2 changes: 2 additions & 0 deletions arch/s390/include/uapi/asm/posix_types.h
Expand Up @@ -34,6 +34,7 @@ typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
typedef int __kernel_ptrdiff_t;
typedef unsigned int __kernel_uintptr_t;

#else /* __s390x__ */

Expand All @@ -43,6 +44,7 @@ typedef int __kernel_ipc_pid_t;
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
typedef long __kernel_ptrdiff_t;
typedef unsigned long __kernel_uintptr_t;
typedef unsigned long __kernel_sigset_t; /* at least 32 bits */

#endif /* __s390x__ */
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/include/uapi/asm/posix_types.h
Expand Up @@ -35,6 +35,7 @@ struct __kernel_old_timeval {
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
typedef long int __kernel_ptrdiff_t;
typedef unsigned long __kernel_uintptr_t;
#define __kernel_size_t __kernel_size_t

typedef unsigned short __kernel_ipc_pid_t;
Expand Down
1 change: 1 addition & 0 deletions arch/xtensa/include/uapi/asm/posix_types.h
Expand Up @@ -26,6 +26,7 @@ typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
typedef long __kernel_ptrdiff_t;
typedef unsigned long __kernel_uintptr_t;
#define __kernel_size_t __kernel_size_t

typedef unsigned short __kernel_old_uid_t;
Expand Down
2 changes: 1 addition & 1 deletion include/linux/types.h
Expand Up @@ -34,7 +34,7 @@ typedef __kernel_gid32_t gid_t;
typedef __kernel_uid16_t uid16_t;
typedef __kernel_gid16_t gid16_t;

typedef unsigned long uintptr_t;
typedef __kernel_uintptr_t uintptr_t;

#ifdef CONFIG_HAVE_UID16
/* This is defined by include/asm-{arch}/posix_types.h */
Expand Down
2 changes: 2 additions & 0 deletions include/uapi/asm-generic/posix_types.h
Expand Up @@ -68,10 +68,12 @@ typedef unsigned int __kernel_old_dev_t;
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
typedef unsigned int __kernel_uintptr_t;
#else
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;
typedef __kernel_long_t __kernel_ptrdiff_t;
typedef __kernel_ulong_t __kernel_uintptr_t;
#endif
#endif

Expand Down
1 change: 1 addition & 0 deletions tools/arch/h8300/include/asm/bitsperlong.h
Expand Up @@ -10,6 +10,7 @@
typedef unsigned long __kernel_size_t;
typedef long __kernel_ssize_t;
typedef long __kernel_ptrdiff_t;
typedef unsigned long __kernel_uintptr_t;
#endif

#endif /* __ASM_H8300_BITS_PER_LONG */

0 comments on commit e8154d9

Please sign in to comment.