···77 -Wno-undef
8899CFLAGS_taskServer.o := -Dsemaphore_consume_ref_t=semaphore_t
1010+CFLAGS_thread_actServer.o := -Dthread_act_consume_ref_t=thread_act_t
10111112# If KERNELRELEASE is defined, we've been invoked from the
1213# kernel build system and can use its language.
···1819 servers/mach_host.o servers/clock.o \
1920 servers/task.o primitives/semaphore.o \
2021 mig/clockServer.o mig/mach_hostServer.o \
2121- mig/taskServer.o \
2222- mig/duct.o proc_entry.o
2222+ mig/taskServer.o mig/thread_actServer.o \
2323+ servers/thread_act.o \
2424+ mig/duct.o proc_entry.o bsd_ioctl.o
23252426# Otherwise we were called directly from the command
2527# line; invoke the kernel build system.
+10-1
lkm/api.h
···3939 NR_semaphore_wait_trap,
4040 NR_semaphore_wait_signal_trap,
4141 NR_semaphore_timedwait_signal_trap,
4242- NR_semaphore_timedwait_trap
4242+ NR_semaphore_timedwait_trap,
4343+ NR_bsd_ioctl_trap,
4444+ NR_thread_self_trap
4345};
44464547struct mach_port_mod_refs_args
···116118 unsigned int wait;
117119 unsigned int sec;
118120 unsigned int nsec;
121121+};
122122+123123+struct bsd_ioctl_args
124124+{
125125+ int fd;
126126+ unsigned long long request;
127127+ unsigned long long arg;
119128};
120129121130#endif
+35
lkm/bsd_ioctl.c
···11+/*
22+ * Darling Mach Linux Kernel Module
33+ * Copyright (C) 2015 Lubos Dolezel
44+ *
55+ * This program is free software; you can redistribute it and/or
66+ * modify it under the terms of the GNU General Public License
77+ * as published by the Free Software Foundation; either version 2
88+ * of the License, or (at your option) any later version.
99+ *
1010+ * This program is distributed in the hope that it will be useful,
1111+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1212+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313+ * GNU General Public License for more details.
1414+ *
1515+ * You should have received a copy of the GNU General Public License
1616+ * along with this program; if not, write to the Free Software
1717+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1818+ */
1919+2020+#include "bsd_ioctl.h"
2121+2222+void bsd_ioctl_xlate_socket(struct bsd_ioctl_args* args)
2323+{
2424+2525+}
2626+2727+void bsd_ioctl_xlate_tty(struct bsd_ioctl_args* args)
2828+{
2929+3030+}
3131+3232+void bsd_ioctl_xlate_pts(struct bsd_ioctl_args* args)
3333+{
3434+3535+}
+28
lkm/bsd_ioctl.h
···11+/*
22+ * Darling Mach Linux Kernel Module
33+ * Copyright (C) 2015 Lubos Dolezel
44+ *
55+ * This program is free software; you can redistribute it and/or
66+ * modify it under the terms of the GNU General Public License
77+ * as published by the Free Software Foundation; either version 2
88+ * of the License, or (at your option) any later version.
99+ *
1010+ * This program is distributed in the hope that it will be useful,
1111+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1212+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313+ * GNU General Public License for more details.
1414+ *
1515+ * You should have received a copy of the GNU General Public License
1616+ * along with this program; if not, write to the Free Software
1717+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1818+ */
1919+2020+#ifndef BSD_IOCTL_H
2121+#define BSD_IOCTL_H
2222+#include "api.h"
2323+2424+void bsd_ioctl_xlate_socket(struct bsd_ioctl_args* args);
2525+void bsd_ioctl_xlate_tty(struct bsd_ioctl_args* args);
2626+void bsd_ioctl_xlate_pts(struct bsd_ioctl_args* args);
2727+2828+#endif
···11+/*
22+ * Darling Mach Linux Kernel Module
33+ * Copyright (C) 2015 Lubos Dolezel
44+ *
55+ * This program is free software; you can redistribute it and/or
66+ * modify it under the terms of the GNU General Public License
77+ * as published by the Free Software Foundation; either version 2
88+ * of the License, or (at your option) any later version.
99+ *
1010+ * This program is distributed in the hope that it will be useful,
1111+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1212+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313+ * GNU General Public License for more details.
1414+ *
1515+ * You should have received a copy of the GNU General Public License
1616+ * along with this program; if not, write to the Free Software
1717+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1818+ */
1919+2020+#ifndef SERVER_THREAD_ACT_H
2121+#define SERVER_THREAD_ACT_H
2222+#include "../ipc_types.h"
2323+2424+void ipc_port_make_thread(darling_mach_port_t* port);
2525+pid_t get_thread_pid(darling_mach_port_t* port);
2626+2727+#endif