瀏覽代碼

unified LinIoctl

Alexander Shiryaev 8 年之前
父節點
當前提交
4984f30fe9

+ 5 - 8
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ → BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ

@@ -1,17 +1,14 @@
-MODULE LinIoctl ["libc.so.6"];
+MODULE LinIoctl ["libc.so%%libver%%"];
 
 	(*
-		A. V. Shiryaev, 2012.11
-
-		GNU/Linux
-		i386
+		%%osname%%
+		%%machine%%
 	*)
 
 	CONST
-		(* /usr/include/i386-linux-gnu/bits/ioctl-types.h *)
-%%defs-ioctl1%%
+%%defs-tiocm%%
 %%defs-ioctl%%
 	PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
 	PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
 
-END LinIoctl.
+END LinIoctl.

+ 4 - 4
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Makefile → BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/Makefile

@@ -9,16 +9,16 @@ INCDIR ?= /usr/include
 all: mkioctl Ioctl.txt
 
 PY = python2.7
-DEFS = defs-ttycom defs-ioctl
+DEFS = defs-tiocm defs-ioctl
 
 defs-ioctl: mkioctl
 	./mkioctl > ${.TARGET}
 
-Ioctl.txt: Ioctl.txt.templ ${DEFS}
+Ioctl.txt: Ioctl.txt.templ ${DEFS} libver osname machine
 	${PY} ./untempl.py Ioctl.txt.templ ${.TARGET}
 
-defs-ttycom:
-	./dumpdefs.py 3 1 s ${INCDIR}/sys/ttycom.h | grep TIOCM_ > ${.TARGET}
+defs-tiocm:
+	./dumpdefs.py 2 1 s ${INCDIR}/sys/ttycom.h | grep TIOCM_ > ${.TARGET}
 
 clean:
 	rm -f mkioctl Ioctl.txt ${DEFS}

+ 0 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/mkioctl.c → BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/mkioctl.c


+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/dumpdefs.py

@@ -0,0 +1 @@
+../gen-Libc/dumpdefs.py

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/libver

@@ -0,0 +1 @@
+.7

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/machine

@@ -0,0 +1 @@
+i386

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/osname

@@ -0,0 +1 @@
+FreeBSD 11.0

+ 1 - 0
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/untempl.py

@@ -0,0 +1 @@
+../gen-Libc/untempl.py

+ 3 - 3
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Makefile

@@ -9,15 +9,15 @@ INCDIR ?= /usr/include
 all: mkioctl Ioctl.txt
 
 PY = python2.7
-DEFS = defs-ioctl1 defs-ioctl
+DEFS = defs-tiocm defs-ioctl
 
 defs-ioctl: mkioctl
 	./mkioctl > $@
 
-Ioctl.txt: Ioctl.txt.templ ${DEFS}
+Ioctl.txt: Ioctl.txt.templ ${DEFS} libver osname machine
 	${PY} ./untempl.py Ioctl.txt.templ $@
 
-defs-ioctl1:
+defs-tiocm:
 	./dumpdefs.py 3 0 s ${INCDIR}/i386-linux-gnu/bits/ioctl-types.h | grep TIOCM_ > $@
 
 clean:

+ 1 - 0
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/libver

@@ -0,0 +1 @@
+.6

+ 1 - 0
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/machine

@@ -0,0 +1 @@
+i386

+ 1 - 0
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/osname

@@ -0,0 +1 @@
+GNU/Linux

+ 12 - 15
BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt

@@ -1,23 +1,20 @@
 MODULE LinIoctl ["libc.so.89.2"];
 
 	(*
-		A. V. Shiryaev, 2012.11, 2013.08, 2015.09
-
-		OpenBSD 5.8
-		32-bit
+		OpenBSD 6.0
+		i386
 	*)
 
 	CONST
-		(* /usr/include/sys/ttycom.h *)
-			TIOCM_LE* = {0}; (* line enable *)
-			TIOCM_DTR* = {1}; (* data terminal ready *)
-			TIOCM_RTS* = {2}; (* request to send *)
-			TIOCM_ST* = {3}; (* secondary transmit *)
-			TIOCM_SR* = {4}; (* secondary receive *)
-			TIOCM_CTS* = {5}; (* clear to send *)
-			TIOCM_CAR* = {6}; (* carrier detect *)
-			TIOCM_RNG* = {7}; (* ring *)
-			TIOCM_DSR* = {8}; (* data set ready *)
+		TIOCM_LE* = {0}; (* line enable *)
+		TIOCM_DTR* = {1}; (* data terminal ready *)
+		TIOCM_RTS* = {2}; (* request to send *)
+		TIOCM_ST* = {3}; (* secondary transmit *)
+		TIOCM_SR* = {4}; (* secondary receive *)
+		TIOCM_CTS* = {5}; (* clear to send *)
+		TIOCM_CAR* = {6}; (* carrier detect *)
+		TIOCM_RNG* = {7}; (* ring *)
+		TIOCM_DSR* = {8}; (* data set ready *)
 
 		FIOCLEX* = 536897025;
 		FIONCLEX* = 536897026;
@@ -43,4 +40,4 @@ MODULE LinIoctl ["libc.so.89.2"];
 	PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
 	PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
 
-END LinIoctl.
+END LinIoctl.

+ 0 - 17
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ

@@ -1,17 +0,0 @@
-MODULE LinIoctl ["libc.so.89.2"];
-
-	(*
-		A. V. Shiryaev, 2012.11, 2013.08, 2015.09
-
-		OpenBSD 5.8
-		32-bit
-	*)
-
-	CONST
-		(* /usr/include/sys/ttycom.h *)
-%%defs-ttycom%%
-%%defs-ioctl%%
-	PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
-	PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
-
-END LinIoctl.

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver

@@ -0,0 +1 @@
+.89.2

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/machine

@@ -0,0 +1 @@
+i386

+ 1 - 0
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname

@@ -0,0 +1 @@
+OpenBSD 6.0