Skip to content
Snippets Groups Projects
Commit 3a5e090e authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

provide a proper curthread implementation

parent 177d40e6
No related branches found
No related tags found
No related merge requests found
- make the curthread macro do something useful, currently it can
only be used as a faux boolean for zio, and will cause harm otherwise
- make delay() do something useful
- sort out various timing functions in <sys/time.h>
#ifndef _BSD_PORTING_CURTHREAD_H
#define _BSD_PORTING_CURTHREAD_H
#include <bsd/porting/netport.h>
__BEGIN_DECLS;
extern struct thread *get_curthread(void);
#define curthread get_curthread()
__END_DECLS;
#endif /* _BSD_PORTING_CURTHREAD_H */
......@@ -4,6 +4,7 @@
#include <assert.h>
#include "sched.hh"
#include <bsd/porting/curthread.h>
#include <bsd/porting/netport.h>
#include <bsd/sys/sys/kthread.h>
......@@ -28,3 +29,9 @@ kthread_exit(void)
{
sched::thread::exit();
}
struct thread *
get_curthread(void)
{
return reinterpret_cast<struct thread *>(sched::thread::current());
}
......@@ -29,6 +29,7 @@
#ifndef _OPENSOLARIS_SYS_PROC_H_
#define _OPENSOLARIS_SYS_PROC_H_
#include <bsd/porting/curthread.h>
#include <sys/param.h>
#include <stdint.h>
#include <sys/lock.h>
......@@ -59,9 +60,6 @@ typedef struct proc proc_t;
extern struct proc *zfsproc;
// horrible hack for ZIO, will fail for code not abusing curthread as a boolean true
#define curthread ((kthread_t *)1)
static __inline kthread_t *
thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
size_t len, proc_t *pp, int state, pri_t pri)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment