Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
3a5e090e
Commit
3a5e090e
authored
11 years ago
by
Christoph Hellwig
Browse files
Options
Downloads
Patches
Plain Diff
provide a proper curthread implementation
parent
177d40e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
TODO.zfs
+0
-2
0 additions, 2 deletions
TODO.zfs
bsd/porting/curthread.h
+13
-0
13 additions, 0 deletions
bsd/porting/curthread.h
bsd/porting/kthread.cc
+7
-0
7 additions, 0 deletions
bsd/porting/kthread.cc
bsd/sys/cddl/compat/opensolaris/sys/proc.h
+1
-3
1 addition, 3 deletions
bsd/sys/cddl/compat/opensolaris/sys/proc.h
with
21 additions
and
5 deletions
TODO.zfs
+
0
−
2
View file @
3a5e090e
- 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>
This diff is collapsed.
Click to expand it.
bsd/porting/curthread.h
0 → 100644
+
13
−
0
View file @
3a5e090e
#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 */
This diff is collapsed.
Click to expand it.
bsd/porting/kthread.cc
+
7
−
0
View file @
3a5e090e
...
...
@@ -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
());
}
This diff is collapsed.
Click to expand it.
bsd/sys/cddl/compat/opensolaris/sys/proc.h
+
1
−
3
View file @
3a5e090e
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment