Implement SCHED_RR

This commit is contained in:
NIIBE Yutaka
2013-06-05 11:45:06 +09:00
parent 205cab1b81
commit 2ccfe0732e
2 changed files with 128 additions and 69 deletions

View File

@@ -27,11 +27,17 @@
*/
typedef uint32_t chopstx_t;
typedef uint8_t chopstx_prio_t;
/* NOTE: This signature is different to PTHREAD's one. */
chopstx_t
chopstx_create (uint8_t prio, uint32_t stack_addr, size_t stack_size,
chopstx_create (uint32_t flags_and_prio,
uint32_t stack_addr, size_t stack_size,
void *(thread_entry) (void *), void *);
#define CHOPSTX_PRIO_BITS 8
#define CHOPSTX_DETACHED 0x10000
#define CHOPSTX_SCHED_RR 0x20000
void chopstx_usec_wait (uint32_t useconds);
@@ -39,7 +45,6 @@ struct chx_spinlock {
/* nothing for uniprocessor. */
};
typedef uint8_t chopstx_prio_t;
typedef struct chx_mtx {
struct {
struct chx_thread *next, *prev;