-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<POSIX> Build Success: posix_time.c, posix_semaphore.c, posix_utils.c…
…, posix_mqueue.c
- Loading branch information
1 parent
22d6870
commit 6299685
Showing
21 changed files
with
242 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Descrption : This script accumulates sources and builds | ||
# library | ||
# Primary Author : Pranjal Chanda [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
POSIX_PATH := $(GET_PATH) | ||
LIB_OBJS := | ||
|
||
LIB := libposix.a | ||
LIB_INCLUDE += $(POSIX_PATH)/include/ | ||
DEP_LIBS_ARG += -lposix | ||
|
||
include $(POSIX_PATH)/src/build.mk | ||
|
||
DIR := $(POSIX_PATH) | ||
include mk/lib.mk |
10 changes: 10 additions & 0 deletions
10
src/lib/posix/cc_posix_config.h → src/lib/posix/include/cc_posix_config.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : cc_posix_config.h | ||
* Description : POSIX user config | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#pragma once | ||
|
||
#ifndef posixconfigTICK_RATE_HZ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
#ifndef _CC_POSIX_INTERNAL_H_ | ||
#define _CC_POSIX_INTERNAL_H_ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : cc_posix_internal.h | ||
* Description : Internal typedefs | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <cc_posix_config.h> | ||
|
@@ -100,5 +109,3 @@ | |
StaticEventGroup_t xBarrierEventGroup; /**< Kernel event group that blocks to wait on threads entering barrier. */ | ||
} pthread_barrier_internal_t; | ||
#endif /* if posixconfigENABLE_PTHREAD_BARRIER_T == 1 */ | ||
|
||
#endif /* _CC_POSIX_INTERNAL_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : cc_posix_types.h | ||
* Description : POSIX typedefs | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#pragma once | ||
|
||
#ifndef _CC_POSIX_INTERNAL_TYPES_H_ | ||
#define _CC_POSIX_INTERNAL_TYPES_H_ | ||
|
||
#include <posix/cc_posix_internal.h> | ||
#include <cc_posix_internal.h> | ||
|
||
/* | ||
* sys/types.h defines a POSIX type when posixconfigENABLE_PTHREAD_<TYPE>_T | ||
|
@@ -61,5 +68,3 @@ | |
typedef size_t TickType_t; | ||
#endif | ||
#define posixconfigMAX_DELAY (TickType_t)(~0) | ||
|
||
#endif /* _CC_POSIX_INTERNAL_TYPES_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
/** | ||
* @file fcntl.h | ||
* @brief File control options. | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : fcntl.h | ||
* Description : File control options. | ||
* : http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html | ||
* | ||
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#ifndef _CC_POSIX_FCNTL_H_ | ||
#pragma once | ||
|
||
#define _CC_POSIX_FCNTL_H_ | ||
|
||
/** | ||
|
@@ -50,5 +56,3 @@ | |
#define O_SEARCH 0x4000 /**< Open directory for search only. */ | ||
#define O_WRONLY 0x8000 /**< Open for writing only. */ | ||
/**@} */ | ||
|
||
#endif /* ifndef _CC_POSIX_FCNTL_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,18 @@ | |
* File Name : mqueue.h | ||
* Description : This file consists of posix message queue related declarations | ||
* : http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html | ||
* | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#ifndef _CC_POSIX_MQUEUE_H_ | ||
#pragma once | ||
|
||
#define _CC_POSIX_MQUEUE_H_ | ||
|
||
/* CC+POSIX includes. */ | ||
#include <posix/include/time.h> | ||
#include <posix/include/sys/types.h> | ||
#include <posix/time.h> | ||
#include <posix/sys/types.h> | ||
|
||
/** | ||
* @brief Message queue attributes. | ||
|
@@ -235,5 +237,3 @@ int mq_timedsend( mqd_t mqdes, | |
* ENOENT - The named message queue does not exist. | ||
*/ | ||
int mq_unlink( const char * name ); | ||
|
||
#endif /* ifndef _CC_POSIX_MQUEUE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
/** | ||
* @file pthread.h | ||
* @brief Threads. | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : pthread.h | ||
* Description : Threads. | ||
* : http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html | ||
* | ||
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#ifndef _CC_POSIX_PTHREAD_H_ | ||
#pragma once | ||
|
||
#define _CC_POSIX_PTHREAD_H_ | ||
|
||
/* CC+POSIX includes. POSIX states that this header shall make symbols | ||
* defined in sched.h and time.h visible. */ | ||
#include "posix/include/sched.h" | ||
#include "posix/include/time.h" | ||
#include "posix/sched.h" | ||
#include "posix/time.h" | ||
|
||
/** | ||
* @name pthread detach state. | ||
|
@@ -472,5 +478,3 @@ pthread_t pthread_self( void ); | |
int pthread_setschedparam( pthread_t thread, | ||
int policy, | ||
const struct sched_param * param ); | ||
|
||
#endif /* _CC_POSIX_PTHREAD_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
/** | ||
* @file sched.h | ||
* @brief Execution scheduling. | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : sched.h | ||
* Description : Execution scheduling. | ||
* : http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sched.h.html | ||
* | ||
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sched.h.html | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#ifndef _CC_POSIX_SCHED_H_ | ||
#pragma once | ||
|
||
#define _CC_POSIX_SCHED_H_ | ||
|
||
/** | ||
|
@@ -55,5 +61,3 @@ int sched_get_priority_min( int policy ); | |
* @retval 0 - Upon successful completion | ||
*/ | ||
int sched_yield( void ); | ||
|
||
#endif /* ifndef _CC_POSIX_SCHED_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,18 @@ | |
* File Name : semaphore.h | ||
* Description : This file consists of posix semaphore related declarations | ||
* : http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/semaphore.h.html | ||
* | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#ifndef _CC_POSIX_SEMAPHORE_H_ | ||
#pragma once | ||
|
||
#define _CC_POSIX_SEMAPHORE_H_ | ||
|
||
/* CC+POSIX includes. */ | ||
#include <posix/include/time.h> | ||
#include <posix/cc_posix_types.h> | ||
#include <posix/time.h> | ||
#include <cc_posix_types.h> | ||
|
||
/** | ||
* @brief Semaphore type. | ||
|
@@ -118,5 +120,3 @@ int sem_trywait( sem_t * sem ); | |
* @note Deadlock detection is not implemented. | ||
*/ | ||
int sem_wait( sem_t * sem ); | ||
|
||
#endif /* ifndef _CC_POSIX_SEMAPHORE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
/** | ||
* @file signal.h | ||
* @brief Signals. | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* Signals are currently not implemented in CC+POSIX. This header only | ||
* defines the signal data structures used elsewhere. | ||
* File Name : signal.h | ||
* Description : Signals (Signals are currently not implemented in CC+POSIX) | ||
* : http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html | ||
* | ||
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#pragma once | ||
|
||
#ifndef _CC_POSIX_SIGNAL_H_ | ||
#define _CC_POSIX_SIGNAL_H_ | ||
|
||
/** | ||
|
@@ -41,5 +43,3 @@ struct sigevent | |
void ( * sigev_notify_function )( union sigval ); /**< Notification function. */ | ||
pthread_attr_t * sigev_notify_attributes; /**< Notification attributes. */ | ||
}; | ||
|
||
#endif /* ifndef _CC_POSIX_SIGNAL_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,22 @@ | |
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : sys/types.h | ||
* Description : Data types. https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html | ||
* Description : Data types. | ||
* : https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html | ||
* | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#ifndef _CC_POSIX_TYPES_H_ | ||
#pragma once | ||
|
||
#define _CC_POSIX_TYPES_H_ | ||
|
||
/* C standard library includes. */ | ||
#include <stdint.h> | ||
|
||
/* Kernel types include */ | ||
#include <posix/cc_posix_types.h> | ||
#include <cc_posix_types.h> | ||
|
||
/** | ||
* @brief Used for system times in clock ticks or CLOCKS_PER_SEC. | ||
|
@@ -165,5 +168,3 @@ typedef void * pthread_barrierattr_t; | |
#if !defined( posixconfigENABLE_OFF_T ) || ( posixconfigENABLE_OFF_T == 1 ) | ||
typedef long int off_t; | ||
#endif | ||
|
||
#endif /* ifndef _CC_POSIX_TYPES_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
/** | ||
* @file time.h | ||
* @brief Time types. | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : time.h | ||
* Description : Time types | ||
* : http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html | ||
* | ||
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#ifndef _CC_POSIX_TIME_H_ | ||
#pragma once | ||
|
||
#define _CC_POSIX_TIME_H_ | ||
|
||
/* CC+POSIX includes. */ | ||
#include <posix/include/sys/types.h> | ||
#include <posix/include/signal.h> | ||
#include <posix/sys/types.h> | ||
#include <posix/signal.h> | ||
|
||
/** | ||
* @name Unit conversion constants. | ||
|
@@ -229,5 +235,3 @@ int timer_settime( timer_t timerid, | |
int flags, | ||
const itimerspec_t * value, | ||
itimerspec_t * ovalue ); | ||
|
||
#endif /* ifndef _CC_POSIX_TIME_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
/** | ||
* @file unistd.h | ||
* @brief Standard symbolic constants and types | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : unistd.h | ||
* Description : Standard symbolic constants and types | ||
* : http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html | ||
* | ||
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#ifndef _CC_POSIX_UNISTD_H_ | ||
#define _CC_POSIX_UNISTD_H_ | ||
#pragma once | ||
|
||
#include "posix/include/sys/types.h" | ||
#include "posix/sys/types.h" | ||
|
||
#define _CC_POSIX_UNISTD_H_ | ||
|
||
/** | ||
* @brief Suspend execution for an interval of time. | ||
|
@@ -32,5 +38,3 @@ unsigned sleep( unsigned seconds ); | |
* @retval 0 - Upon successful completion. | ||
*/ | ||
int usleep( useconds_t usec ); | ||
|
||
#endif /* ifndef _CC_POSIX_UNISTD_H_ */ |
Oops, something went wrong.