Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Miosix Kernel
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
Avionics
Software Development
Miosix Kernel
Commits
f0f18ddd
Commit
f0f18ddd
authored
2 years ago
by
Federico
Browse files
Options
Downloads
Patches
Plain Diff
Encapsulate thread pointer in flags
parent
645e8bb1
Branches
Branches containing commit
No related tags found
2 merge requests
!40
Update to Miosix 2.7
,
!17
Draft: Improved miosix build system and fixed cmake scripts
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
miosix/kernel/kernel.cpp
+1
-2
1 addition, 2 deletions
miosix/kernel/kernel.cpp
miosix/kernel/kernel.h
+5
-2
5 additions, 2 deletions
miosix/kernel/kernel.h
with
6 additions
and
4 deletions
miosix/kernel/kernel.cpp
+
1
−
2
View file @
f0f18ddd
...
@@ -717,7 +717,7 @@ void Thread::setupUserspaceContext(unsigned int entry, unsigned int *gotBase,
...
@@ -717,7 +717,7 @@ void Thread::setupUserspaceContext(unsigned int entry, unsigned int *gotBase,
#endif //WITH_PROCESSES
#endif //WITH_PROCESSES
Thread
::
Thread
(
unsigned
int
*
watermark
,
unsigned
int
stacksize
,
Thread
::
Thread
(
unsigned
int
*
watermark
,
unsigned
int
stacksize
,
bool
defaultReent
)
:
schedData
(),
flags
(),
savedPriority
(
0
),
bool
defaultReent
)
:
schedData
(),
flags
(
this
),
savedPriority
(
0
),
mutexLocked
(
nullptr
),
mutexWaiting
(
nullptr
),
watermark
(
watermark
),
mutexLocked
(
nullptr
),
mutexWaiting
(
nullptr
),
watermark
(
watermark
),
ctxsave
(),
stacksize
(
stacksize
)
ctxsave
(),
stacksize
(
stacksize
)
{
{
...
@@ -782,7 +782,6 @@ Thread *Thread::doCreate(void*(*startfunc)(void*) , unsigned int stacksize,
...
@@ -782,7 +782,6 @@ Thread *Thread::doCreate(void*(*startfunc)(void*) , unsigned int stacksize,
reinterpret_cast
<
unsigned
int
*>
(
thread
),
argv
);
reinterpret_cast
<
unsigned
int
*>
(
thread
),
argv
);
if
((
options
&
JOINABLE
)
==
0
)
thread
->
flags
.
IRQsetDetached
();
if
((
options
&
JOINABLE
)
==
0
)
thread
->
flags
.
IRQsetDetached
();
thread
->
flags
.
t
=
thread
;
return
thread
;
return
thread
;
}
}
...
...
This diff is collapsed.
Click to expand it.
miosix/kernel/kernel.h
+
5
−
2
View file @
f0f18ddd
...
@@ -926,7 +926,7 @@ private:
...
@@ -926,7 +926,7 @@ private:
/**
/**
* Constructor, sets flags to default.
* Constructor, sets flags to default.
*/
*/
ThreadFlags
(
)
:
flags
(
0
)
{}
ThreadFlags
(
Thread
*
t
)
:
t
(
t
),
flags
(
0
)
{}
/**
/**
* Set the wait flag of the thread.
* Set the wait flag of the thread.
...
@@ -1034,7 +1034,9 @@ private:
...
@@ -1034,7 +1034,9 @@ private:
*/
*/
bool
isInUserspace
()
const
{
return
flags
&
USERSPACE
;
}
bool
isInUserspace
()
const
{
return
flags
&
USERSPACE
;
}
Thread
*
t
;
//Unwanted methods
ThreadFlags
(
const
ThreadFlags
&
p
)
=
delete
;
ThreadFlags
&
operator
=
(
const
ThreadFlags
&
p
)
=
delete
;
private
:
private
:
///\internal Thread is in the wait status. A call to wakeup will change
///\internal Thread is in the wait status. A call to wakeup will change
...
@@ -1061,6 +1063,7 @@ private:
...
@@ -1061,6 +1063,7 @@ private:
///\internal Thread is running in userspace
///\internal Thread is running in userspace
static
const
unsigned
int
USERSPACE
=
1
<<
6
;
static
const
unsigned
int
USERSPACE
=
1
<<
6
;
Thread
*
t
;
///<\internal pointer to the thread to which the flags belong
unsigned
char
flags
;
///<\internal flags are stored here
unsigned
char
flags
;
///<\internal flags are stored here
};
};
...
...
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