qword: Move mount to own header

This commit is contained in:
mintsuki 2019-12-29 09:33:35 +01:00
parent 8a10c316a3
commit b377e3bdca
5 changed files with 36 additions and 16 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
build
subprojects/cxxshim
subprojects/frigg

View file

@ -650,21 +650,6 @@ int sys_setuid(uid_t uid) {
return ret;
}
int sys_mount(const char *source, const char *target,
const char *filesystemtype, unsigned long mountflags,
const void *data) {
int ret;
register unsigned long arg4_reg asm("r10") = mountflags;
register const void *arg5_reg asm("r8") = data;
asm volatile ("syscall" : "=a" (ret)
: "a"(41), "D"(source), "S"(target),
"d"(filesystemtype), "r"(arg4_reg), "r"(arg5_reg)
: "rcx", "r11");
return ret;
}
#endif // MLIBC_BUILDING_RTDL
} // namespace mlibc

View file

@ -0,0 +1,16 @@
#include <qword/mount.h>
int mount(const char *source, const char *target,
const char *filesystemtype, unsigned long mountflags,
const void *data) {
int ret;
register unsigned long arg4_reg asm("r10") = mountflags;
register const void *arg5_reg asm("r8") = data;
asm volatile ("syscall" : "=a" (ret)
: "a"(41), "D"(source), "S"(target),
"d"(filesystemtype), "r"(arg4_reg), "r"(arg5_reg)
: "rcx", "r11");
return ret;
}

View file

@ -0,0 +1,16 @@
#ifndef _QWORD_MOUNT_H
#define _QWORD_MOUNT_H
#ifdef __cplusplus
extern "C" {
#endif
int mount(const char *source, const char *target,
const char *filesystemtype, unsigned long mountflags,
const void *data);
#ifdef __cplusplus
}
#endif
#endif // _QWORD_MOUNT_H

View file

@ -6,7 +6,8 @@ rtdl_sources += files(
libc_sources += files(
'generic/entry.cpp',
'generic/generic.cpp',
'generic/memstats.cpp'
'generic/memstats.cpp',
'generic/mount.cpp'
)
if not no_headers
@ -19,6 +20,7 @@ if not no_headers
)
install_headers(
'include/qword/memstats.h',
'include/qword/mount.h',
subdir: 'qword'
)
endif