xref: /OK3568_Linux_fs/kernel/include/uapi/linux/atmapi.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2*4882a593Smuzhiyun /* atmapi.h - ATM API user space/kernel compatibility */
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun /* Written 1999,2000 by Werner Almesberger, EPFL ICA */
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #ifndef _LINUX_ATMAPI_H
8*4882a593Smuzhiyun #define _LINUX_ATMAPI_H
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #if defined(__sparc__) || defined(__ia64__)
11*4882a593Smuzhiyun /* such alignment is not required on 32 bit sparcs, but we can't
12*4882a593Smuzhiyun    figure that we are on a sparc64 while compiling user-space programs. */
13*4882a593Smuzhiyun #define __ATM_API_ALIGN	__attribute__((aligned(8)))
14*4882a593Smuzhiyun #else
15*4882a593Smuzhiyun #define __ATM_API_ALIGN
16*4882a593Smuzhiyun #endif
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun /*
20*4882a593Smuzhiyun  * Opaque type for kernel pointers. Note that _ is never accessed. We need
21*4882a593Smuzhiyun  * the struct in order hide the array, so that we can make simple assignments
22*4882a593Smuzhiyun  * instead of being forced to use memcpy. It also improves error reporting for
23*4882a593Smuzhiyun  * code that still assumes that we're passing unsigned longs.
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  * Convention: NULL pointers are passed as a field of all zeroes.
26*4882a593Smuzhiyun  */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t;
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun #endif
31