⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 internals.h

📁 Axis 221 camera embedded programing interface
💻 H
📖 第 1 页 / 共 2 页
字号:
extern char *__pthread_initial_thread_bos;#ifndef __ARCH_HAS_MMU__extern char *__pthread_initial_thread_tos;#define NOMMU_INITIAL_THREAD_BOUNDS(tos,bos) if ((tos)>=__pthread_initial_thread_bos && (bos)<=__pthread_initial_thread_tos) __pthread_initial_thread_bos = (tos)+1#else#define NOMMU_INITIAL_THREAD_BOUNDS(tos,bos) /* empty */#endif /* __ARCH_HAS_MMU__ *//* Indicate whether at least one thread has a user-defined stack (if 1),   or all threads have stacks supplied by LinuxThreads (if 0). */extern int __pthread_nonstandard_stacks;/* File descriptor for sending requests to the thread manager.   Initially -1, meaning that __pthread_initialize_manager must be called. */extern int __pthread_manager_request;/* Other end of the pipe for sending requests to the thread manager. */extern int __pthread_manager_reader;/* Limits of the thread manager stack. */extern char *__pthread_manager_thread_bos;extern char *__pthread_manager_thread_tos;/* Pending request for a process-wide exit */extern int __pthread_exit_requested, __pthread_exit_code;/* Set to 1 by gdb if we're debugging */extern volatile int __pthread_threads_debug;/* Globally enabled events.  */extern volatile td_thr_events_t __pthread_threads_events;/* Pointer to descriptor of thread with last event.  */extern volatile pthread_descr __pthread_last_event;/* Return the handle corresponding to a thread id */static inline pthread_handle thread_handle(pthread_t id){  return &__pthread_handles[id % PTHREAD_THREADS_MAX];}/* Validate a thread handle. Must have acquired h->h_spinlock before. */static inline int invalid_handle(pthread_handle h, pthread_t id){  return h->h_descr == NULL || h->h_descr->p_tid != id;}/* Fill in defaults left unspecified by pt-machine.h.  *//* The page size we can get from the system.  This should likely not be   changed by the machine file but, you never know.  */extern size_t __pagesize;#include <bits/uClibc_page.h>#ifndef PAGE_SIZE#define PAGE_SIZE  (sysconf (_SC_PAGESIZE))#endif/* The max size of the thread stack segments.  If the default   THREAD_SELF implementation is used, this must be a power of two and   a multiple of PAGE_SIZE.  */#ifndef STACK_SIZE#ifdef __ARCH_HAS_MMU__#define STACK_SIZE  (2 * 1024 * 1024)#else#define STACK_SIZE  (4 * __pagesize)#endif#endif/* The initial size of the thread stack.  Must be a multiple of PAGE_SIZE.  */#ifndef INITIAL_STACK_SIZE#define INITIAL_STACK_SIZE  (4 * __pagesize)#endif/* Size of the thread manager stack. The "- 32" avoids wasting space   with some malloc() implementations. */#ifndef THREAD_MANAGER_STACK_SIZE#define THREAD_MANAGER_STACK_SIZE  (2 * __pagesize - 32)#endif/* The base of the "array" of thread stacks.  The array will grow down from   here.  Defaults to the calculated bottom of the initial application   stack.  */#ifndef THREAD_STACK_START_ADDRESS#define THREAD_STACK_START_ADDRESS  __pthread_initial_thread_bos#endif/* Get some notion of the current stack.  Need not be exactly the top   of the stack, just something somewhere in the current frame.  */#ifndef CURRENT_STACK_FRAME#define CURRENT_STACK_FRAME  ({ char __csf; &__csf; })#endif/* If MEMORY_BARRIER isn't defined in pt-machine.h, assume the   architecture doesn't need a memory barrier instruction (e.g. Intel   x86).  Still we need the compiler to respect the barrier and emit   all outstanding operations which modify memory.  Some architectures   distinguish between full, read and write barriers.  */#ifndef MEMORY_BARRIER#define MEMORY_BARRIER() asm ("" : : : "memory")#endif#ifndef READ_MEMORY_BARRIER#define READ_MEMORY_BARRIER() MEMORY_BARRIER()#endif#ifndef WRITE_MEMORY_BARRIER#define WRITE_MEMORY_BARRIER() MEMORY_BARRIER()#endif/* Recover thread descriptor for the current thread */extern pthread_descr __pthread_find_self (void) __attribute__ ((const));static inline pthread_descr thread_self (void) __attribute__ ((const));static inline pthread_descr thread_self (void){#ifdef THREAD_SELF  return THREAD_SELF;#else  char *sp = CURRENT_STACK_FRAME;#ifdef __ARCH_HAS_MMU__  if (sp >= __pthread_initial_thread_bos)    return &__pthread_initial_thread;  else if (sp >= __pthread_manager_thread_bos	   && sp < __pthread_manager_thread_tos)    return &__pthread_manager_thread;  else if (__pthread_nonstandard_stacks)    return __pthread_find_self();  else    return (pthread_descr)(((unsigned long)sp | (STACK_SIZE-1))+1) - 1;#else  /* For non-MMU we need to be more careful about the initial thread stack.   * We refine the initial thread stack bounds dynamically as we allocate   * the other stack frame such that it doesn't overlap with them. Then   * we can be sure to pick the right thread according to the current SP */  /* Since we allow other stack frames to be above or below, we need to   * treat this case special. When pthread_initialize() wasn't called yet,   * only the initial thread is there. */  if (__pthread_initial_thread_bos == NULL) {      return &__pthread_initial_thread;  }  else if (sp >= __pthread_initial_thread_bos	   && sp < __pthread_initial_thread_tos) {      return &__pthread_initial_thread;  }  else if (sp >= __pthread_manager_thread_bos	   && sp < __pthread_manager_thread_tos) {      return &__pthread_manager_thread;  }  else {      return __pthread_find_self();  }#endif /* __ARCH_HAS_MMU__ */#endif}/* Max number of times we must spin on a spinlock calling sched_yield().   After MAX_SPIN_COUNT iterations, we put the calling thread to sleep. */#ifndef MAX_SPIN_COUNT#define MAX_SPIN_COUNT 50#endif/* Duration of sleep (in nanoseconds) when we can't acquire a spinlock   after MAX_SPIN_COUNT iterations of sched_yield().   With the 2.0 and 2.1 kernels, this MUST BE > 2ms.   (Otherwise the kernel does busy-waiting for realtime threads,    giving other threads no chance to run.) */#ifndef SPIN_SLEEP_DURATION#define SPIN_SLEEP_DURATION 2000001#endif/* Debugging */#ifdef DEBUG#include <assert.h>#define ASSERT assert#define MSG __pthread_message#else#define ASSERT(x)#define MSG(msg,arg...)#endif/* Internal global functions */void __pthread_destroy_specifics(void);void __pthread_perform_cleanup(void);int __pthread_initialize_manager(void);void __pthread_message(char * fmt, ...);int __pthread_manager(void *reqfd);int __pthread_manager_event(void *reqfd);void __pthread_manager_sighandler(int sig);void __pthread_reset_main_thread(void);void __fresetlockfiles(void);void __pthread_manager_adjust_prio(int thread_prio);void __pthread_initialize_minimal (void);extern int __pthread_attr_setguardsize __P ((pthread_attr_t *__attr,					     size_t __guardsize));extern int __pthread_attr_getguardsize __P ((__const pthread_attr_t *__attr,					     size_t *__guardsize));extern int __pthread_attr_setstackaddr __P ((pthread_attr_t *__attr,					     void *__stackaddr));extern int __pthread_attr_getstackaddr __P ((__const pthread_attr_t *__attr,					     void **__stackaddr));extern int __pthread_attr_setstacksize __P ((pthread_attr_t *__attr,					     size_t __stacksize));extern int __pthread_attr_getstacksize __P ((__const pthread_attr_t *__attr,					     size_t *__stacksize));extern int __pthread_getconcurrency __P ((void));extern int __pthread_setconcurrency __P ((int __level));extern int __pthread_mutexattr_gettype __P ((__const pthread_mutexattr_t *__attr,					     int *__kind));extern void __pthread_kill_other_threads_np __P ((void));extern void __pthread_restart_old(pthread_descr th);extern void __pthread_suspend_old(pthread_descr self);extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abs);extern void __pthread_restart_new(pthread_descr th);extern void __pthread_suspend_new(pthread_descr self);extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abs);extern void __pthread_wait_for_restart_signal(pthread_descr self);/* Global pointers to old or new suspend functions */extern void (*__pthread_restart)(pthread_descr);extern void (*__pthread_suspend)(pthread_descr);/* Prototypes for the function without cancelation support when the   normal version has it.  */extern int __libc_close (int fd);extern int __libc_nanosleep (const struct timespec *requested_time,			     struct timespec *remaining);extern ssize_t __libc_read (int fd, void *buf, size_t count);extern pid_t __libc_waitpid (pid_t pid, int *stat_loc, int options);extern ssize_t __libc_write (int fd, const void *buf, size_t count);/* Prototypes for some of the new semaphore functions.  */extern int __new_sem_post (sem_t * sem);/* The functions called the signal events.  */extern void __linuxthreads_create_event (void);extern void __linuxthreads_death_event (void);extern void __linuxthreads_reap_event (void);#endif /* internals.h */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -