Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
188429fd
authored
Nov 29, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
mutex create function and threadid
parent
50a1ffb3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
src/mutex.c
src/mutex.h
src/mutex.c
View file @
188429fd
#include "mutex.h"
mutex
mutex_create
()
{
mutex
m
;
m
.
lock_var
=
0
;
m
.
value
=
0
;
m
.
thread_id
=
0
;
return
m
;
}
uint32_t
mutex_lock
(
mutex
m
)
{
asm
volatile
...
...
src/mutex.h
View file @
188429fd
...
...
@@ -7,8 +7,10 @@ typedef struct
{
uint32_t
lock_var
;
uint32_t
value
;
uint32_t
thread_id
;
}
__attribute__
((
packed
))
mutex
;
mutex
mutex_create
();
uint32_t
mutex_lock
(
mutex
m
);
uint32_t
mutex_unlock
(
mutex
m
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment