xref: /openbmc/linux/arch/x86/um/shared/sysdep/tls.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
209e129a6SAl Viro #ifndef _SYSDEP_TLS_H
309e129a6SAl Viro #define _SYSDEP_TLS_H
409e129a6SAl Viro 
5298e20baSRichard Weinberger #ifdef __UM_HOST__
609e129a6SAl Viro 
709e129a6SAl Viro /* Change name to avoid conflicts with the original one from <asm/ldt.h>, which
809e129a6SAl Viro  * may be named user_desc (but in 2.4 and in header matching its API was named
909e129a6SAl Viro  * modify_ldt_ldt_s). */
1009e129a6SAl Viro 
1109e129a6SAl Viro typedef struct um_dup_user_desc {
1209e129a6SAl Viro 	unsigned int  entry_number;
1309e129a6SAl Viro 	unsigned int  base_addr;
1409e129a6SAl Viro 	unsigned int  limit;
1509e129a6SAl Viro 	unsigned int  seg_32bit:1;
1609e129a6SAl Viro 	unsigned int  contents:2;
1709e129a6SAl Viro 	unsigned int  read_exec_only:1;
1809e129a6SAl Viro 	unsigned int  limit_in_pages:1;
1909e129a6SAl Viro 	unsigned int  seg_not_present:1;
2009e129a6SAl Viro 	unsigned int  useable:1;
2109e129a6SAl Viro #ifdef __x86_64__
2209e129a6SAl Viro 	unsigned int  lm:1;
235c48b108SAl Viro #endif
2409e129a6SAl Viro } user_desc_t;
2509e129a6SAl Viro 
26298e20baSRichard Weinberger #else /* __UM_HOST__ */
2709e129a6SAl Viro 
2809e129a6SAl Viro typedef struct user_desc user_desc_t;
2909e129a6SAl Viro 
30298e20baSRichard Weinberger #endif /* __UM_HOST__ */
3109e129a6SAl Viro 
321bbd5f21SAl Viro extern int os_set_thread_area(user_desc_t *info, int pid);
331bbd5f21SAl Viro extern int os_get_thread_area(user_desc_t *info, int pid);
341bbd5f21SAl Viro 
3509e129a6SAl Viro #ifdef __i386__
3609e129a6SAl Viro #define GDT_ENTRY_TLS_MIN_I386 6
3709e129a6SAl Viro #define GDT_ENTRY_TLS_MIN_X86_64 12
3809e129a6SAl Viro #endif
3909e129a6SAl Viro 
4009e129a6SAl Viro #endif /* _SYSDEP_TLS_H */
41