[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH 10/10] doc: add section about syscall shim layer



Hey,

please also add information here about how errno is handled and what is expected as return value.

Thanks,

Simon

On 04.06.19 18:28, Yuri Volchkov wrote:
Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
  doc/guides/developers-app.rst | 36 +++++++++++++++++++++++++++++++++++
  1 file changed, 36 insertions(+)

diff --git a/doc/guides/developers-app.rst b/doc/guides/developers-app.rst
index bbd3bbda..23389152 100644
--- a/doc/guides/developers-app.rst
+++ b/doc/guides/developers-app.rst
@@ -323,6 +323,42 @@ An example context of extra.ld: ::
This will add the section .uk_fs_list after the .text +============================
+Syscall shim layer
+============================
+
+If you library provides a syscall, you need to inform Unikraft that it
+can use your implementation. Add a line in you Makefile.uk: ::
+
+    UK_PROVIDED_SYSCALLS-$(CONFIG_LIBYOURLIBNAME) += 
<syscall_name>-<number_of_arguments>
+
+Where `<number_of_arguments>` is how many arguments your syscall accepts.
+
+For example: ::
+
+    UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += writev-3
+
+.. note:: Please consult corresponding man page in order to keep API
+           matching to the equivalent linux syscall
+
+For the implementation of you syscall use the following template:
+
+.. code-block:: c
+
+  UK_SYSCALL_DEFINE(syscall_name, arg1_type, arg1_name, arg2_type, arg2_name, 
..)
+  {
+       do_cool_stuff();
+  }
+
+For example:
+
+.. code-block:: c
+
+  UK_SYSCALL_DEFINE(writev, unsigned long, fd, const struct iovec *, vec,
+                 unsigned long, vlen)
+  {
+       pwritev(fd, vec, vlen, -1);
+  }
============================
  Make Targets


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.