fit musl for riscv64 boards.

This commit is contained in:
TXuian
2022-07-27 05:35:56 -07:00
parent 214cf55603
commit cb4a9d03e0
124 changed files with 768 additions and 1260 deletions

View File

@@ -101,12 +101,12 @@ int PrivTaskDelay(int32_t ms)
{
UserTaskDelay(ms);
}
#ifndef SEPARATE_COMPILE
uint32_t PrivGetTickTime()
{
return CalculteTimeMsFromTick(CurrentTicksGain());
}
#endif
/*********************fs**************************/
#ifdef FS_VFS
/************************Driver Posix Transform***********************/

View File

@@ -31,7 +31,8 @@ extern "C" {
#if defined(ARCH_ARM) && !defined(LIB_MUSLLIB)
#include "pthread arm.h"
#endif
// enum {
// PTHREAD_BARRIER_SERIAL_THREAD,
// PTHREAD_CANCEL_ASYNCHRONOUS,
@@ -105,7 +106,6 @@ int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared);
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, int *pshared);
#endif
#ifdef __cplusplus
}

View File

@@ -49,7 +49,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
return -1 ;
ret = UserTaskStartup(pid);
*thread = (pthread_t)pid;
*thread = (pthread_t)(long)pid;
return ret;
@@ -63,7 +63,7 @@ void pthread_exit(void *value_ptr){
pthread_t pthread_self(void){
pthread_t pthread ;
pthread = (pthread_t)UserGetTaskID();
pthread = (pthread_t)(long)UserGetTaskID();
return pthread;
}
@@ -112,7 +112,8 @@ int pthread_join(pthread_t thread, void **retval)
int pthread_kill(pthread_t thread, int sig)
{
/* This api should not be used, and will not be supported */
UserTaskDelete((int32_t)thread);
int32_t *thread_id_tmp = (void *)&thread;
UserTaskDelete(*thread_id_tmp);
return -1;
}

View File

@@ -24,7 +24,8 @@
#include <pthread.h>
#include <string.h>
#if defined(ARCH_ARM) && defined(LIB_MUSLLIB)
// #if defined(ARCH_ARM) && defined(LIB_MUSLLIB)
#if defined(LIB_MUSLLIB)
int pthread_mutex_init(pthread_mutex_t* p_mutex, const pthread_mutexattr_t* attr)
{
pthread_mutexattr_t mutexAttr;