Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _SYSDEP_TLS_H
0003 #define _SYSDEP_TLS_H
0004 
0005 #ifdef __UM_HOST__
0006 
0007 /* Change name to avoid conflicts with the original one from <asm/ldt.h>, which
0008  * may be named user_desc (but in 2.4 and in header matching its API was named
0009  * modify_ldt_ldt_s). */
0010 
0011 typedef struct um_dup_user_desc {
0012     unsigned int  entry_number;
0013     unsigned int  base_addr;
0014     unsigned int  limit;
0015     unsigned int  seg_32bit:1;
0016     unsigned int  contents:2;
0017     unsigned int  read_exec_only:1;
0018     unsigned int  limit_in_pages:1;
0019     unsigned int  seg_not_present:1;
0020     unsigned int  useable:1;
0021 #ifdef __x86_64__
0022     unsigned int  lm:1;
0023 #endif
0024 } user_desc_t;
0025 
0026 #else /* __UM_HOST__ */
0027 
0028 typedef struct user_desc user_desc_t;
0029 
0030 #endif /* __UM_HOST__ */
0031 
0032 extern int os_set_thread_area(user_desc_t *info, int pid);
0033 extern int os_get_thread_area(user_desc_t *info, int pid);
0034 
0035 #ifdef __i386__
0036 #define GDT_ENTRY_TLS_MIN_I386 6
0037 #define GDT_ENTRY_TLS_MIN_X86_64 12
0038 #endif
0039 
0040 #endif /* _SYSDEP_TLS_H */