Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syscall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
syscall
Commits
52441c28
Verified
Commit
52441c28
authored
Jul 24, 2019
by
jD91mZM2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First step for ptrace overhaul
parent
df993cc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
36 deletions
+38
-36
src/data.rs
src/data.rs
+23
-24
src/flag.rs
src/flag.rs
+15
-12
No files found.
src/data.rs
View file @
52441c28
use
core
::
ops
::{
Deref
,
DerefMut
};
use
core
::{
fmt
,
mem
,
slice
};
use
core
::{
mem
,
slice
};
#[derive(Copy,
Clone,
Debug,
Default)]
#[repr(C)]
...
...
@@ -303,32 +303,16 @@ impl DerefMut for FloatRegisters {
}
}
#[derive(Clone,
Copy)]
#[repr(C)]
pub
union
PtraceEventData
{
pub
clone
:
usize
,
pub
signal
:
usize
}
impl
Default
for
PtraceEventData
{
fn
default
()
->
Self
{
Self
{
clone
:
0
,
}
}
}
impl
fmt
::
Debug
for
PtraceEventData
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
write!
(
f
,
"PtraceEventData(...)"
)
}
}
#[derive(Clone,
Copy,
Debug,
Default)]
#[repr(C)]
pub
struct
PtraceEvent
{
pub
tag
:
u16
,
pub
data
:
PtraceEventData
,
pub
cause
:
u64
,
pub
a
:
usize
,
pub
b
:
usize
,
pub
c
:
usize
,
pub
d
:
usize
,
pub
e
:
usize
,
pub
f
:
usize
}
impl
Deref
for
PtraceEvent
{
...
...
@@ -347,3 +331,18 @@ impl DerefMut for PtraceEvent {
}
}
}
#[macro_export]
macro_rules!
ptrace_event
{
(
$cause:expr
$
(,
$a:expr
$
(,
$b:expr
$
(,
$c:expr
)
?
)
?
)
?
)
=>
{
PtraceEvent
{
cause
:
$cause
,
$
(
a
:
$a
,
$
(
b
:
$b
,
$
(
c
:
$c
,)
?
)
?
)
?
..
Default
::
default
()
}
}
}
src/flag.rs
View file @
52441c28
...
...
@@ -60,23 +60,26 @@ pub const PHYSMAP_WRITE: usize = 0x0000_0001;
pub
const
PHYSMAP_WRITE_COMBINE
:
usize
=
0x0000_0002
;
pub
const
PHYSMAP_NO_CACHE
:
usize
=
0x0000_0004
;
// The top 32 bits of PTRACE_* are reserved, for now
pub
const
PTRACE_STOP_PRE_SYSCALL
:
u64
=
0x0000_0001
;
pub
const
PTRACE_STOP_POST_SYSCALL
:
u64
=
0x0000_0002
;
pub
const
PTRACE_STOP_SINGLESTEP
:
u64
=
0x0000_0004
;
pub
const
PTRACE_STOP_SIGNAL
:
u64
=
0x0000_0008
;
pub
const
PTRACE_STOP_MASK
:
u64
=
0x0000_00FF
;
pub
const
PTRACE_EVENT_CLONE
:
u64
=
0x0000_0100
;
pub
const
PTRACE_EVENT_MASK
:
u64
=
0x0000_0F00
;
pub
const
PTRACE_FLAG_SYSEMU
:
u64
=
0x0000_1000
;
pub
const
PTRACE_FLAG_WAIT
:
u64
=
0x0000_2000
;
pub
const
PTRACE_FLAG_MASK
:
u64
=
0x0000_F000
;
pub
const
PROT_NONE
:
usize
=
0x0000_0000
;
pub
const
PROT_EXEC
:
usize
=
0x0001_0000
;
pub
const
PROT_WRITE
:
usize
=
0x0002_0000
;
pub
const
PROT_READ
:
usize
=
0x0004_0000
;
pub
const
PTRACE_CONT
:
u8
=
0b0000_0001
;
pub
const
PTRACE_SINGLESTEP
:
u8
=
0b0000_0010
;
pub
const
PTRACE_SYSCALL
:
u8
=
0b0000_0011
;
pub
const
PTRACE_WAIT
:
u8
=
0b0000_0100
;
pub
const
PTRACE_SIGNAL
:
u8
=
0b0000_0101
;
pub
const
PTRACE_OPERATIONMASK
:
u8
=
0b0000_1111
;
pub
const
PTRACE_SYSEMU
:
u8
=
0b0001_0000
;
pub
const
PTRACE_EVENT_CLONE
:
u16
=
0
;
pub
const
PTRACE_EVENT_SIGNAL
:
u16
=
1
;
pub
const
SEEK_SET
:
usize
=
0
;
pub
const
SEEK_CUR
:
usize
=
1
;
pub
const
SEEK_END
:
usize
=
2
;
...
...
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