fix some bugs for sd read

This commit is contained in:
wuzheng
2022-12-09 13:57:01 +08:00
parent 6fa996d132
commit 2df54e7f41
18 changed files with 2646 additions and 5 deletions

View File

@@ -73,6 +73,12 @@ typedef int pid_t;
int pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void));
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg);
int pthread_attr_init(pthread_attr_t *attr);
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stack_size);
int pthread_attr_setschedparam(pthread_attr_t *attr,struct sched_param const *param);
int pthread_attr_setstack(pthread_attr_t *attr,
void *stack_base,
size_t stack_size);
void pthread_exit(void *value_ptr);
int pthread_detach(pthread_t thread);
int pthread_join(pthread_t thread, void **retval);

View File

@@ -22,6 +22,10 @@
#include <stdio.h>
#include "include/pthread.h"
#define DEFAULT_STACK_SIZE 2048
#define DEFAULT_PRIORITY (KTASK_PRIORITY_MAX/2 + KTASK_PRIORITY_MAX/4)
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg)
{
@@ -55,6 +59,27 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
}
int pthread_attr_init(pthread_attr_t *attr)
{
return 0;
}
int pthread_attr_setschedparam(pthread_attr_t *attr,
struct sched_param const *param)
{
NULL_PARAM_CHECK(attr != NULL);
NULL_PARAM_CHECK(param != NULL);
attr->schedparam.sched_priority = param->sched_priority;
return 0;
}
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stack_size)
{
return 0;
}
void pthread_exit(void *value_ptr){
//todo add exit value
UserTaskQuit();