qword: Move mount to own header
This commit is contained in:
parent
8a10c316a3
commit
b377e3bdca
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
|
build
|
||||||
subprojects/cxxshim
|
subprojects/cxxshim
|
||||||
subprojects/frigg
|
subprojects/frigg
|
||||||
|
|
|
@ -650,21 +650,6 @@ int sys_setuid(uid_t uid) {
|
||||||
return ret;
|
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
|
#endif // MLIBC_BUILDING_RTDL
|
||||||
|
|
||||||
} // namespace mlibc
|
} // namespace mlibc
|
||||||
|
|
16
sysdeps/qword/generic/mount.cpp
Normal file
16
sysdeps/qword/generic/mount.cpp
Normal 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;
|
||||||
|
}
|
16
sysdeps/qword/include/qword/mount.h
Normal file
16
sysdeps/qword/include/qword/mount.h
Normal 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
|
|
@ -6,7 +6,8 @@ rtdl_sources += files(
|
||||||
libc_sources += files(
|
libc_sources += files(
|
||||||
'generic/entry.cpp',
|
'generic/entry.cpp',
|
||||||
'generic/generic.cpp',
|
'generic/generic.cpp',
|
||||||
'generic/memstats.cpp'
|
'generic/memstats.cpp',
|
||||||
|
'generic/mount.cpp'
|
||||||
)
|
)
|
||||||
|
|
||||||
if not no_headers
|
if not no_headers
|
||||||
|
@ -19,6 +20,7 @@ if not no_headers
|
||||||
)
|
)
|
||||||
install_headers(
|
install_headers(
|
||||||
'include/qword/memstats.h',
|
'include/qword/memstats.h',
|
||||||
|
'include/qword/mount.h',
|
||||||
subdir: 'qword'
|
subdir: 'qword'
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue