Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
posix_types.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_POSIX_SYS_TYPES_H_
8
#define ZEPHYR_INCLUDE_POSIX_SYS_TYPES_H_
9
10
#ifndef CONFIG_ARCH_POSIX
11
#include <
sys/types.h
>
12
#endif
13
14
#include <kernel.h>
15
16
#ifdef __cplusplus
17
extern
"C"
{
18
#endif
19
20
#ifndef __useconds_t_defined
21
typedef
unsigned
long
useconds_t
;
22
#endif
23
24
/* time related attributes */
25
#if !defined(CONFIG_NEWLIB_LIBC) && !defined(CONFIG_ARCMWDT_LIBC)
26
#ifndef __clockid_t_defined
27
typedef
uint32_t
clockid_t
;
28
#endif
29
#endif
/* !CONFIG_NEWLIB_LIBC && !CONFIG_ARCMWDT_LIBC */
30
#ifndef __timer_t_defined
31
typedef
unsigned
long
timer_t
;
32
#endif
33
34
#ifdef CONFIG_PTHREAD_IPC
35
/* Thread attributes */
36
typedef
struct
pthread_attr_t {
37
int
priority;
38
void
*
stack
;
39
size_t
stacksize;
40
uint32_t
flags
;
41
uint32_t
delayedstart;
42
uint32_t
schedpolicy;
43
int32_t
detachstate;
44
uint32_t
initialized;
45
} pthread_attr_t;
46
47
typedef
void
*pthread_t;
48
49
/* Semaphore */
50
typedef
struct
k_sem sem_t;
51
52
/* Mutex */
53
typedef
struct
pthread_mutex {
54
pthread_t owner;
55
uint16_t
lock_count;
56
int
type;
57
_wait_q_t wait_q;
58
} pthread_mutex_t;
59
60
typedef
struct
pthread_mutexattr {
61
int
type;
62
} pthread_mutexattr_t;
63
64
/* Condition variables */
65
typedef
struct
pthread_cond {
66
_wait_q_t wait_q;
67
} pthread_cond_t;
68
69
typedef
struct
pthread_condattr {
70
} pthread_condattr_t;
71
72
/* Barrier */
73
typedef
struct
pthread_barrier {
74
_wait_q_t wait_q;
75
int
max;
76
int
count
;
77
} pthread_barrier_t;
78
79
typedef
struct
pthread_barrierattr {
80
} pthread_barrierattr_t;
81
82
typedef
uint32_t
pthread_rwlockattr_t;
83
84
typedef
struct
pthread_rwlock_obj {
85
struct
k_sem rd_sem;
86
struct
k_sem wr_sem;
87
struct
k_sem reader_active;
/* blocks WR till reader has acquired lock */
88
int32_t
status;
89
k_tid_t
wr_owner;
90
} pthread_rwlock_t;
91
92
#endif
/* CONFIG_PTHREAD_IPC */
93
94
#ifdef __cplusplus
95
}
96
#endif
97
98
#endif
/* ZEPHYR_INCLUDE_POSIX_SYS_TYPES_H_ */
count
ZTEST_BMEM int count
Definition:
main.c:33
flags
flags
Definition:
http_parser.h:131
types.h
useconds_t
unsigned long useconds_t
Definition:
posix_types.h:21
timer_t
unsigned long timer_t
Definition:
posix_types.h:31
clockid_t
uint32_t clockid_t
Definition:
posix_types.h:27
stack
struct k_stack stack
Definition:
test_stack_contexts.c:18
uint32_t
__UINT32_TYPE__ uint32_t
Definition:
stdint.h:60
int32_t
__INT32_TYPE__ int32_t
Definition:
stdint.h:44
uint16_t
__UINT16_TYPE__ uint16_t
Definition:
stdint.h:59
k_thread
Definition:
thread.h:201
include
posix
posix_types.h
Generated on Sun Oct 9 2022 09:21:57 for Zephyr API Documentation by
1.9.4