-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from VisorFolks/fr-cc-posix
Add initial POSIX support to kernel - Not Tested on target
- Loading branch information
Showing
32 changed files
with
3,176 additions
and
79 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
sonar.organization=cyancore | ||
sonar.projectKey=VisorFolks_cyancore | ||
sonar.sources=src | ||
sonar.cfamily.build-wrapper-output=toolchain/bw-output | ||
sonar.verbose=false | ||
sonar.host.url=https://sonarcloud.io | ||
sonar.verbose=true | ||
sonar.cfamily.threads=8 | ||
sonar.cfamily.cache.enabled=true | ||
sonar.cfamily.cache.path=toolchain/bw-output/cfamily_cache |
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,95 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : supervisor_call.h | ||
* Description : This file consists of supervisor call IDs and prototypes | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#pragma once | ||
#define _SUPER_CALL_H_ | ||
|
||
#include <stdint.h> | ||
#include <status.h> | ||
|
||
// Supervisor call IDs | ||
typedef enum scall_id | ||
{ | ||
scall_id_generic = 0x0000, | ||
scall_id_is_irq, | ||
/* pthread related */ | ||
scall_id_pthread_attr_destroy = 0x1000, | ||
scall_id_pthread_attr_getdetachstate, | ||
scall_id_pthread_attr_getschedparam, | ||
scall_id_pthread_attr_getstacksize, | ||
scall_id_pthread_attr_init, | ||
scall_id_pthread_attr_setdetachstate, | ||
scall_id_pthread_attr_setschedparam, | ||
scall_id_pthread_attr_setschedpolicy, | ||
scall_id_pthread_attr_setstacksize, | ||
scall_id_pthread_barrier_destroy, | ||
scall_id_pthread_barrier_init, | ||
scall_id_pthread_barrier_wait, | ||
scall_id_pthread_create, | ||
scall_id_pthread_cond_broadcast, | ||
scall_id_pthread_cond_destroy, | ||
scall_id_pthread_cond_init, | ||
scall_id_pthread_cond_signal, | ||
scall_id_pthread_cond_timedwait, | ||
scall_id_pthread_equal, | ||
scall_id_pthread_exit, | ||
scall_id_pthread_getschedparam, | ||
scall_id_pthread_join, | ||
scall_id_pthread_mutex_destroy, | ||
scall_id_pthread_mutex_init, | ||
scall_id_pthread_mutex_timedlock, | ||
scall_id_pthread_mutex_unlock, | ||
scall_id_pthread_mutexattr_destroy, | ||
scall_id_pthread_mutexattr_gettype, | ||
scall_id_pthread_mutexattr_init, | ||
scall_id_pthread_mutexattr_settype, | ||
scall_id_pthread_self, | ||
scall_id_pthread_setschedparam, | ||
scall_id_pthread_delay_ticks, | ||
/* mqueue related */ | ||
scall_id_mq_close, | ||
scall_id_mq_setattr, | ||
scall_id_mq_getattr, | ||
scall_id_mq_open, | ||
scall_id_mq_receive, | ||
scall_id_mq_send, | ||
scall_id_mq_unlink, | ||
/* semaphore related */ | ||
scall_id_sem_init, | ||
scall_id_sem_destroy, | ||
scall_id_sem_getvalue, | ||
scall_id_sem_post, | ||
scall_id_sem_wait, | ||
/* scheduler related */ | ||
scall_id_sched_get_max_priority, | ||
scall_id_sched_get_min_priority, | ||
scall_id_sched_yield, | ||
|
||
} scall_id_t; | ||
|
||
typedef struct sret | ||
{ | ||
uintptr_t p; | ||
size_t size; | ||
status_t status; | ||
} sret_t; | ||
|
||
typedef struct scall | ||
{ | ||
scall_id_t id; | ||
sret_t (*callback)(unsigned int a0, unsigned int a1, unsigned int a2); | ||
} scall_t; | ||
|
||
#define INCLUDE_SCALL(_name, _id , _callback) \ | ||
const scall_t _name _SECTION(".scall") = \ | ||
{ \ | ||
.id = _id, \ | ||
.callback = _callback \ | ||
} |
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,16 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2019, Cyancore Team | ||
* | ||
* File Name : worker.h | ||
* Description : This file consists of supervisor-workers | ||
* and related prototypes | ||
* Primary Author : Pranjal Chanda [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <supervisor_call.h> | ||
|
||
void super_call(scall_id_t id, unsigned int a0, unsigned int a1, unsigned int a2, sret_t *ret); |
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
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 |
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,47 @@ | ||
/* | ||
* 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 | ||
#define posixconfigTICK_RATE_HZ (1000) | ||
#endif | ||
|
||
/******************* | ||
* MQUEUE configs | ||
*******************/ | ||
|
||
/** | ||
* @brief MQUEUE max name length in bytes | ||
*/ | ||
#ifndef posixconfigMQ_NAME_LEN_MAX | ||
#define posixconfigMQ_NAME_LEN_MAX (16) | ||
#endif | ||
|
||
/** | ||
* @brief MQUEUE max munber of queues allowed | ||
*/ | ||
#ifndef posixconfigMQ_MAX_QUEUE | ||
#define posixconfigMQ_MAX_QUEUE (5) | ||
#endif | ||
|
||
/** | ||
* @brief MQUEUE Maximum number of messages in an mq at one time | ||
*/ | ||
#ifndef posixconfigMQ_MAX_MESSAGES | ||
#define posixconfigMQ_MAX_MESSAGES (10) | ||
#endif | ||
|
||
/** | ||
* @brief MQUEUE Maximum size (in bytes) of each message | ||
*/ | ||
#ifndef posixconfigMQ_MAX_SIZE | ||
#define posixconfigMQ_MAX_SIZE (128) | ||
#endif |
Oops, something went wrong.