Message type for VFS_MAPDRIVER

Change-Id: I979a8769b72cd06efbedf0c6735ac3cd0c4dd2e3
This commit is contained in:
Lionel Sambuc 2014-05-12 13:03:55 +02:00
parent 6fb0c605fd
commit feb9b541da
4 changed files with 16 additions and 11 deletions

View file

@ -232,11 +232,6 @@
#define NR_VFS_CALLS 49 /* highest number from base plus one */
/* Field names for the mapdriver(2) call. */
#define VFS_MAPDRIVER_MAJOR m1_i1 /* devmajor_t */
#define VFS_MAPDRIVER_LABELLEN m1_i2 /* size_t */
#define VFS_MAPDRIVER_LABEL m1_p1 /* char * */
/* Field names for the fsync(2) call. */
#define VFS_FSYNC_FD m1_i1 /* int */

View file

@ -229,6 +229,15 @@ typedef struct {
} mess_lsys_vfs_copyfd;
_ASSERT_MSG_SIZE(mess_lsys_vfs_copyfd);
typedef struct {
devmajor_t major;
size_t labellen;
vir_bytes label;
uint8_t padding[44];
} mess_lsys_vfs_mapdriver;
_ASSERT_MSG_SIZE(mess_lsys_vfs_mapdriver);
typedef struct {
dev_t device;
off_t seek_pos;
@ -689,6 +698,7 @@ typedef struct {
mess_lsys_vfs_checkperms m_lsys_vfs_checkperms;
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver;
mess_vfs_fs_breadwrite m_vfs_fs_breadwrite;
mess_vfs_fs_chmod m_vfs_fs_chmod;

View file

@ -9,9 +9,9 @@ mapdriver(char *label, devmajor_t major)
message m;
memset(&m, 0, sizeof(m));
m.VFS_MAPDRIVER_LABEL = label;
m.VFS_MAPDRIVER_LABELLEN = strlen(label) + 1;
m.VFS_MAPDRIVER_MAJOR = major;
m.m_lsys_vfs_mapdriver.label = (vir_bytes)label;
m.m_lsys_vfs_mapdriver.labellen = strlen(label) + 1;
m.m_lsys_vfs_mapdriver.major = major;
return _taskcall(VFS_PROC_NR, VFS_MAPDRIVER, &m);
}

View file

@ -120,9 +120,9 @@ int do_mapdriver(void)
/* Only RS can map drivers. */
if (who_e != RS_PROC_NR) return(EPERM);
label_vir = (vir_bytes) job_m_in.VFS_MAPDRIVER_LABEL;
label_len = (size_t) job_m_in.VFS_MAPDRIVER_LABELLEN;
major = job_m_in.VFS_MAPDRIVER_MAJOR;
label_vir = job_m_in.m_lsys_vfs_mapdriver.label;
label_len = job_m_in.m_lsys_vfs_mapdriver.labellen;
major = job_m_in.m_lsys_vfs_mapdriver.major;
/* Get the label */
if (label_len > sizeof(label)) { /* Can we store this label? */