Sean Cross
461d6f23ee
syscall: add wrapper functions for destroy_server and disconnect
...
Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-02 17:33:36 +08:00
Sean Cross
0230ccb252
xous: syscall: add definitions for Disconnect and DestroyServer
...
Signed-off-by: Sean Cross <sean@xobs.io>
2021-04-02 17:30:32 +08:00
Sean Cross
c7b2b2cab0
xous: add offset and valid to returned memory
...
This will enable us to have more information about the result that is
returned when mutable memory is modified by a server.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 13:16:15 +08:00
Sean Cross
d3879d36ac
xous: use try_into when converting messages to syscalls
...
This moves message internals back into the message struct.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 11:58:50 +08:00
Sean Cross
5410d62ef5
xous: fix create_thread_[2..4] arg count
...
These functions assumed there was only one argument, which was
incorrect.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:53:50 +08:00
Sean Cross
2b97ea25ab
xous: add create_thread_n functions
...
These are used to create threads with between 0 and 4 arguments.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-25 10:42:49 +08:00
Sean Cross
27c35223cd
xous: run cargo-fmt
...
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-18 20:10:26 +08:00
Sean Cross
071f2047f8
xous: return TID and PID from current_tid() and current_pid()
...
These should return the raw values, rather than the Result values.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-18 20:10:01 +08:00
Sean Cross
a0c82ee25c
xous: initial draft of xous target support
...
This is an initial cut of the library as it will be included in the
libstd.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-11 12:27:55 +08:00
Sean Cross
530e105fe4
xous: add GetProcessID and GetThreadID syscalls
...
Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-11 11:19:51 +08:00
Sean Cross
f98c8cc07c
xous: make thread IDs u32
...
This keeps them consistent across platforms.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-02-01 17:18:24 +08:00
bunnie
cc66c3911a
starting to lay out initial framework for the graphical abstraction manager (GAM)
2021-01-17 04:02:08 +08:00
bunnie
4ef581a266
riddled with race conditions, but...sort of works
2021-01-08 05:20:53 +08:00
hasheddan
666be8db7f
Fix server typos in syscall doc comments
...
Fixes a few minor typos in the sycall documentation comments.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2021-01-05 16:28:08 -06:00
Sean Cross
7b50d00eb8
repo: run cargo fmt
...
This reformats line endings to be consistent, and reinforces the
contents of `.gitattributes`.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-03 18:31:51 +08:00
Sean Cross
1875126dba
xous: connect_for_process: add wrapper function
...
This provides a functional call around the raw syscall.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 22:50:49 +08:00
Sean Cross
06daa06921
xous: add syscall definition for ConnectForProcess
...
This call allows one process to establish a connection on behalf of
another process.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 22:47:01 +08:00
Sean Cross
1fa83d1d94
xous: make MessageSender a struct
...
This is now an object instead of an alias for `usize`, in preparation
for adding a `.pid()` function.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 22:16:24 +08:00
Sean Cross
f165130931
xous: add CreateServer syscall
...
This syscall has not yet been wired up.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:44:45 +08:00
Sean Cross
25e4d16de3
xous-os: rename CreateServer to CreateServerWithAddress
...
Servers will, by default, get randomly-assigned SIDs. Certain servers
will want to have well-known SIDs, such as the log server or the
nameserver. These will use a separate call in order to perform this
priveledged operation.
A subsequent patch will add `CreateServer`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-04 20:33:33 +08:00
Sean Cross
6604bfcdb0
xous-rs: add TryReceiveMessage
...
This non-blocking function call will retrieve a message if one exists,
or will immediately return None if the queue is empty.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-25 20:20:59 +08:00
Sean Cross
b497ad113e
xous: terminate process on panic
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-11 12:52:12 +08:00
Sean Cross
bb304d412a
xous: add can_call_from_interrupt() to SysCall
...
This function can be used to determine if a particular syscall may be
called from an interrupt context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:26:33 +08:00
Sean Cross
719549a2cb
xous: rename ReturnToParentI -> ReturnToParent
...
This syscall isn't the only one that can be called from an interrupt
context.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-11-01 16:26:19 +08:00
Sean Cross
7aab01c95d
xous: fix memory messages in hosted environment
...
This fixes passing memory between clients and servers when running
n a hosted environment.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-29 19:40:41 +08:00
Sean Cross
ac321be7e9
xous: implement send_message()
...
This fixes `send_message()` so it works as expected.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-14 11:18:02 +08:00
Sean Cross
ad154e998e
xous: add NewServerID return value
...
This is used when creating a new Server. In addition to the ServerID, it
also returns the ConnectionID. This is the ID that can be expected when
receiving messages.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-23 10:51:27 +08:00
Sean Cross
d8edcb8b9e
xous: implement ReturnScalar and ReturnScalar2
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 23:36:11 +08:00
Sean Cross
446fe17273
xous: add syscall for BlockingScalar
...
This enables this to be passed to the kernel.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 22:21:21 +08:00
Sean Cross
673577a10e
xous: syscall: add BlockingScalar to syscall handling
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-09-22 21:33:09 +08:00
Sean
5b45382489
xous: make SysCallNumber pub
...
Signed-off-by: Sean <xobs@ci.betrusted.io>
2020-09-03 13:21:52 +08:00
Sean Cross
7a2e5fbde8
xous: add try_ variants for connect/send_message
...
These will return if the server is full. Note that the previous variants
are now unimplemented.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 17:37:39 +08:00
Sean Cross
776fd72483
xous: syscall: work around clippy warnings on Result::Ok
...
clippy warns that "Result::Ok" is redundant. Work around clippy by using
the fully-qualified path.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-30 00:05:02 +08:00
Sean Cross
87c7335afc
xous: don't panic when non-Ok is returned by send_message
...
Sometimes the queue is full, in which case something other than Ok is
returned. Don't panic when this happens.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-18 17:01:28 +08:00
Sean Cross
f469bfcffc
xous-rs: remove baremetal cfg
...
We now check if `target_os = "none"`.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-14 19:53:33 +08:00
Sean Cross
10ecacd136
kernel: native: create process for initial processes
...
These all need to bootstrap themselves.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-09 23:08:54 +08:00
Sean Cross
49083081c3
xous: replace processes-as-threads with baremetal check
...
This gets it working on baremetal, and keeps processes-as-threads
available for running in hosted mode.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-06 23:25:28 +08:00
Sean Cross
6ab4133165
xous: begin using hooks for memory allocation
...
This moves memory allocation into hooks, and allows for a common syscall
regardless of platform.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-03 17:58:22 +08:00
Sean Cross
ea3a473c9f
reworking memory allocation
...
The kernel should run in a `no_std` environment, which means it must
currently run without `alloc`. We have our own allocation methods when
running on baremetal hardware.
Begin the work to break out the allocation method so that it will work
on both desktop and baremetal environments.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-03 17:40:57 +08:00
Sean Cross
21aa67b748
workspace: remove workspace
...
The kernel and userspace both need to use `xous`, but have different
requirements. If we use a workspace, then all instances of `xous-rs`
must have the same feature set.
This breaks them apart so the kernel can have one set of features and
programs can have another set.
As part of this change, tests are now integrated into the kernel, and a
new `create_process_as_thread()` and `wait_process_as_thread()` function
pair have been added.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-02 16:11:12 +08:00
Sean Cross
869ebcff8b
kernel: get tests and running working
...
This fixes process creation so that it works for both tests and running
it as a program.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-29 22:37:03 +08:00
Sean Cross
cece761ff1
xous: SID: convert to using newtype
...
Rather than simply casting a tuple as a type, create a new struct SID.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-29 20:03:21 +08:00
Sean Cross
19222c34a9
kernel: get shutdown and multi-clients working
...
THis now has proper authentication for tests.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-28 13:28:14 +08:00
Sean Cross
7258fc83b7
kernel: rework process creation
...
This now uses a system of access keys to associate processes with the
kernel.
This currently does not pass tests.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-27 21:44:50 +08:00
Sean Cross
ab7a56937c
create_process: rename from spawn_process
...
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-27 09:30:43 +08:00
Sean Cross
b9d211af3b
xous: begin adding a create_process() call
...
This will mimic the `create_thread()` call and will obviate our own
process-creation code.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-26 10:54:54 +08:00
Sean Cross
8242f1b53f
kernel: make server IDs 128 bits
...
This makes server IDs a full 128 bits, and changes the argument to
CreateServer from 32-bits to 128-bits.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-21 17:28:18 +08:00
Sean Cross
4130ce7bd1
kernel: fix threading and multiplexing issues
...
Connections weren't getting multiplexed correctly. As a result, they
would respond with the wrong message to a given thread.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-21 15:51:51 +08:00
Sean Cross
1a6b1160a3
syscall: move send_message into its own function
...
This breaks up the giant `handle()` function.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-21 09:44:16 +08:00
Sean Cross
42f95e6488
threading: get basic threading tests working
...
With this, we can now run two "threads" within one process.
Signed-off-by: Sean Cross <sean@xobs.io>
2020-07-16 12:23:09 +08:00