Changeset View
Standalone View
sys/arm/include/_types.h
Show All 34 Lines | |||||
* | * | ||||
* From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 | * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 | ||||
* From: @(#)types.h 8.3 (Berkeley) 1/5/94 | * From: @(#)types.h 8.3 (Berkeley) 1/5/94 | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _MACHINE__TYPES_H_ | #ifndef _MACHINE__TYPES_H_ | ||||
#define _MACHINE__TYPES_H_ | #define _MACHINE__TYPES_H_ | ||||
#ifndef _SYS_CDEFS_H_ | #ifndef _SYS__TYPES_H_ | ||||
kib: This check is redundand now | |||||
#error this file needs sys/cdefs.h as a prerequisite | #error do not include this header, use sys/_types.h | ||||
#endif | #endif | ||||
/* | /* | ||||
* Basic types upon which most other types are built. | |||||
*/ | |||||
typedef signed char __int8_t; | |||||
typedef unsigned char __uint8_t; | |||||
typedef short __int16_t; | |||||
typedef unsigned short __uint16_t; | |||||
typedef int __int32_t; | |||||
typedef unsigned int __uint32_t; | |||||
#ifndef lint | |||||
Not Done Inline ActionsJust noting that these ifdefs are dropped. Is lint something historical? mhorne: Just noting that these ifdefs are dropped. Is `lint` something historical? | |||||
Not Done Inline ActionsI believe that was support for xlint which was removed in 2017. brooks: I believe that was support for xlint which was removed in 2017. | |||||
Not Done Inline ActionsIt was linters in general, the last of which was xlint which we deorbited in 2017 after a decade plus of neglect. imp: It was linters in general, the last of which was xlint which we deorbited in 2017 after a… | |||||
__extension__ | |||||
#endif | |||||
/* LONGLONG */ | |||||
typedef long long __int64_t; | |||||
#ifndef lint | |||||
__extension__ | |||||
#endif | |||||
/* LONGLONG */ | |||||
typedef unsigned long long __uint64_t; | |||||
/* | |||||
* Standard type definitions. | * Standard type definitions. | ||||
*/ | */ | ||||
typedef __uint32_t __clock_t; /* clock()... */ | typedef __uint32_t __clock_t; /* clock()... */ | ||||
typedef __int32_t __critical_t; | typedef __int32_t __critical_t; | ||||
#ifndef _STANDALONE | #ifndef _STANDALONE | ||||
typedef double __double_t; | typedef double __double_t; | ||||
typedef float __float_t; | typedef float __float_t; | ||||
#endif | #endif | ||||
typedef __int32_t __intfptr_t; | |||||
typedef __int64_t __intmax_t; | |||||
typedef __int32_t __intptr_t; | |||||
typedef __int32_t __int_fast8_t; | typedef __int32_t __int_fast8_t; | ||||
typedef __int32_t __int_fast16_t; | typedef __int32_t __int_fast16_t; | ||||
typedef __int32_t __int_fast32_t; | typedef __int32_t __int_fast32_t; | ||||
typedef __int64_t __int_fast64_t; | typedef __int64_t __int_fast64_t; | ||||
typedef __int8_t __int_least8_t; | |||||
typedef __int16_t __int_least16_t; | |||||
typedef __int32_t __int_least32_t; | |||||
typedef __int64_t __int_least64_t; | |||||
typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ | |||||
typedef __int32_t __register_t; | typedef __int32_t __register_t; | ||||
typedef __int32_t __segsz_t; /* segment size (in pages) */ | typedef __int32_t __segsz_t; /* segment size (in pages) */ | ||||
typedef __uint32_t __size_t; /* sizeof() */ | |||||
typedef __int32_t __ssize_t; /* byte count or error */ | |||||
typedef __int64_t __time_t; /* time()... */ | typedef __int64_t __time_t; /* time()... */ | ||||
typedef __uint32_t __uintfptr_t; | |||||
typedef __uint64_t __uintmax_t; | |||||
typedef __uint32_t __uintptr_t; | |||||
typedef __uint32_t __uint_fast8_t; | typedef __uint32_t __uint_fast8_t; | ||||
typedef __uint32_t __uint_fast16_t; | typedef __uint32_t __uint_fast16_t; | ||||
typedef __uint32_t __uint_fast32_t; | typedef __uint32_t __uint_fast32_t; | ||||
typedef __uint64_t __uint_fast64_t; | typedef __uint64_t __uint_fast64_t; | ||||
typedef __uint8_t __uint_least8_t; | |||||
typedef __uint16_t __uint_least16_t; | |||||
typedef __uint32_t __uint_least32_t; | |||||
typedef __uint64_t __uint_least64_t; | |||||
typedef __uint32_t __u_register_t; | typedef __uint32_t __u_register_t; | ||||
typedef __uint32_t __vm_offset_t; | |||||
typedef __uint32_t __vm_paddr_t; | typedef __uint32_t __vm_paddr_t; | ||||
Not Done Inline Actionsvm_offset_t/vm_size_t can be made MI I think with uintptr_t/ptrdiff_t (but I did not checked far enough) kib: vm_offset_t/vm_size_t can be made MI I think with uintptr_t/ptrdiff_t (but I did not checked… | |||||
Not Done Inline Actionsuintptr_t is not the right type for vm_offset_t; it's an integer address-sized offset, not a whole pointer. jrtc27: uintptr_t is not the right type for vm_offset_t; it's an integer address-sized offset, not a… | |||||
Not Done Inline ActionsI do not understand your comment. Your description of 'address-sized offset' perfectly fits both uintptr_t and vm_offset_t. kib: I do not understand your comment. Your description of 'address-sized offset' perfectly fits… | |||||
Not Done Inline ActionsTraditional architectures conflate integers and pointers, and the C code reflects that. CHERI does not make such mistakes, and thus vm_offset_t is _not_ a uintptr_t, as the latter carries around a full capability. jrtc27: Traditional architectures conflate integers and pointers, and the C code reflects that. CHERI… | |||||
Not Done Inline ActionsSpecifically, CHERI C adds a new intrinsic ptraddr_t type that represents the scalar integer type which holds addresses which is distinct from uintptr_t which holds pointers (with contain an address and metadata in CHERI C). In CheriBSD we have added a vm_ptr_t which holds user pointers as distinct from vm_offset_t which holds user addresses. We could in fact move vm_offset_t and vm_size_t to the MI header I believe. In CheriBSD we already provide a fallback for __ptraddr_t and we would simply define vm_offset_t always as ptraddr_t and vm_ptr_t always as uintptr_t. It wouldn't be a huge diff in CheriBSD to do that. In FreeBSD it would be ok to just use uintptr_t for vm_offset_t. jhb: Specifically, CHERI C adds a new intrinsic __ptraddr_t type that represents the scalar integer… | |||||
typedef __uint32_t __vm_size_t; | |||||
typedef unsigned int ___wchar_t; | typedef unsigned int ___wchar_t; | ||||
#define __WCHAR_MIN 0 /* min value for a wchar_t */ | #define __WCHAR_MIN 0 /* min value for a wchar_t */ | ||||
#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ | #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ | ||||
#endif /* !_MACHINE__TYPES_H_ */ | #endif /* !_MACHINE__TYPES_H_ */ |
This check is redundand now