Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
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
Peter Limkilde Svendsen
relibc
Commits
42c24dd7
Verified
Commit
42c24dd7
authored
8 months ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Successfully run more userspace.
parent
7fcf5a1a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
redox-rt/src/arch/x86_64.rs
+5
-3
5 additions, 3 deletions
redox-rt/src/arch/x86_64.rs
redox-rt/src/signal.rs
+3
-2
3 additions, 2 deletions
redox-rt/src/signal.rs
redox-rt/src/sync.rs
+5
-1
5 additions, 1 deletion
redox-rt/src/sync.rs
src/ld_so/tcb.rs
+8
-1
8 additions, 1 deletion
src/ld_so/tcb.rs
with
21 additions
and
7 deletions
redox-rt/src/arch/x86_64.rs
+
5
−
3
View file @
42c24dd7
...
@@ -78,7 +78,11 @@ asmfunction!(__relibc_internal_fork_wrapper -> usize: ["
...
@@ -78,7 +78,11 @@ asmfunction!(__relibc_internal_fork_wrapper -> usize: ["
mov rdi, rsp
mov rdi, rsp
call __relibc_internal_fork_impl
call __relibc_internal_fork_impl
jmp 2f
add rsp, 80
pop rbp
ret
"
]
<=
[]);
"
]
<=
[]);
asmfunction!
(
__relibc_internal_fork_ret
:
[
"
asmfunction!
(
__relibc_internal_fork_ret
:
[
"
...
@@ -91,8 +95,6 @@ asmfunction!(__relibc_internal_fork_ret: ["
...
@@ -91,8 +95,6 @@ asmfunction!(__relibc_internal_fork_ret: ["
xor rax, rax
xor rax, rax
.p2align 4
2:
add rsp, 32
add rsp, 32
pop r15
pop r15
pop r14
pop r14
...
...
This diff is collapsed.
Click to expand it.
redox-rt/src/signal.rs
+
3
−
2
View file @
42c24dd7
...
@@ -129,16 +129,17 @@ pub fn sigaction(signal: u8, new: Option<&Sigaction>, old: Option<&mut Sigaction
...
@@ -129,16 +129,17 @@ pub fn sigaction(signal: u8, new: Option<&Sigaction>, old: Option<&mut Sigaction
let
_sigguard
=
tmp_disable_signals
();
let
_sigguard
=
tmp_disable_signals
();
let
ctl
=
current_sigctl
();
let
ctl
=
current_sigctl
();
let
guard
=
SIGACTIONS
.lock
();
let
mut
guard
=
SIGACTIONS
.lock
();
let
old_ignmask
=
IGNMASK
.load
(
Ordering
::
Relaxed
);
let
old_ignmask
=
IGNMASK
.load
(
Ordering
::
Relaxed
);
if
let
Some
(
old
)
=
old
{
if
let
Some
(
old
)
=
old
{
// TODO
*
old
=
guard
[
usize
::
from
(
signal
)];
}
}
let
Some
(
new
)
=
new
else
{
let
Some
(
new
)
=
new
else
{
return
Ok
(());
return
Ok
(());
};
};
guard
[
usize
::
from
(
signal
)]
=
*
new
;
let
sig_group
=
usize
::
from
(
signal
)
/
32
;
let
sig_group
=
usize
::
from
(
signal
)
/
32
;
let
sig_bit32
=
1
<<
((
signal
-
1
)
%
32
);
let
sig_bit32
=
1
<<
((
signal
-
1
)
%
32
);
...
...
This diff is collapsed.
Click to expand it.
redox-rt/src/sync.rs
+
5
−
1
View file @
42c24dd7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
use
core
::
cell
::
UnsafeCell
;
use
core
::
cell
::
UnsafeCell
;
use
core
::
ops
::{
Deref
,
DerefMut
};
use
core
::
ops
::{
Deref
,
DerefMut
};
use
core
::
sync
::
atomic
::
AtomicU32
;
use
core
::
sync
::
atomic
::
{
AtomicU32
,
Ordering
}
;
pub
struct
Mutex
<
T
>
{
pub
struct
Mutex
<
T
>
{
pub
lockword
:
AtomicU32
,
pub
lockword
:
AtomicU32
,
...
@@ -24,6 +24,9 @@ impl<T> Mutex<T> {
...
@@ -24,6 +24,9 @@ impl<T> Mutex<T> {
}
}
}
}
pub
fn
lock
(
&
self
)
->
MutexGuard
<
'_
,
T
>
{
pub
fn
lock
(
&
self
)
->
MutexGuard
<
'_
,
T
>
{
while
self
.lockword
.compare_exchange
(
UNLOCKED
,
LOCKED
,
Ordering
::
Acquire
,
Ordering
::
Relaxed
)
.is_err
()
{
core
::
hint
::
spin_loop
();
}
MutexGuard
{
lock
:
self
}
MutexGuard
{
lock
:
self
}
}
}
}
}
...
@@ -44,5 +47,6 @@ impl<T> DerefMut for MutexGuard<'_, T> {
...
@@ -44,5 +47,6 @@ impl<T> DerefMut for MutexGuard<'_, T> {
}
}
impl
<
T
>
Drop
for
MutexGuard
<
'_
,
T
>
{
impl
<
T
>
Drop
for
MutexGuard
<
'_
,
T
>
{
fn
drop
(
&
mut
self
)
{
fn
drop
(
&
mut
self
)
{
self
.lock.lockword
.store
(
UNLOCKED
,
Ordering
::
Release
);
}
}
}
}
This diff is collapsed.
Click to expand it.
src/ld_so/tcb.rs
+
8
−
1
View file @
42c24dd7
...
@@ -56,6 +56,13 @@ pub struct Tcb {
...
@@ -56,6 +56,13 @@ pub struct Tcb {
pub
pthread
:
Pthread
,
pub
pthread
:
Pthread
,
}
}
#[cfg(target_os
=
"redox"
)]
const
_
:
()
=
{
if
mem
::
size_of
::
<
Tcb
>
()
>
syscall
::
PAGE_SIZE
{
panic!
(
"too large TCB!"
);
}
};
impl
Tcb
{
impl
Tcb
{
/// Create a new TCB
/// Create a new TCB
pub
unsafe
fn
new
(
size
:
usize
)
->
Result
<&
'static
mut
Self
>
{
pub
unsafe
fn
new
(
size
:
usize
)
->
Result
<&
'static
mut
Self
>
{
...
@@ -223,7 +230,7 @@ impl Tcb {
...
@@ -223,7 +230,7 @@ impl Tcb {
syscall!
(
ARCH_PRCTL
,
ARCH_SET_FS
,
tls_end
);
syscall!
(
ARCH_PRCTL
,
ARCH_SET_FS
,
tls_end
);
}
}
#[cfg(
all(
target_os
=
"redox"
)
)
]
#[cfg(target_os
=
"redox"
)]
unsafe
fn
os_arch_activate
(
tls_end
:
usize
,
tls_len
:
usize
)
{
unsafe
fn
os_arch_activate
(
tls_end
:
usize
,
tls_len
:
usize
)
{
redox_rt
::
tcb_activate
(
tls_end
,
tls_len
)
redox_rt
::
tcb_activate
(
tls_end
,
tls_len
)
}
}
...
...
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