1.1 --- a/examples/dataspace.idl Fri Dec 02 23:27:20 2022 +0100
1.2 +++ b/examples/dataspace.idl Fri Dec 02 23:41:25 2022 +0100
1.3 @@ -1,43 +1,39 @@
1.4 #include <l4/re/protocols.h> /* L4RE_PROTO_DATASPACE */
1.5 +#include <systypes/base.h> /* map_address_t, offset_t */
1.6
1.7 /* A dataspace interface. */
1.8
1.9 [protocol(L4RE_PROTO_DATASPACE)]
1.10 interface Dataspace
1.11 {
1.12 - /* Map memory within a dataspace. */
1.13 + /* Map memory within a dataspace.
1.14 + NOTE: Using opcode_type to work around L4Re dataspace IPC issues. In
1.15 + principle, this workaround is unnecessary for AMD64 and MIPS32
1.16 + because even in the latter case, the opcode will be followed by the
1.17 + 64-bit offset aligned to a 64-bit boundary. Here, both the structure
1.18 + used to interpret the message and the L4Re RPC framework agree.
1.19 + However, on IA32, the "alignment requirement" of the 64-bit offset is
1.20 + actually only 32 bits, meaning that the offset structure member will
1.21 + immediately follow the opcode, but the L4Re RPC framework seems to
1.22 + observe a different alignment regime. */
1.23
1.24 - [opcode(0)] void map(in unsigned long offset, in l4_addr_t hot_spot,
1.25 - in unsigned long flags, out fpage region);
1.26 + [opcode(0),opcode_type(l4_uint64_t)] void map(in offset_t offset, in map_address_t hot_spot,
1.27 + in map_flags_t flags, out fpage region);
1.28
1.29 /* Clear a dataspace. */
1.30
1.31 - [opcode(1)] void clear(in l4_addr_t offset, in unsigned long size);
1.32 + [opcode(1)] void clear(in offset_t offset, in offset_t size);
1.33
1.34 /* Obtain statistics about a dataspace. */
1.35
1.36 - [opcode(2)] void info(out unsigned long size, out unsigned long flags);
1.37 + [opcode(2)] void info(out offset_t size, out map_flags_t flags);
1.38
1.39 /* Copy data between dataspaces. */
1.40
1.41 - [opcode(3)] void copy_in(in l4_addr_t dest_offset, in cap source,
1.42 - in l4_addr_t source_offset, in unsigned long size);
1.43 -
1.44 - /* Deprecated: take a reference to a dataspace. */
1.45 -
1.46 - [opcode(4)] void take();
1.47 -
1.48 - /* Deprecated: release a reference to a dataspace. */
1.49 -
1.50 - [opcode(5)] void release();
1.51 -
1.52 - /* Obtain the physical address of the given offset in a dataspace, along with
1.53 - the largest physically contiguous region at or after the address in the
1.54 - dataspace. */
1.55 -
1.56 - [opcode(6)] void phys(in l4_addr_t offset, out l4_addr_t address, out l4_size_t size);
1.57 + [opcode(3)] void copy_in(in offset_t dest_offset, in cap source,
1.58 + in offset_t source_offset, in offset_t size);
1.59
1.60 /* Allocate at least the given size at the given address in a dataspace. */
1.61
1.62 - [opcode(7)] void allocate(in l4_addr_t offset, in l4_size_t size);
1.63 + [opcode(6)] void allocate(in offset_t offset, in l4_size_t size);
1.64 };
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/examples/directory.idl Fri Dec 02 23:41:25 2022 +0100
2.3 @@ -0,0 +1,14 @@
2.4 +#include <systypes/base.h> /* object_flags_t, offset_t */
2.5 +
2.6 +/* An interface to a filesystem directory. */
2.7 +
2.8 +interface Directory
2.9 +{
2.10 + /* Obtain a file reference for reading directory entries. */
2.11 +
2.12 + [opcode(26)] void opendir(out offset_t size, out cap file,
2.13 + out object_flags_t object_flags);
2.14 +};
2.15 +
2.16 +/* vim: tabstop=2 expandtab shiftwidth=2
2.17 +*/
3.1 --- a/examples/directory_listing.idl Fri Dec 02 23:27:20 2022 +0100
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,15 +0,0 @@
3.4 -/* Signalling between a directory and a directory listing activity. */
3.5 -
3.6 -#include <sys/types.h> /* size_t */
3.7 -
3.8 -interface DirectoryListing
3.9 -{
3.10 - /* Terminate a directory listing activity. */
3.11 -
3.12 - [opcode(0)] void terminate();
3.13 -
3.14 - /* Read a directory listing entry. The actual entry is communicated via a
3.15 - mechanism established outside this interface. */
3.16 -
3.17 - [opcode(1)] void read(in size_t position, out size_t size);
3.18 -};
4.1 --- a/examples/directory_listing_private.idl Fri Dec 02 23:27:20 2022 +0100
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,17 +0,0 @@
4.4 -/* Signalling between a directory and a directory listing activity. This
4.5 - interface is used only by the server and features a read operation that is
4.6 - initiated and then completed later. */
4.7 -
4.8 -#include <sys/types.h> /* size_t */
4.9 -
4.10 -interface DirectoryListingPrivate
4.11 -{
4.12 - /* Terminate a directory listing activity. */
4.13 -
4.14 - [opcode(0)] void terminate();
4.15 -
4.16 - /* Read a directory listing entry. The actual entry is communicated via a
4.17 - mechanism established outside this interface. */
4.18 -
4.19 - [opcode(1), completion] void read(in size_t position, out size_t size);
4.20 -};
5.1 --- a/examples/file.idl Fri Dec 02 23:27:20 2022 +0100
5.2 +++ b/examples/file.idl Fri Dec 02 23:41:25 2022 +0100
5.3 @@ -1,15 +1,11 @@
5.4 -#include <sys/types.h> /* size_t */
5.5 +#include <systypes/base.h> /* offset_t */
5.6
5.7 /* An interface providing operations common to both unmapped and mapped files.
5.8 Other interfaces are used to specialise different kinds of files. */
5.9
5.10 interface File
5.11 {
5.12 - /* Flush data and update the size. */
5.13 -
5.14 - [opcode(5)] void flush(in size_t data_start, out size_t size);
5.15 + /* Resize the file. */
5.16
5.17 - /* Obtain a file metadata object. */
5.18 -
5.19 - [opcode(11)] void fstat(out size_t size, out cap statcap);
5.20 + [opcode(21)] void resize(inout offset_t size);
5.21 };
6.1 --- a/examples/filesystem.idl Fri Dec 02 23:27:20 2022 +0100
6.2 +++ b/examples/filesystem.idl Fri Dec 02 23:41:25 2022 +0100
6.3 @@ -1,4 +1,4 @@
6.4 -#include <systypes/base.h> /* sys_uid_t, sys_gid_t, sys_mode_t */
6.5 +#include <systypes/user.h> /* user_t */
6.6
6.7 /* An interface providing filesystem operations. */
6.8
6.9 @@ -6,6 +6,5 @@
6.10 {
6.11 /* Obtain filesystem access for the given user details. */
6.12
6.13 - [opcode(6)] void getuserfs(in sys_uid_t uid, in sys_gid_t gid,
6.14 - in sys_mode_t umask, out cap ref);
6.15 + [opcode(6)] void open_for_user(in user_t user, out cap opener);
6.16 };
7.1 --- a/examples/filesystem_factory.idl Fri Dec 02 23:27:20 2022 +0100
7.2 +++ b/examples/filesystem_factory.idl Fri Dec 02 23:41:25 2022 +0100
7.3 @@ -8,8 +8,9 @@
7.4 {
7.5 /* Obtain filesystem access for the given user details. */
7.6
7.7 - [opcode(6)] void getuserfs(in ipc_varg_sys_uid_t uid,
7.8 - in ipc_varg_sys_gid_t gid,
7.9 - in ipc_varg_sys_mode_t umask,
7.10 - out cap ref);
7.11 + [opcode(6),opcode_type(l4_umword_t)]
7.12 + void open_for_user(in ipc_varg_sys_uid_t uid,
7.13 + in ipc_varg_sys_gid_t gid,
7.14 + in ipc_varg_sys_mode_t umask,
7.15 + out cap opener);
7.16 };
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/examples/flush.idl Fri Dec 02 23:41:25 2022 +0100
8.3 @@ -0,0 +1,10 @@
8.4 +#include <systypes/base.h> /* offset_t */
8.5 +
8.6 +/* An interface providing a flush operation for files and pipes. */
8.7 +
8.8 +interface Flush
8.9 +{
8.10 + /* Flush data and update the size, if appropriate. */
8.11 +
8.12 + [opcode(5)] void flush(in offset_t populated_size, out offset_t size);
8.13 +};
9.1 --- a/examples/mapped_file.idl Fri Dec 02 23:27:20 2022 +0100
9.2 +++ b/examples/mapped_file.idl Fri Dec 02 23:41:25 2022 +0100
9.3 @@ -1,13 +1,15 @@
9.4 -#include <sys/types.h> /* size_t */
9.5 +#include <systypes/base.h> /* offset_t */
9.6
9.7 /* An interface providing operations specific to mapped files. */
9.8
9.9 interface MappedFile
9.10 {
9.11 - /* Memory-map a file for the given file position and length, obtaining the
9.12 - limits of the mapped region and the populated limit of the region. */
9.13 + /* Memory-map a file for the given file position and length, masking regions
9.14 + beyond any visible range if indicated, obtaining the limits of the mapped
9.15 + region and the size of the file. */
9.16
9.17 - [opcode(7)] void mmap(in size_t position, in size_t length,
9.18 - out size_t start_pos, out size_t end_pos,
9.19 - out size_t data_end);
9.20 + [opcode(7)] void mmap(in offset_t position, in offset_t length,
9.21 + in offset_t start_visible, in offset_t end_visible,
9.22 + out offset_t start_pos, out offset_t end_pos,
9.23 + out offset_t size);
9.24 };
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/examples/notification.idl Fri Dec 02 23:41:25 2022 +0100
10.3 @@ -0,0 +1,13 @@
10.4 +#include <systypes/base.h> /* notify_flags_t */
10.5 +
10.6 +interface Notification
10.7 +{
10.8 + /* Subscribe to events, providing the given notifier to receive notifications
10.9 + according to the given flags. */
10.10 +
10.11 + [opcode(23)] void subscribe(in cap notifier, in notify_flags_t flags);
10.12 +
10.13 + /* Unsubscribe from events. */
10.14 +
10.15 + [opcode(24)] void unsubscribe();
10.16 +};
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/examples/notifier.idl Fri Dec 02 23:41:25 2022 +0100
11.3 @@ -0,0 +1,8 @@
11.4 +#include <systypes/base.h> /* notify_flags_t */
11.5 +
11.6 +interface Notifier
11.7 +{
11.8 + /* Send notification events. */
11.9 +
11.10 + [opcode(25)] void notify(in notify_flags_t flags);
11.11 +};
12.1 --- a/examples/opener_context.idl Fri Dec 02 23:27:20 2022 +0100
12.2 +++ b/examples/opener_context.idl Fri Dec 02 23:41:25 2022 +0100
12.3 @@ -1,7 +1,8 @@
12.4 -#include <sys/types.h> /* size_t */
12.5 +#include <systypes/base.h> /* flags_t, object_flags_t, offset_t */
12.6
12.7 -/* An interface providing a way of opening filesystem objects relying on a
12.8 - dataspace. */
12.9 +/* An interface providing a way of opening or manipulating filesystem objects
12.10 + relying on a dataspace to transfer filesystem paths specifying the objects
12.11 + involved. */
12.12
12.13 interface OpenerContext
12.14 {
12.15 @@ -14,7 +15,29 @@
12.16
12.17 [opcode(1)] void getfs(out cap fs);
12.18
12.19 - /* Obtain a file reference given a path written to the dataspace. */
12.20 + /* Make a new directory given a path written to the context's dataspace. */
12.21 +
12.22 + [opcode(18)] void mkdir(in sys_mode_t mode);
12.23 +
12.24 + /* Obtain a file reference given a path written to the context's dataspace. */
12.25 +
12.26 + [opcode(12)] void open(in flags_t flags, out offset_t size, out cap file,
12.27 + out object_flags_t object_flags);
12.28 +
12.29 + /* Remove a file using a path written to the context's dataspace. */
12.30 +
12.31 + [opcode(14)] void remove();
12.32
12.33 - [opcode(12)] void open(in int flags, out size_t size, out cap file);
12.34 + /* Rename a file within a filesystem using paths written to the context's
12.35 + dataspace. */
12.36 +
12.37 + [opcode(15)] void rename();
12.38 +
12.39 + /* Obtain file metadata given a path written to the context's dataspace,
12.40 + writing the metadata to the dataspace. */
12.41 +
12.42 + [opcode(11)] void stat();
12.43 };
12.44 +
12.45 +/* vim: tabstop=2 expandtab shiftwidth=2
12.46 +*/
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/examples/pipe.idl Fri Dec 02 23:41:25 2022 +0100
13.3 @@ -0,0 +1,19 @@
13.4 +#include <systypes/base.h> /* offset_t */
13.5 +
13.6 +/* A pipe interface providing access to shared memory. */
13.7 +
13.8 +interface Pipe
13.9 +{
13.10 + /* Obtain details of the current region of shared memory. */
13.11 +
13.12 + [opcode(16)] void current_region(out offset_t populated_size, out offset_t size);
13.13 +
13.14 + /* Advance to the next region of shared memory, indicating and obtaining the
13.15 + populated limit of the region and obtaining the region size. */
13.16 +
13.17 + [opcode(17)] void next_region(inout offset_t populated_size, out offset_t size);
13.18 +
13.19 + /* Return whether the pipe is closed or partly closed. */
13.20 +
13.21 + [opcode(22)] void closed(out int closed);
13.22 +};
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/examples/pipe_opener.idl Fri Dec 02 23:41:25 2022 +0100
14.3 @@ -0,0 +1,11 @@
14.4 +#include <systypes/base.h> /* offset_t */
14.5 +
14.6 +/* An interface providing pipe-opening support. */
14.7 +
14.8 +interface PipeOpener
14.9 +{
14.10 + /* Obtain a pipe for communication between two endpoints, indicating a region
14.11 + size for each section of a pipe. */
14.12 +
14.13 + [opcode(20)] void pipe(in offset_t size, out cap reader, out cap writer);
14.14 +};
15.1 --- a/examples/queue.idl Fri Dec 02 23:27:20 2022 +0100
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,18 +0,0 @@
15.4 -interface Queue
15.5 -{
15.6 - /* Join a queue, providing a capability for notification. */
15.7 -
15.8 - [opcode(0), completion] void join(in cap user);
15.9 -
15.10 - /* Join the front of the queue, providing a capability for notification. */
15.11 -
15.12 - [opcode(3), completion] void join_first(in cap user);
15.13 -
15.14 - /* Leave a queue. */
15.15 -
15.16 - [opcode(2)] void leave();
15.17 -
15.18 - /* Yield to other members of the queue. */
15.19 -
15.20 - [opcode(1), completion] void yield();
15.21 -};
16.1 --- a/examples/region_mapper.idl Fri Dec 02 23:27:20 2022 +0100
16.2 +++ b/examples/region_mapper.idl Fri Dec 02 23:41:25 2022 +0100
16.3 @@ -1,4 +1,5 @@
16.4 #include <l4/re/protocols.h> /* L4RE_PROTO_RM */
16.5 +#include <systypes/base.h> /* address_t */
16.6
16.7 /* A region mapper/manager interface. */
16.8
16.9 @@ -8,38 +9,38 @@
16.10 /* Attach the memory associated with a dataspace, employing the given start
16.11 address to search for a suitable address for the region. */
16.12
16.13 - [opcode(0)] void attach(inout l4_addr_t start, in unsigned long size,
16.14 - in unsigned long flags, in cap ds,
16.15 - in l4_addr_t offset, in unsigned char align);
16.16 + [opcode(0)] void attach(inout address_t start, in address_t size,
16.17 + in map_flags_t flags, in cap ds,
16.18 + in address_t offset, in unsigned char align);
16.19
16.20 /* Detach memory from the task, searching from the given address for a region
16.21 of the given size. Return the start address, region size and dataspace. */
16.22
16.23 - [opcode(1)] void detach(in l4_addr_t addr, in unsigned long size,
16.24 - in unsigned long flags, out l4_addr_t start,
16.25 - out unsigned long rsize, out cap ds);
16.26 + [opcode(1)] void detach(in address_t addr, in address_t size,
16.27 + in map_flags_t flags, out address_t start,
16.28 + out address_t rsize, out cap ds);
16.29
16.30 /* Find a region starting from the given address and having the given size.
16.31 Return the start address, region size and dataspace. */
16.32
16.33 - [opcode(2)] void find(inout l4_addr_t addr, inout unsigned long size,
16.34 - out unsigned long flags, out l4_addr_t offset,
16.35 + [opcode(2)] void find(inout address_t addr, inout address_t size,
16.36 + out map_flags_t flags, out address_t offset,
16.37 out cap ds);
16.38
16.39 /* Reserve an area in the region map. */
16.40
16.41 - [opcode(3)] void reserve_area(inout l4_addr_t start, in unsigned long size,
16.42 - in unsigned long flags, in unsigned char align);
16.43 + [opcode(3)] void reserve_area(inout address_t start, in address_t size,
16.44 + in map_flags_t flags, in unsigned char align);
16.45
16.46 /* Free (or unreserve) an area in the region map. */
16.47
16.48 - [opcode(4)] void free_area(in l4_addr_t addr);
16.49 + [opcode(4)] void free_area(in address_t addr);
16.50
16.51 /* Currently not fully supported by the interface generator...
16.52
16.53 - [opcode(5)] void get_regions(in l4_addr_t start, out Region[] regions);
16.54 + [opcode(5)] void get_regions(in address_t start, out Region[] regions);
16.55
16.56 - [opcode(6)] void get_areas(in l4_addr_t start, out Area[] areas);
16.57 + [opcode(6)] void get_areas(in address_t start, out Area[] areas);
16.58
16.59 See pkg/l4re-core/l4re/include/rm for the Region and Area structures. */
16.60 };
17.1 --- a/examples/sync.idl Fri Dec 02 23:27:20 2022 +0100
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,20 +0,0 @@
17.4 -#include <sys/types.h> /* size_t */
17.5 -
17.6 -interface Sync
17.7 -{
17.8 - /* Wait for other users of a file, updating the size. */
17.9 -
17.10 - [opcode(10)] void begin(out size_t size);
17.11 -
17.12 - /* Wait for other users of a file as the first user, updating the size. */
17.13 -
17.14 - [opcode(15)] void begin_first(out size_t size);
17.15 -
17.16 - /* Yield to other users of a file, updating the size. */
17.17 -
17.18 - [opcode(9)] void yield(out size_t size);
17.19 -
17.20 - /* Notify other users of a resource. */
17.21 -
17.22 - [opcode(14)] void end();
17.23 -};
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/examples/system_pager.idl Fri Dec 02 23:41:25 2022 +0100
18.3 @@ -0,0 +1,19 @@
18.4 +#include <l4/sys/types.h> /* L4_PROTO_EXCEPTION, L4_PROTO_PAGE_FAULT */
18.5 +#include <l4/sys/utcb.h> /* l4_exc_regs_t */
18.6 +
18.7 +/* A system pager interface. */
18.8 +
18.9 +interface SystemPager
18.10 +{
18.11 + /* Handle an exception involving the given register values, returning a
18.12 + flexpage to remedy the exception. */
18.13 +
18.14 + [opcode(L4_PROTO_EXCEPTION)]
18.15 + void exception(in l4_exc_regs_t regs, out fpage region);
18.16 +
18.17 + /* Handle a page fault involving the given page fault address and program
18.18 + counter, returning a flexpage to provide such a mapping. */
18.19 +
18.20 + [opcode(L4_PROTO_PAGE_FAULT)]
18.21 + void page_fault(in l4_umword_t pfa, in l4_umword_t pc, out fpage region);
18.22 +};
19.1 --- a/examples/unmapped_file.idl Fri Dec 02 23:27:20 2022 +0100
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,18 +0,0 @@
19.4 -#include <sys/types.h> /* size_t */
19.5 -
19.6 -/* An interface providing operations specific to unmapped files. For such files,
19.7 - access to the content occurs via explicit operations. */
19.8 -
19.9 -interface UnmappedFile
19.10 -{
19.11 - /* Read data from the given file position, obtaining the populated data
19.12 - limit. */
19.13 -
19.14 - [opcode(3)] void read(in size_t position, out size_t data_end);
19.15 -
19.16 - /* Write data at the given file position, updating the writing position within
19.17 - the data and obtaining the size. */
19.18 -
19.19 - [opcode(4)] void write(in size_t position, inout size_t data_start,
19.20 - out size_t size);
19.21 -};