diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-14 21:28:26 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-14 21:28:26 -0400 |
commit | eb92e07911b148e626fadd63ccd04af6a6c24484 (patch) | |
tree | 8a90afd0e330676ee3c50cec9d5fe89284e06569 /src | |
parent | 9d3b3b602fc20246dda2a29c0926babbf1ea7fcd (diff) |
libc: Add DMS I/O syscall interface
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/src/l5/dms.c | 45 | ||||
-rw-r--r-- | src/sys/include/sys/dms.h | 7 |
2 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/libc/src/l5/dms.c b/src/lib/libc/src/l5/dms.c new file mode 100644 index 0000000..b6acb77 --- /dev/null +++ b/src/lib/libc/src/l5/dms.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025 Ian Marco Moffett and L5 engineers + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <sys/syscall.h> +#include <sys/dms.h> +#include <errno.h> + +ssize_t +dms_mux(struct dms_frame *dfp) +{ + if (dfp == NULL) { + return -EINVAL; + } + + return syscall( + SYS_dmsio, + (uintptr_t)dfp + ); +} diff --git a/src/sys/include/sys/dms.h b/src/sys/include/sys/dms.h index 7d80c33..b4d291d 100644 --- a/src/sys/include/sys/dms.h +++ b/src/sys/include/sys/dms.h @@ -57,4 +57,11 @@ struct dms_frame { size_t len; }; +/* + * Perform I/O on a specific disk + * + * @dfp: DMS frame + */ +ssize_t dms_mux(struct dms_frame *dfp); + #endif /* !_SYS_DMS_H_ */ |