diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 53e3c6104ce..a02064c6714 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20180921: ibcs removal +OLD_FILES+=usr/share/examples/ibcs2/hello.uu +OLD_FILES+=usr/share/examples/ibcs2/README +OLD_DIRS+=usr/share/examples/ibcs2 # 20180824: libbe(3) SHLIBDIR fixed to reflect correct location OLD_LIBS+=usr/lib/libbe.so.1 # 20180819: Remove deprecated arc4random(3) stir/addrandom interfaces diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index f18e1186a18..7c7caa5eaf6 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -251,8 +251,6 @@ .. hostapd .. - ibcs2 - .. indent .. ipfilter diff --git a/sbin/init/rc.conf b/sbin/init/rc.conf index ff69cc04f67..0fbd72059b3 100644 --- a/sbin/init/rc.conf +++ b/sbin/init/rc.conf @@ -624,8 +624,6 @@ quotaon_flags="-a" # Turn quotas on for all file systems (if enabled) quotaoff_flags="-a" # Turn quotas off for all file systems at shutdown quotacheck_flags="-a" # Check all file system quotas (if enabled) accounting_enable="NO" # Turn on process accounting (or NO). -ibcs2_enable="NO" # Ibcs2 (SCO) emulation loaded at startup (or NO). -ibcs2_loaders="coff" # List of additional Ibcs2 loaders (or NO). firstboot_sentinel="/firstboot" # Scripts with "firstboot" keyword are run if # this file exists. Should be on a R/W filesystem so # the file can be deleted after the boot completes. diff --git a/sbin/init/rc.d/archdep b/sbin/init/rc.d/archdep index 157df8bb569..52a7ac684ee 100755 --- a/sbin/init/rc.d/archdep +++ b/sbin/init/rc.d/archdep @@ -19,25 +19,6 @@ archdep_start() _arch=`${SYSCTL_N} hw.machine_arch` case $_arch in - i386) - # SCO binary emulation - # - if checkyesno ibcs2_enable; then - echo -n 'Initial i386 initialization:' - echo -n ' ibcs2' - load_kld ibcs2 - case ${ibcs2_loaders} in - [Nn][Oo]) - ;; - *) - for i in ${ibcs2_loaders}; do - load_kld ibcs2_$i - done - ;; - esac - echo '.' - fi - ;; esac } diff --git a/share/examples/Makefile b/share/examples/Makefile index 6b58daf5310..1de97997c22 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -16,7 +16,6 @@ LDIRS= BSD_daemon \ drivers \ etc \ find_interface \ - ibcs2 \ indent \ ipfw \ jails \ @@ -99,11 +98,6 @@ SE_FIND_INTERFACE= \ README \ find_interface.c -SE_DIRS+= ibcs2 -SE_IBCS2= \ - README \ - hello.uu - SE_DIRS+= indent SE_INDENT= indent.pro diff --git a/share/examples/ibcs2/README b/share/examples/ibcs2/README deleted file mode 100644 index 73e9281946a..00000000000 --- a/share/examples/ibcs2/README +++ /dev/null @@ -1,3 +0,0 @@ -Here is a small hello world type program in iBCS2 coff format. -You must uudecode it first to run it under the FreeBSD iBCS support. - diff --git a/share/examples/ibcs2/hello.uu b/share/examples/ibcs2/hello.uu deleted file mode 100644 index a4b091af83b..00000000000 --- a/share/examples/ibcs2/hello.uu +++ /dev/null @@ -1,677 +0,0 @@ -begin 755 hello_world -M3`$$`'.D"RXT2@``9@(``!P``P$+`0``/#0``)P4```H#```U````-`````, -M!4``+G1E>'0```#0````T````#PT``#0````````````````````(````"YD -M871A````#`5```P%0`"<%```##4``````````````````$`````N8G-S```` -M`*@90`"H&4``*`P```````````````````````"`````+F-O;6UE;G0````` -M`````(P```"H20````````````````````(``,.0D)"#[`B+[(M%"(U4A1") -M%0T%0`!2C54,4E#HW____V@,!4``:@'H/P@``(/$",<%"!E```````#H&0`` -M`(/$#%#H0#,``&H`N`$```":``````<`],-5B^R![`````!35U9H%`5``&AP -M%$``Z"T-``"#Q`AH*`5``&A@%$``Z!L-``"#Q`A>7UO)PY"0D%6+[(/L"%=6 -M:BIJ`/]U#.@P,@``@\0,,_;K59"#_PY](XM%#&O.#@/!BTT(_T4(B@F(##A' -MBT4(#[8`]H"U$$``!W78BT4(@#@`=0@SP%Y?R<.0D(O&"\!T"H/X`70UZR20 -MD)"+10C_10B`.%]U#4:#_@-]+S/_Z[R0D)"+10B`>/\N=`NX`0```%Y?R<.0 -MD$;KW)"+10C_10B`."YTT.ODD)"07E_)PU6+[(/L!%=6,_;K)6O&#HOXBT4( -M@#PX`'46:@Z+10P#QU"+10@#QU#H'PT``(/$#$:#_@-\UEY?R<.0D%6+[&H1 -M:.0'0`!J`NCC,0``@\0,_W4,Z,`Q``"#Q`10_W4,:@+HRC$``(/$#&H":/@' -M0`!J`NBY,0``@\0,BT4(@^@!@_@'#X>_````+O\DA5P#``"0D)#'10S\!T`` -M_W4,Z'4Q``"#Q`10_W4,:@+H?S$``(/$#&HB:`0(0`!J`NAN,0``@\0,Z:H` -M``"0D&H/:"@(0`!J`NA6,0``@\0,:A%H/`5``.O5D)!J`V@X"$``:@+H.C$` -M`(/$#&H%:%`%0`!J`N@I,0``@\0,:@EH/`A``.O`D&H%:%`%0`!J`N@.,0`` -M@\0,:A%H2`A``.NED)!J%VA<"$``ZX*0D)!J$VAT"$``Z7/___]J#6B("$`` -MZ6?___^C`@``G`(``-0"``#P`@``'`,``#@#``!$`P``1`,``&H!:)8(0`!J -M`NBN,```R<-5B^R#[#1HF`A``/]U".A5"P``@\0("\!U!\=%"%`'0`#_=1#_ -M=0CHJ/W__X/$"`O`=`FX`0```,G#D)"+11"`.`!T$(!X#@!T"H!X'``/A3X" -M``#_=0SHJ`L``(/$!(E%_`O`=#&-1=!0_W7\Z&+]__^#Q`@+P'0/_W4,:@'H -M-?[__^L/D)"0C4704/]U$.CH_?__@\0(BT40@#@`=!"`>`X`=`J`>!P`#X7C -M`0``:)P(0`#H2PL``(/$!(E%_`O`=#"-1=!0_W7\Z`7]__^#Q`@+P'0._W4, -M:@+HV/W__^L.D)"-1=!0_W40Z(S]__^#Q`B+11"`.`!T$(!X#@!T"H!X'``/ -MA8 -M`'3B@'WL`'30D+@! -M````"\!T=HM%$(!X#@!T'HU%WE"+11"#P`Y0Z(X)``"#Q`B#^`$;P/?8ZP>0 -MD+@!````"\!T1HM%$(!X'`!T'HU%[%"+11"#P!Q0Z%X)``"#Q`B#^`$;P/?8 -MZP>0D+@!````"\!T%HU%T%#_=1#H3_S__X/$",=%S`$```"#?R#??0`=3*! -M??"H&4``=04SP,G#D&H`_W7X_S5D!T``Z!@*``"#Q`R#??0`=)"+1>P#1?#) -MPY"0D(M%_,8``(M%_"M%\$`!1?C_=>S_=?#_=0CHE@D``(/$#`O`=+?_3?2+ -M1?Q`B47PZ7?___]5B^R![(0```!6C46(4&M%"$C_L%P%0`#_=0SH+/S__X/$ -M#`O`=`4SP%[)PVBD"$``C46T4.@""@``@\0(QT6``````.LMD)!HL@A``(U% -MM%#HM@D``(/$"&H.:T6`#HU$!8A0C46T4.A7"```@\0,_T6`@WV``WS/:+0( -M0`"-1;10Z(4)``"#Q`AK10A(_["P`````QT7X`0`` -M`,8%J!I```"#?0P`#X7%````@WT(`0^%AP```#/VZV>0D)"XJ!I``%Y?R<.0 -MD)!HO`A``&BH&D``Z+T'``"#Q`AKQD@%8`5``%!HJ!I``.BG!P``@\0(:\9( -MB_B#OZ0%0```="$%J`5``%"+QP5@!4``4.@K!0``@\0("\!T!\=%^`````!& -M:\9(@[A7\G#D#/VZQUKQDB+^(M%"#F'6`5` -M`'4,B\<%8`5``%Y?R<.01FO&2(.X7`5```!UUS/`7E_)PY"#?0@!#X66```` -M:`X!``#_=0QHJ!I``.@0!0``@\0,Q@6V&T```(`]J!I``"]U$<=%^`````#' -M1?"I&D``ZPB0QT7\J!I``#/VZQ>0:@#_=?Q6Z,'\__^#Q`R)1>P+P'281H-] -M^`!U)(-]\`!T*HM%\(E%_&HO4.@8!```@\0(B47P"\!T!O]%\,8``&O&2(.X -M7`5```!UM(M%#%Y?R<.0,_;K`49KQDB#N%P%0```#X1$____:\9(BTT(.8A8 -M!4``=>%J`?]U#%;H2OS__X/$#%Y?R<.0D)!5B^Q6@7T(Z`,``'PKBT4(N>@# -M``"9]_F+\(/^!W\9BT4(F??Y4FO&2/^03`5``(/$!%[)PY"0D+B^"$``7LG# -M58OL@WT(`'4'N/_____)P_]U"&H!Z.+]__^#Q`@+P'3H,\#)PY"0D%6+[+B_ -M"$``R<.0D%6+[('LQ`,``&C$`P``C84\_/__4/]U".BG!0``@\0,/<0#``!] -M";@!````R<.0D`^_A3S\___1X`^_C3[\__^-!(B#P$0]Q`,``'_::,0#``"- -MA3S\__]0:,`(0`#HJ2<``(/$##/`R<.0D%6+[(/L$&H0C47P4/]U".A$!0`` -M@\0,@_@0?0BX`0```,G#D&H0C47P4&B$#$``Z&PG``"#Q`PSP,G#D%6+[(M% -M"`O`=`Z#^`%T$;B4#$``R<.0D+B$#$``R<.0N(P,0`#)PY!5B^R#[`AJ"(U% -M^%#_=0CHX`0``(/$#(/X"'T(N`$```#)PY!J"(U%^%!HF`Q``.@()P``@\0, -M,\#)PY!5B^R+10@+P'0*N*`,0`#)PY"0D+B8#$``R<.058OL@>Q8`@``5U9H -M5@(``(V%J/W__U#_=0CH?00``(/$##U6`@``?0NX`0```%Y?R<.0D+^D#$`` -MC;6H_?__N94```#RI6:E,\!>7\G#D)!5B^R+10B#^"IW62[_)(58#0``D`^_ -M!:0,0``%^@Q``,G#D)`/OP6F#$``Z^Z0D)`/OP6J#$``Z^*0D)`/OP6H#$`` -MZ]:0D)`/OP6L#$``Z\J0D)"+10@/OP1%I`Q``.NZD)"0N/P.0`#)PY``#0`` -M$`T``!P-```H#0``-`T``$`-``!`#0``0`T``$`-``!`#0``0`T``$`-``!` -M#0``0`T``$`-``!`#0``0`T``$`-``!`#0``0`T``$`-``!`#0``0`T``$`- -M``!`#0``0`T``$`-``!`#0``0`T``$`-``!`#0``0`T``$`-``!`#0``0`T` -M`$`-``!`#0``0`T``$`-``!`#0``0`T``$`-``!`#0``R<.0D%6+[(/L!&H" -MC47^4/]U".@<`P``@\0,@_@"?0BX`0```,G#D&:+1?YFHPP90``SP,G#D)!5 -MB^R+10@+P'0.@_@!=!W&!0`/0```ZPJ@#!E``*(`#T``N``/0`#)PY"0D*`- -M&4``Z^J058OL@^P(5HU%$(E%_(M%"/9`#`)U"O9`#(!T((!(#`+_=0C_=?S_ -M=0SHP@,``(/$#(OPBT4(]D`,('0(N/____]>R<.+QE[)PY"0D%:+="0(BE0D -M#*PZPG0CA,!T&ZPZPG0:A,!T$JPZPG01A,!T":PZPG0(A,!UW#/`7L.+QDA> -MPY"05U:+="0,BWPD$#O^=$"LKG5!A,!T.*RN=3F$P'0PK*YU,83`="BLKG4I -MA,!T(*RN=2&$P'08K*YU&83`=!"LKG41A,!T"*RN=0F$P'7`,\!>7\,/ML`/ -MME?_*\)>7\.05U:+?"00BTPD%#/`\JZ+T8O/BW0D$"O.BWPD#(O!P>D"\Z6+ -MR('A`P```/.DB\HSP/.JBT0D#%Y?PY"058OL@^P(4U=6BW4(BQT-!4``"]MU -M"C/`7E];R<.0D)"#.P!T\8/#!/]S_%;H#P```(/$"(OX"_]TYEY?6\G#D%6+ -M[%=6BW4(BWT,1XH&.$?_=0U&@'[_/77QB\=>7\G#@#X`=0:`?_\]=.\SP%Y? -MR<.0D)"+UU:+?"0(,\"Y______*N3XOWBWPD#(M,)!#RKN,!3XO/B_Z+="0, -M*\[SI(@/BT0D"%Z+^L.0D%6+[('L"`(``&@!`0``C87\_O__4/]U".C?```` -M@\0,/0$!``!\'F@!`0``C87X_?__4/]U".C!````@\0,/0$!``!]![@!```` -MR<-H`0$``(V%_/[__U!HM!!``.CB(@``@\0,:`$!``"-A?C]__]0:`0/0`#H -MR2(``(/$##/`R<.0D%=6BW0D#(M\)!`[_G0QBTPD%$%)="FLKG4JA,!T(4ET -M'JRN=1^$P'062703K*YU%(3`=`M)=`BLKG4)A,!UU#/`7E_##[;`#[97_RO" -M7E_#N!,```":``````<`#X(J(P``PY"X!0```)H`````!P`/@A8C``##D+@# -M````F@`````'``^"`B,``,.0B]=6BWPD"#/`N?_____RKD^+]XM\)`RY____ -M__*N]]&+_HMT)`SSI(M$)`A>B_K#5XO6BWPD##/`N?_____RKO?1BW0D#(M\ -M)`B+P<'I`O.EB\B!X0,```#SI(M$)`B+\E_#D%6+[(/L"(M%"(L`)0$```") -M1?R+10B+`-'X)?___W^)1?BY!0```)GW^8M-"(D!BT7XN04```"9]_F*1?R- -M!%`$,`^^P,G#D%6+[%-75HMU"(M]#(M=$(![#3QT-XM%%(L`*T,$*0.+112+ -M`(E#!%/H4QT``(/$!%-7:@%6Z/H7``"#Q!"+112+2P2)"%Y?6\G#D)!75HM% -M%/\PZ#`A``"#Q`P#QXM-%(D!7E];R<.058OL@>P$`@``4U=6BW4(BWT0QT6@ -M`````,=%B`````#'1<0`````QT6X``````^^1PV)A0S^__^+1P2)1="#O0S^ -M__\\=0D-____?^L/D)"+A0S^__^+!(44&$``B47@B@:(1><*P'1B/"5T7HO> -M1HH&B$7G"L!T!#PE=?*+QBO#B84,_O__`46@`T70B84(_O__.T7@=AB-1=!0 -M5_^U#/[__U/H[_[__X/$$.L=D)#_M0S^__]3_W70Z&$@``"#Q`R+A0C^__^) -M1="`?><`=7.+1=`K1P2)A03^__\I!XM%T(E'!(M%T`,'.T7@=@^`?PT\=`E7 -MZ!T<``"#Q`3V1PQ$="?V1PP$=1C_=:!J"HM%T"M%H%#HZ1\``(/$#`O`=`E7 -MZ"P:``"#Q`3V1PP@=`NX_____UY?6\G#D(M%H%Y?6\G#,\")1:2)1;2)1O! -MD/9%M$1U!(!-M"`/MD7G@^@PB84$_O__ZQJ0D)`/MD7G@^@P:XT$_O__"@/! -MB84$_O__1HH&B$7G#[9%Y_:`M1!```1UU_9%M$!T$8N%!/[__XE%E.DE____ -MD)"0BX4$_O__B47PZ13___^0D(!-M`'I"?___Y"0D/9%M` P$BT4,BT#\ -MB474C9T?_O__B5WL"\!](L>%$/[__W@00`#'1?0!````/0```(`/A/L```#W -M7=3K+)#V1;0"=`['A1#^__]Z$$``ZQ*0D/9%M`AT$<>%$/[__WP00`#'1?0! -M````BT74B84$_O__@_@)?P\+P'54]D6T0'59ZTR0D)"+A03^__^)A0S^__^X -M"@```(F%"/[__XN%!/[__YGWO0C^__^)A03^__^P"O:M!/[__XJ-#/[__RK( -M@,$P2X@+@[T$_O__"7^W2XJ%!/[__P0PB`/V1;1`#X3:"0``BT64BTWL*\LK -MP8F%!/[__PO`#X[""0``B46,B47(@$VU`NFS"0``D)"0]D6T`8-%#`2+10R+ -M0/R)1=2-G1_^__^)7>RI````@`^$-O___XU%U%#HPOO__X/$!$N(`^DB____ -MD)"0QT7`!P```,=%S`(```#K#L=%P`\```#'1=8=0>X.!!``.L%N$P00`")1;"-G1_^__^)7>R+1=2)A03^__\+ -MP'4:]D6T0'5!N`$```")18R)1PKRRO! -MB84$_O__"\!^"HE%C(E%R(!-M0+V1;00#X2E"```@WW4``^$FP@```^V1>># -M^%AT0H/X;W0-@_AX="#I@P@``)"0D&;W1;0``@^%=`@``+@!````Z:C^__^0 -MD,>%$/[__X`00`#'1?0"````Z5((``"0D,>%$/[__X000`#KYO9%M$!U!\=% -ME`8```"#10P(BT4,5E>-?:B-BT6L)0``\'\]``#P?P^%H0```/=% -MK/__#P!U/(M%K"4```"`/0```(!U!\=%N`$```#'18@!````@'WG174)N'00 -M0`#K!Y"0N'`00`"+V(U#`^DQ!@``D(M%K"4```"`/0```(!U$<>%$/[__X@0 -M0`#'1?0!````BT6LP>`,B474QT7$!0```,=%P`\```#'1S_1>R*#0P9 -M0`"("(M%E(F%!/[__^L7D(`[`'0:BT7L_T7LB@M#B`C_C03^__^#O03^__\` -M?^&#O03^__\`?A"+A03^__^)1=R)1='F+1?A(B84$_O__"\!]*/>=!/[__^L@D)"X"@```(F% -M"/[__XN%!/[__YGWO0C^__^)A03^__^#O03^__\)?AV+A03^__^Y"@```)GW -M^8#",/]-O(M%O(@0Z[Z0D/]-O(M%O(J-!/[__X#!,(@(ZPJ0_TV\BT6\Q@`P -MC46;.46\=^^#??@`?P_=1:C<':P00`#?X)N>=0:P*^L$D)"P+?]-O(M-O(@! -M#[9%Y_:`M1!```%T!;!%ZP.0L&7_3;R+3;R(`8O%*T6\@^ACB46D`47(@$VT -M@.F3!0``D)"0]D6T0'4'QT64!@```(-%#`B+10Q65XU]J(UP^*6E7UZ+1:PE -M``#P?ST``/!_#X6%````]T6L__\/`'4HBT6L)0```(`]````@'4'QT6X`0`` -M`,=%B`$```"[%$/[__Y`00`#' -M1?0!````BT6LP>`,B474QT7$!0```,=%P`\```#'1%$/[__Y000`#K$I"0]D6T"'01QX40_O__EA!``,=%]`$```"-A13^__^) -M1>R+1?B)A03^___'19``````@[T$_O__`'X+@#L`=`:#?9`1?`2P,.L&_T60 -MB@-#BTWL_T7LB`'_C03^__^#O03^__\`?\OV1;00=0:#?90`?@Z+1>S_1>R* -M#0P90`"("(M%E(/X/'P%N#P```")A03^__\Y191^.X!-M0&+190KA03^__^) -M1=R)1=*+W8'K[`$``.F5`P``D/9%M$!U"L=%E`8```#K#I"#?90`=0?' -M190!````@T4,"(M%#%97C7VHC7#XI:5?7HM%K"4``/!_/0``\'\/A:4```#W -M1:S__P\`=4"+1:PE````@#T```"`=0?'1;@!````@'WG1W4(N'000`#K!I"X -M='#X4\^___QT7\:!!``,=%L#@00`#I??G__Y"-1>A0C47X4(M%E(/X$7P% -MN!$```!0_W6L_W6HZ+\&``"#Q!2+V-U%J-P=K!!``-_@FYYU!\=%^`$```"+ -M192)A03^___V1;00=4E3Z`L7``"#Q`2)A0S^__^+A03^__\YA0S^__]](XN% -M#/[__XF%!/[__^L5D)"+A03^__^`?`/_,'4/_XT$_O__@[T$_O__`7WD@WWX -M_7P(BT64.47X?A*+A03^__](B464Z;+Z__^0D)"+A03^__\K1?B)193I-?W_ -M_Y"0D(I%Y^L-D)"0@T4,!(M%#(I`_(B%%/[__XV=%/[__XO#0.LED(-%#`2+ -M10R+6/P+VW4%NYP00`#V1;1`=1-3Z%$6``"#Q`0#PXE%[.F4`0``B9T$_O__ -MBX4$_O___X4$_O__@#@`=`7_391YZHN%!/[__TCKTY"0D$[IMO3__Y"0Y!,` -M``0>```$'@``[!,```0>``",'0``!!X```0>```$'@``!!X```04``#4$P`` -M!!X``-P3``#T$P``!!X``#@4``!"%```0A0``$(4``!"%```0A0``$(4``!" -M%```0A0``$(4```$'@``!!X```0>```$'@``!!X```0>```$'@``!!X```0> -M```$'@``!!X``"P7```$'@``W!L```0>```$'@``!!X```0>```$'@``!!X` -M``0>```$'@``!!X```0>```$'@``!!X```0>```$'@``!!X```0>```,%@`` -M!!X```0>```$'@``!!X```0>```$'@``!!X```0>```$'@``!!X``)0=``"P -M%```+!<``.`9``#<&P``MA,``+`4```$'@``!!X``*04```$'@``!!X``/P5 -M```$'@``!!X```0>``"P'0``!!X``,`5```$'@``!!X```P6``"#?8@`=%2# -M?;@`=!S'A1#^__^D$$``QT7T`0```,=%N`````#K+9"0]D6T`G0.QX40_O__ -MIA!``.L2D)#V1;0(=!''A1#^__^H$$``QT7T`0```,=%B`````"+1>PKPXF% -M#/[__P-%]`-%R`-%Q(E%D#E%\'\*`46@Z<4```"0D(M%\`%%H/9%M"!T+&;W -M1;0``G4,@$VU`BM%D(E%C.L)BT7P*T60`46,BT7PB460Z8\```"0D)"0]D6T -M!`^%@0```(M%\"M%D(F%!/[__^L;C4704%=J%&@($$``Z*?Q__^#Q!"#K03^ -M__\4@[T$_O__%'_!V%HU%T%!7_W6D_W6\Z!;O__^#Q!#K&Y#_=:3_=;S_==#HBA```(/$#(N% -M_/W__XE%T/9%M`0/A+3O__^+19`Y1?`/CJCO__^+1?`K19")A0#^___K'9"0 -MC4704%=J%&@($$``Z+_N__^#Q!"#K0#^__\4@[T`_O__%'_67!`#WZ04;S<@=N4!"#P"9]_DM\P$``(E%\(-]'`!T`@/P"_9]`C/V -MC5X!B\.#Z`F)1=P+P'X-NPD```"#^`E^`XE=W(O#*T7PB478_W48C47X4/]U -MW/]UV(U%"%#HU0```(/$%(E%_(O[@<>\&T``5U#H#`L``(/$"(E%Z"O']]B) -M1=@I7=B#?=@`?@Z+1=@!1?"#?1P`=`(#\(-]W`!^)(M%W`/'4/]U^.C4"@`` -M@\0(B478ZPG_3=B+1=C&`#`Y?=AW\HM%Z(E%W(/^$7X%OA$```"+1=P#QHOX -MB]^`.S5_%8`[-74[BD/_L0)FF/;Y#[[$"\!T*\8#,#E=W'4;_TW$!````B0B+QL'X%"7_ -M!P``+?X#``")1?P]`OS__W4:C47\4(M%X/]P!/\PZ,4#``"#Q`R+1>#=&)N_ -M_S\``(M%X(LPB\;!X`,CQXE%[,'^"XO>(]_!_@Z!YG\```"+1>"+0`3!X`<# -M\"/^P?X.@>;_'P``@`/OT`&B47`/ -MOT`(]^Z+3=0/KTWL`\&+3=@/K\L#P8M-W`^OSP/!P?@.BTW@#[\)#Z]-[`/! -MBTW4#Z_+`\&+3=@/K\\#P8M-W`^OS@/!B47LBT7@#[\`B470BT7@#[]``HE% -MS(M%X`^_0`3W[HM-S`^OSP/!BTW0#Z_+`\&+3>S!^0X#P8O8BT7,]^Z+3=`/ -MK\\#P8O+P?D.`\&+^(M%T/?NB\_!^0X#P8OPBT7@#[]`"@%%_.L3D)#!Y@X# -M]XO[BUWLQT7L`````/9%#!\/A!\!``#'1B+PR7_ -M/P``B47LN_\_```CW[__/P``(_[!_@ZX$````"M%#"4?````:\`,!S!^0X#P8O8BT7(]^Z+ -M3>`/K\\#P8O+P?D.`\&+^(M%X/?NB\_!^0X#P8OPBT7,#[]`"@%%_,=%R/\_ -M``"!Y_\_``"!X_\_``"!9>S_/P``BT7\@^@R#?1``?PF+1>1>7UO)PY"*3R+Q\'X#@/PB\/! -M^`X#^(M%[,'X#@/8QT7(_S\``('F_S\``('G_S\``('C_S\``+@0````*T40 -M:\`,!DD____D%6+[-U%"-GEW^">=0N+11#'``````!=PV8E`$5T!F8]`$1U -M%-GTV>C7UO)PY`! -M70B+1?R+3@2)3?@KP8O8"]M^R(O'.\-R`HO#B]A3_W4(_W7XZ$8(``"#Q`PI -M'@%>!`^^1@V+!(44&$``*T8$BPX+R7\",\D[P7T)5N@6!```@\0$*_MUI_9& -M#$1T)_9&#`1U&(M&!"M&"%!J"O]V".C>!P``@\0,"\!T"5;H(0(``(/$!(M% -M$%Y?6\G#D)!5B^R#[`16OE`40``Y-1`80`!W!%[)PY!6Z!(```"#Q`2#QA`Y -M-1`80`!W[%[)PY!5B^R#[`175HMU"+______"_9T8_9&#(-T-?9&#`1T!#/` -MZPE6Z%8```"#Q`2+^`^^1@U0Z*<#``"#Q`0+P'T/O______'!0@90``"```` -M]D8,"'02_W8(Z&L&``"#Q`3'1@@`````QD8,`,<&`````(M&"(E&!(O'7E_) -MPY"0D%6+[%:+=0CV1@P"=2C'!@````#K-Y"0D/9&#`)T'8-^"`!T%XM&"#E& -M!'8/5N@R`0``@\0$]D8,!'3=]D8,('0+N/____]>R<.0D)`SP%[)PY"0D%6+ -M[(/L!%:+=0R*1@PD4CQ"=3T/OD8-BTX$.0R%%!A```^&I0```(O!_T8$BDT( -MB`B`^0H/A1-6#[9%"%#H'/__ -M_X/$".L.D)"0BD4(BTX$_T8$B`'V1@P@=`NX_____U[)PY"0D`^V10A>R<.0 -M58OL@^P(4U=6BW4(BUX$BWX(B\7UO)PS/`7E];R<.058OL -M5HMU"(I&#"02/`)T&O9&#()U"KC_____7LG#D)"*1@PD[PP"B$8,@WX(`'4) -M5NA*````@\0$BT8(.48$=3GV1@Q$=3,/OD8-BP2%%!A``"M&"(D&#[YL$ -MA1080``K1@2+#@O)?P(SR3O!?0E6Z,D```"#Q`0SP%[)PY!5B^R#[`135U:+ -M=0@/OEX-B_OV1@P$=!B-!/W@(T``B48(@\`(B02=%!A``.MND)"#_P)])PO_ -M=0>XV!]``.L%N-`;0`")1@@%``0```^^3@V)!(T4&$``ZT*0D&@(!```Z#(! -M``"#Q`2)1@@+P'04@$X,"`^^1@V+3@B!P0`$``#K$I`/OD8-C0S]X"-``(E. -M"(/!"(D,A1080`"+1@B)1@17Z&@```"#Q`0+P'0*]D8,!'4$@$X,0%Y?6\G# -MD)!5B^R#[`135U:+=0@/OD8-BQR%%!A``(O#*T8$B_@+_WT*B5X$7E];R<.0 -MD#D^?@*)/EY?6\G#D+@&````F@`````'``^"B@0``#/`PY"0D%6+[(/L&*$( -M&4``B47HC47L4&@!5```_W4(Z!T```"#Q`P+P'T.BT7HHP@90``SP,G#D)"X -M`0```,G#D+@V````F@`````'``^"-@0``,.058OL@^P$4U=6BW4(BWT,B\:Y -M"@```)GW^8O8L0KVZ8O.*L'VV`0P3X@'B_,+]G7?B\=>7UO)PY!5B^R#[!Q3 -M5U;'1>P`````@WT(`'0)@7T(^/O__W8),\!>7UO)PY"0@SW()4```'4VN,PE -M0``,`:/()4``N,@E0``,`:/,)4``QP44&4``S"5``,<%$!E``,@E0`#'!1P9 -M0`#,)4``BT4(@\`'P>@"B]B+-1`90`#'1?``````]@8!=37K&I"0B340&4`` -MBP>)!CD]'!E``'4&B34<&4``BS[V!P%TX8T$GHE%Y#O'=P@[Q@^#3P$``(O^ -MBP8D_HOP._=WNCD]%!E```^%3O___X'^R"5```^%0O____]%\(-]\`%VF8LU -M'!E``&H`Z)D"``"#Q`2+^*$4&4``@\`$.\=T/(V#_P```+D``0``F??YB47P -MP67P"HO'N00```"9]_F)5>0+TG0ZB\$KPHE%[`/'B_B+1>P!1?#K)Y"0D*$4 -M&4``*P4<&4``P?@"*\/WV(E%\`4``0``P>@(B47PP67P"HM%\`/'.\@]`/S_?W8;:`#\_W_H!`(``(/$!$`/A(W^__^!;?``_/]__W7P -MZ.L!``"#Q`1`=16+QRM%[%#H_P$``(/$!.EE_O__D)")/1P90`"A%!E``(DX -MBT7H*T7LC40'_(D'H1090`"#P`0[QW0.H1090`"+R(L)@,D!B0B+!Z,4&4`` -MN<@E0`"`R0&)"(O^Z7'^__^0C02>HQ`90``[QW,0BP"C&!E``*$0&4``BPZ) -M"*$0&4``#`&)!CDU'!E``'4*H1`90`"C'!E``(U&!%Y?6\G#D%6+[(/L!%:+ -M=0B#[@2)-1`90`"+!B3^B0:A%!E``#D&=0:)-1P90`!>R<.058OL@^P84U=6 -MBWT(]D?\`70)5^B\____@\0$@WT,`'4',\!>7UO)PXM'_"O'P?@"B47P_W4, -MZ%']__^#Q`2+\`OV=`4Y=0AU!XO&7E];R<.+10R#P`/!Z`*)1>R+1?`Y1>QS -M!HM%[(E%\(M%\,'@`E#_=0A6Z$(```"#Q`R+V#O?<\:+1>R-!(.)1>@[QW*Y -M*\?!^`*+#1@90`")#(/KJ5>+3"00XQ&+?"0(BD0D#/*N=06+QTA?PS/`7\-7 -M5HM\)`R+="00BTPD%(O'B]'!Z0+SI8O*@>$#````\Z1>7\-7BWPD"(I$)`R+ -M3"00@_D4?ATE_P```(K@B]#!XA`+PHO1P>D"\ZN+RH'A`P```/.JBT0D"%_# -MD(M4)`2%TG03`Q4@&4``4N@1````@\0$A?9>R<.0D)```````````$AE -M;&QO(%=O"!E0%Z`7L!?`%]`7X! -M?P&``8$!@@&#`80!A0&&`8`9\!H`&A`:(!HP&D`:4!I@&G`:@!J0&J`:L! -MK`&M`:X!KP&P`;$!L@&S`;0!M0&V`;$!X@'C`>0!Y0'F`>H!ZP'L`>T![@'O -M`?`!\0'R`?,!]`'U`?8!]P'X`?D!^@'[`?P!_0'^`?\!```````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M````````````````>0````````!N```````````````M)``````````````! -M``H`$P`6`!D`*P`R`#D`00!+`%0`6P!D`&@`;`!P`'0`>`!\`(``B`"1`)<` -MG0"A`*8`JP"R`+P`Q`#-`-8`V@#>`.(`Y@#J`.X`\@#V`/H`_@`"`0`E;2\E -M9"\E>0`E2#HE33HE4P!!30!030`E82`E8B`E9"`E6"`E6B`E60!3=6YD87D` -M36]N9&%Y`%1U97-D87D`5V5D;F5S9&%Y`%1H=7)S9&%Y`$9R:61A>0!3871U -M0!3=6X`36]N`%1U90!7960`5&AU`$9R:0!3870`2F%N=6%R>0!&96)R -M=6%R>0!-87)C:`!!<')I;`!-87D`2G5N90!*=6QY`$%U9W5S=`!397!T96UB -M97(`3V-T;V)E<@!.;W9E;6)E<@!$96-E;6)E<@!*86X`1F5B`$UA<@!!<'(` -M36%Y`$IU;@!*=6P`075G`%-E<`!/8W0`3F]V`$1E8P`````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M`````````````````````````````````0(#!`4&!P@)"@L,#0X/$!$2$Q05 -M%A<8&1H;'!T>'R`A(B,D)28G*"DJ*RPM+B\P,3(S-#4V-S@Y.CL\/3X_0&%B -M8V1E9F=H:6IK;&UN;W!Q'EZ6UQ=7E]@04)#1$5&1TA)2DM,34Y/ -M4%%24U155E=865I[?'U^?X"!@H.$A8:'B(F*BXR-CH^0D9*3E)66EYB9FIN< -MG9Z?H*&BHZ2EIJ>HJ:JKK*VNK["QLK.TM;:WN+FZN[R]OK_`P<+#Q,7&Q\C) -MRLO,S<[/T-'2T]35UM?8V=K;W-W>W^#AXN/DY>;GZ.GJZ^SM[N_P\?+S]/7V -M]_CY^OO\_?[_````("`@("`@("`@("`@("`@("`@("``````,#`P,#`P,#`P -M,#`P,#`P,#`P,#``````,#$R,S0U-C\`.L_IRJ*#<'^Z&[/""4C -MR3E8$%;^^ED2'-L>02>N">S]_TAN,*$ZF`<_`X+]!``D`````"X`PDCE'``0```` -M`"L`:G2B%````````"<`(5WH-@```````"0`@4H@'P```````"$`-7<`)0`` -M`````!T`7E\`!````````!H`2TP`$````````!<`$GH``````````!,`J&$` -M`````````!``($X```````````T``'T```````````D``&0```````````8` -M`%````````````,``$``````````````9F:9&68FF1EH)OS_ZU%'(84KK@<@ -M!?G_B4'2#6H\OA^T'?;_VVCK(A`'RC+K%?+_XE.(-=HX"`^)$>__&T.@-WLM -MTQC5&NS_7VN:,BLOA30@'NC_YE7B#B,,G0.`/N7_N$3H"[4)2RF:"^+_\VW9 -M'^\UJQM<'][_]5?A/UD>50E]/]O_7D:!&7H+$2'^)=C_EW!H`ET2'"B6"=3_ -M$EJ&&THHL#FK!]'_#DB>+]4Y62&)+,[_````0`````````````````$````` -M```````````````"`0```````/`C0`#P(T``!@(````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M`````````````````````````````````````````````````````````!`8 -M0````````````/@C0``````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M`````````````````````````````````"XL```````````````````````` -MT"5````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M```````````````````````````````````````````````````````````` -M`$`H(RD@8W)T,2YS(#$N."`X.2\P-2\S,"``0"@C*2!S>7,N:3,X-B`Q+C@@ -M.#DO,#$O,38@````0"@C*2!L:6UI=',N:"`R+C,@.3`O,#$O,3<@`$`H(RD@ -M8W)T;BYS(#$N-2`X."\Q,2\Q-"``0"@C*2!S>7,N:3,X-B`Q+C@@.#DO,#$O -M,38@````+F9I;&4````.````_O\``&'0```#4`````0````,!5`````<`````````````````+F1A=&$````,!4`` -M`@````,!"```````````````````````+F)S'0````H`0```0````,!.``` -M``8`````````````````+F1A=&$````4!4```@````,!```````````````` -M````````+F1A=&$````4!4```@````,!)P``````````````````````+F)S -M'0```!@`0```0````,!%`H``)@`````````````````+F1A=&$````\!4`` -M`@````,!+`(``!@`````````````````+F1A=&$```!H!T```@````,!6`$` -M````````````````````+F)S'0```!T"P```0````,!;``` -M``,`````````````````+F1A=&$```#`"$```@````,!Q`,````````````` -M````````+F1A=&$```"$#$```@````,!````````````````````````+F)S -M'0```#@"P```0````,!9`````8`````````````````+F1A=&$```"$#$`` -M`@````,!$```````````````````````+F1A=&$```"4#$```@````,!`0`` -M````````````````````+F)S'0```!$#````0````,!6`````4````````` -M````````+F1A=&$```"8#$```@````,!"```````````````````````+F1A -M=&$```"@#$```@````,!`0``````````````````````+F)S'0```"<#``` -M`0````,!;`$``#8`````````````````+F1A=&$```"D#$```@````,!5@(` -M````````````````````+F1A=&$```#\#D```@````,!`0`````````````` -M````````+F)S'0````(#@```0````,!:`````<`````````````````+F1A -M=&$`````#T```@````,!`@``````````````````````+F1A=&$````$#T`` -M`@````,!````````````````````````+F)S'0```!P#@```0````,!3``` -M``$`````````````````+F1A=&$````$#T```@````,!```````````````` -M````````+F1A=&$````$#T```@````,!````````````````````````+F)S -M'0```"\#@```0````,!.```````````````````````+F1A=&$````$#T`` -M`@````,!````````````````````````+F)S'0```#T#@```0````,!8```````````````````````+F1A=&$````$#T`` -M`@````,!````````````````````````+F)S2YS````````````+G1E -M>'0```!4#P```0````,!/```````````````````````+F1A=&$````$#T`` -M`@````,!````````````````````````+F)S'0```"0#P```0````,!=`````(`````````````````+F1A=&$````$#T`` -M`@````,!````````````````````````+F1A=&$````$#T```@````,!```` -M````````````````````+F)S'0````\$``` -M`0````,!A`````8`````````````````+F1A=&$````$#T```@````,!`0$` -M````````````````````+F1A=&$````($$```@````,!```````````````` -M````````+F)S'0```#`$````0````,!4```````````````````````+F1A -M=&$````($$```@````,!````````````````````````+F)S'0````0$0```0````,!%`````$`````````````````+F1A -M=&$````($$```@````,!````````````````````````+F)S'0````D$0```0````,!%`````$`````````````````+F1A -M=&$````($$```@````,!````````````````````````+F)S'0````X$0```0````,!%`````$`````````````````+F1A -M=&$````($$```@````,!````````````````````````+F)S'0```!,$0```0````,!,```````````````````````+F1A -M=&$````($$```@````,!````````````````````````+F)S'0```!\$0```0````,!-```````````````````````+F1A -M=&$````($$```@````,!````````````````````````+F)S'0```"P$0```0````,!]!$``*\`````````````````+F1A -M=&$````($$```@````,!<```````````````````````+F1A=&$```!X$$`` -M`@````,!/```````````````````````+F)S'0```"D(P```0````,!```````````````` -M````````+F1A=&$```"T$$```@````,!`0$`````````````````````+F1A -M=&$```"X$4```@````,!````````````````````````+F)S'0```#,)0```0````,!```` -M````````````````````+F1A=&$```"X$4```@````,!"``````````````` -M````````+F1A=&$```#`$4```@````,!````````````````````````+F)S -M'0```#,)0```0````,!%`0```0`````````````````+F1A=&$```#`$4`` -M`@````,!````````````````````````+F1A=&$```#`$4```@````,!```` -M````````````````````+F)S'0```#@*0```0````,!```````````````` -M````````+F1A=&$```#`$4```@````,!!```````````````````````+F)S -M'0```#@*0```0````,!```````````````` -M````````+F1A=&$```#$$4```@````,!B`(`````````````````````+F)S -M'0```#@*0```0````,!3``` -M``$`````````````````+F1A=&$```!,%$```@````,!!``````````````` -M````````+F)S'0```"@*P```0````,!$`0``"$````````` -M````````+F1A=&$```!0%$```@````,!````````````````````````+F1A -M=&$```!0%$```@````,!````````````````````````+F)S'0```"P+P`` -M`0````,!&`````$`````````````````+F1A=&$```!0%$```@````,!```` -M````````````````````+F)S'0```#(+P`` -M`0````,!````````````````````````+F1A=&$```!0%$```@````,!N`0` -M``0`````````````````+F1A=&$````(&4```@````,!```````````````` -M````````+F)S'0````$,````0````,!```` -M````````````````````+F1A=&$````(&4```@````,!!``````````````` -M````````+F)S'0````$,````0````,!%``` -M``$`````````````````+F1A=&$````,&4```@````,!```````````````` -M````````+F)S'0````8,````0````,!```` -M````````````````````+F1A=&$````,&4```@````,!`@`````````````` -M````````+F1A=&$````0&4```@````,!````````````````````````+F)S -M'0````8,````0````,!.```````````````````````+F1A=&$````0&4`` -M`@````,!````````````````````````+F1A=&$````0&4```@````,!```` -M````````````````````+F)S'0```!0,````0````,!%`,``"T````````` -M````````+F1A=&$````0&4```@````,!$```````````````````````+F1A -M=&$````@&4```@````,!````````````````````````+F)S'0```!D,P`` -M`0````,!'```````````````````````+F1A=&$````@&4```@````,!```` -M````````````````````+F)S'0```"`,P`` -M`0````,!)```````````````````````+F1A=&$````@&4```@````,!```` -M````````````````````+F)S'0```"D,P`` -M`0````,!.```````````````````````+F1A=&$````@&4```@````,!```` -M````````````````````+F)S'0```#<,P`` -M`0````,!1`````4`````````````````+F1A=&$````@&4```@````,!!``` -M``$`````````````````+F)S`0``_O\``&'0````@-````0````,!&```````````````````````+F1A -M=&$````D&4```@````,!````````````````````````+F)S'0````X-````0````,!%`````$`````````````````+F1A -M=&$````D&4```@````,!````````````````````````+F)S'0```!,-````0````,!#`````$`````````````````+F1A -M=&$````D&4```@````,!````````````````````````+F)S&ET+G,````` -M````````+G1E>'0```!8-````0````,!)`````,`````````````````+F1A -M=&$````D&4```@````,!````````````````````````+F)S&ET+F,````` -M````````+G1E>'0```!\-````0````,!D`````@`````````````````+F1A -M=&$````D&4```@````,!A```````````````````````+F1A=&$```"H&4`` -M`@````,!````````````````````````+F)S'0````,-0```0````,!````````````````````````+F1A -M=&$```"H&4```@````,!````````````````````````+F)S0!4#P```0````(``````#H````\#@`` -M`0````(``````$<````(#@```0````(``````%,```!T"P```0````(````` -M`%\```"`#````0````(``````&T```#L#````0````(`;'-E96L````0$0`` -M`0````(``````'<```!$#````0````(``````(0`````"P```0````(````` -M`)`````<#````0````(`7V-T>7!E``"T$$```@````(``````)X```#@"P`` -M`0````(`7VQC7W1I;66<#````0````(`9V5T96YV``"0#P```0````(`8VQO -M&ET``"8-````0````(`871E>&ET``!\-````0````(`971E -M>'0````,-0``__\```(`961A=&$```"H&4``__\```(`#P$``&UA:V5L;V-A -M;&4`7VQC<5]D=6UM>0!S971C871E9V]R>0!?;&]W9&EG:70`7!E`%]L8W1?8V]L;&%T -M90!?;&-T7VUE&ET7V9U;F-S`%]T -` -end diff --git a/share/man/man4/kld.4 b/share/man/man4/kld.4 index 185389a4944..2d76d5128c1 100644 --- a/share/man/man4/kld.4 +++ b/share/man/man4/kld.4 @@ -57,10 +57,8 @@ system makes extensive use of loadable kernel modules, and provides loadable versions of most file systems, the .Tn NFS client and server, all the screen-savers, and the -.Tn iBCS2 -and .Tn Linux -emulators. +emulator. .Nm modules are placed by default in the .Pa /boot/kernel diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 2c10a76e710..b7eb512eda7 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2018 +.Dd September 22, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -3542,21 +3542,6 @@ Set to to enable system accounting through the .Xr accton 8 facility. -.It Va ibcs2_enable -.Pq Vt bool -Set to -.Dq Li YES -to enable iBCS2 (SCO) binary emulation at system initial boot -time. -.It Va ibcs2_loaders -.Pq Vt str -If not set to -.Dq Li NO -and if -.Va ibcs2_enable -is set to -.Dq Li YES , -this specifies a list of additional iBCS2 loaders to enable. .It Va firstboot_sentinel .Pq Vt str This variable specifies the full path to a diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c index 7c43f26c28b..f70d86ed1a9 100644 --- a/sys/amd64/amd64/elf_machdep.c +++ b/sys/amd64/amd64/elf_machdep.c @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 72b9b3e78d9..8f7d5dac297 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -999,8 +999,6 @@ cpu_fetch_syscall_args(struct thread *td) reg++; regcnt--; } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index e11120fbdd5..56f73c73ff5 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -626,9 +626,6 @@ options EFIRT # Enable 32-bit runtime support for FreeBSD/i386 binaries. options COMPAT_FREEBSD32 -# Enable iBCS2 runtime support for SCO and ISC binaries -#XXX#options IBCS2 - # Emulate spx device for client side of SVR3 local X interface #XXX#options SPX_HACK diff --git a/sys/amd64/ia32/ia32_syscall.c b/sys/amd64/ia32/ia32_syscall.c index 989f5486213..43844602cf3 100644 --- a/sys/amd64/ia32/ia32_syscall.c +++ b/sys/amd64/ia32/ia32_syscall.c @@ -177,8 +177,6 @@ ia32_fetch_syscall_args(struct thread *td) sa->code = tmp; params += sizeof(quad_t); } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index afa06bb415c..271e86260ae 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -711,7 +711,6 @@ linux_vsyscall(struct thread *td) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 66d441e96c6..02a417a207f 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -907,7 +907,6 @@ linux32_fixlimit(struct rlimit *rl, int which) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX32_SYS_MAXSYSCALL, .sv_table = linux32_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c index 3ab3eb90f12..acfa1e6649f 100644 --- a/sys/arm/arm/elf_machdep.c +++ b/sys/arm/arm/elf_machdep.c @@ -59,7 +59,6 @@ u_long elf_hwcap2; struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/arm/arm/syscall.c b/sys/arm/arm/syscall.c index 8c33fff30a1..21a88e9c6c6 100644 --- a/sys/arm/arm/syscall.c +++ b/sys/arm/arm/syscall.c @@ -118,8 +118,6 @@ cpu_fetch_syscall_args(struct thread *td) ap += 2; } p = td->td_proc; - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c index febb6de09be..31527619a61 100644 --- a/sys/arm/arm/vm_machdep.c +++ b/sys/arm/arm/vm_machdep.c @@ -190,8 +190,6 @@ cpu_set_syscall_retval(struct thread *td, int error) if (call == SYS___syscall) { register_t *ap = &frame->tf_r0; register_t code = ap[_QUAD_LOWWORD]; - if (td->td_proc->p_sysent->sv_mask) - code &= td->td_proc->p_sysent->sv_mask; fixup = (code != SYS_lseek); } #endif diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c index 67244adfb0c..98e949decec 100644 --- a/sys/arm64/arm64/elf_machdep.c +++ b/sys/arm64/arm64/elf_machdep.c @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); static struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 9de15479800..5cc85435ce2 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -115,8 +115,6 @@ cpu_fetch_syscall_args(struct thread *td) nap--; } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 0cbfd322de9..8b197cc59d3 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -124,8 +124,6 @@ linux_fetch_syscall_args(struct thread *td) sa->code = td->td_frame->tf_x[8]; /* LINUXTODO: generic syscall? */ - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else @@ -364,7 +362,6 @@ linux_vsyscall(struct thread *td) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c index 91a2acf329f..60652514641 100644 --- a/sys/compat/ia32/ia32_sysvec.c +++ b/sys/compat/ia32/ia32_sysvec.c @@ -98,7 +98,6 @@ SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxvmem, CTLFLAG_RWTUN, &ia32_maxvmem, 0, " struct sysentvec ia32_freebsd_sysvec = { .sv_size = FREEBSD32_SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index d2591137a99..0cf27b25546 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -511,25 +511,6 @@ i386/i386/trap.c standard i386/i386/uio_machdep.c standard i386/i386/vm86.c standard i386/i386/vm_machdep.c standard -i386/ibcs2/ibcs2_errno.c optional ibcs2 -i386/ibcs2/ibcs2_fcntl.c optional ibcs2 -i386/ibcs2/ibcs2_ioctl.c optional ibcs2 -i386/ibcs2/ibcs2_ipc.c optional ibcs2 -i386/ibcs2/ibcs2_isc.c optional ibcs2 -i386/ibcs2/ibcs2_isc_sysent.c optional ibcs2 -i386/ibcs2/ibcs2_misc.c optional ibcs2 -i386/ibcs2/ibcs2_msg.c optional ibcs2 -i386/ibcs2/ibcs2_other.c optional ibcs2 -i386/ibcs2/ibcs2_signal.c optional ibcs2 -i386/ibcs2/ibcs2_socksys.c optional ibcs2 -i386/ibcs2/ibcs2_stat.c optional ibcs2 -i386/ibcs2/ibcs2_sysent.c optional ibcs2 -i386/ibcs2/ibcs2_sysi86.c optional ibcs2 -i386/ibcs2/ibcs2_sysvec.c optional ibcs2 -i386/ibcs2/ibcs2_util.c optional ibcs2 -i386/ibcs2/ibcs2_xenix.c optional ibcs2 -i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 -i386/ibcs2/imgact_coff.c optional ibcs2 i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_copyout.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64 index 1edb70164a8..8939ddaf624 100644 --- a/sys/conf/options.amd64 +++ b/sys/conf/options.amd64 @@ -16,7 +16,6 @@ PV_STATS opt_pmap.h # (see src/sys/conf/options), except for broken debugging options. COMPAT_AOUT opt_dontuse.h COMPAT_FREEBSD32 opt_global.h -#IBCS2 opt_dontuse.h #COMPAT_LINUX opt_dontuse.h COMPAT_LINUX32 opt_compat.h LINPROCFS opt_dontuse.h diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 83298bad651..8c96ff40c55 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -22,7 +22,6 @@ PV_STATS opt_pmap.h # they are handled like options for static filesystems # (see src/sys/conf/options), except for broken debugging options. COMPAT_AOUT opt_dontuse.h -IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h diff --git a/sys/i386/Makefile b/sys/i386/Makefile index f6ecf7fa2fd..fe6ac2bf41d 100644 --- a/sys/i386/Makefile +++ b/sys/i386/Makefile @@ -14,7 +14,7 @@ all: @echo "make links or tags only" # Directories in which to place i386 tags links -DI386= apm i386 ibcs2 include isa linux +DI386= apm i386 include isa linux links:: -for i in ${COMMDIR1}; do \ @@ -25,9 +25,9 @@ links:: (cd $$i && { rm -f tags; ln -s ../tags tags; }) done SI386= ${SYS}/i386/acpica/*.[ch] ${SYS}/i386/bios/*.[ch] \ - ${SYS}/i386/i386/*.[ch] ${SYS}/i386/ibcs2/*.[ch] \ - ${SYS}/i386/include/*.[ch] ${SYS}/i386/isa/*.[ch] \ - ${SYS}/i386/linux/*.[ch] ${SYS}/i386/pci/*.[ch] + ${SYS}/i386/i386/*.[ch] ${SYS}/i386/include/*.[ch] \ + ${SYS}/i386/isa/*.[ch] ${SYS}/i386/linux/*.[ch] \ + ${SYS}/i386/pci/*.[ch] AI386= ${SYS}/i386/i386/*.s tags:: diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 3adeb338da7..29a3ab1ee3f 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -907,9 +907,6 @@ options NKPT=31 ##################################################################### # ABI Emulation -# Enable iBCS2 runtime support for SCO and ISC binaries -#options IBCS2 - # Emulate spx device for client side of SVR3 local X interface options SPX_HACK diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c index bd07bbc1cc8..59c192f5923 100644 --- a/sys/i386/i386/elf_machdep.c +++ b/sys/i386/i386/elf_machdep.c @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 19086221b11..6fcf05d0b5b 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -1101,8 +1101,6 @@ cpu_fetch_syscall_args(struct thread *td) params += sizeof(quad_t); } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else diff --git a/sys/i386/ibcs2/Makefile b/sys/i386/ibcs2/Makefile deleted file mode 100644 index a257cb8badb..00000000000 --- a/sys/i386/ibcs2/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Makefile for syscall tables -# -# $FreeBSD$ - -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} - -all: - @echo "make sysent, isc_sysent or xenix_sysent only" - -sysent: ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h - -ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h: ../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf - -isc_sysent: ibcs2_isc_sysent.c ibcs2_isc_syscall.h - -ibcs2_isc_sysent.c ibcs2_isc_syscall.h : ../../kern/makesyscalls.sh \ - syscalls.isc syscalls.isc.conf - sh ../../kern/makesyscalls.sh syscalls.isc syscalls.isc.conf - -xenix_sysent: ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h - -ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h: \ - ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf - sh ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf diff --git a/sys/i386/ibcs2/coff.h b/sys/i386/ibcs2/coff.h deleted file mode 100644 index d99112544cb..00000000000 --- a/sys/i386/ibcs2/coff.h +++ /dev/null @@ -1,108 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1994 Sean Eric Fagan - * Copyright (c) 1994 Søren Schmidt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _COFF_H -#define _COFF_H - -struct filehdr { - unsigned short f_magic; /* magic number */ - unsigned short f_nscns; /* # of sections */ - long f_timdat; /* time stamp */ - long f_symptr; /* symbol table offset */ - long f_nsyms; /* # of symbols */ - unsigned short f_opthdr; /* size of system header */ - unsigned short f_flags; /* flags, see below */ -}; - -enum filehdr_flags { - F_RELFLG = 0x01, /* relocs have been stripped */ - F_EXEC = 0x02, /* executable file (or shlib) */ - F_LNNO = 0x04, /* line numbers have been stripped */ - F_LSYMS = 0x08, /* symbols have been stripped */ - F_SWABD = 0x40, /* swabbed byte names */ - F_AR16WR = 0x80, /* 16-bit, byte reversed words */ - F_AR32WR = 0x100 /* 32-bit, byte reversed words */ -}; - -struct aouthdr { - short magic; /* magic number -- see below */ - short vstamp; /* artifacts from a by-gone day */ - long tsize; /* */ - long dsize; /* */ - long bsize; /* */ - long entry; /* Entry point -- offset into file */ - long tstart; /* artifacts from a by-gone day */ - long dstart; /* */ -}; - -#define I386_COFF 0x14c - -#define COFF_OMAGIC 0407 /* impure format */ -#define COFF_NMAGIC 0410 /* read-only text */ -#define COFF_ZMAGIC 0413 /* pagable from disk */ -#define COFF_SHLIB 0443 /* a shared library */ - -struct scnhdr { - char s_name[8]; /* name of section (e.g., ".text") */ - long s_paddr; /* physical addr, used for standalone */ - long s_vaddr; /* virtual address */ - long s_size; /* size of section */ - long s_scnptr; /* file offset of section */ - long s_relptr; /* points to relocs for section */ - long s_lnnoptr; /* points to line numbers for section */ - unsigned short s_nreloc; /* # of relocs */ - unsigned short s_nlnno; /* # of line no's */ - long s_flags; /* section flags -- see below */ -}; - -enum scnhdr_flags { - STYP_REG = 0x00, /* regular (alloc'ed, reloc'ed, loaded) */ - STYP_DSECT = 0x01, /* dummy (reloc'd) */ - STYP_NOLOAD = 0x02, /* no-load (reloc'd) */ - STYP_GROUP = 0x04, /* grouped */ - STYP_PAD = 0x08, /* padding (loaded) */ - STYP_COPY = 0x10, /* ??? */ - STYP_TEXT = 0x20, /* text */ - STYP_DATA = 0x40, /* data */ - STYP_BSS = 0x80, /* bss */ - STYP_INFO = 0x200, /* comment (!loaded, !alloc'ed, !reloc'd) */ - STYP_OVER = 0x400, /* overlay (!allocated, reloc'd, !loaded) */ - STYP_LIB = 0x800 /* lists shared library files */ -}; - -struct slhdr { - long entry_length; - long path_index; - char *shlib_name; -}; -#endif /* _COFF_H */ diff --git a/sys/i386/ibcs2/ibcs2_dirent.h b/sys/i386/ibcs2/ibcs2_dirent.h deleted file mode 100644 index 1d28797e5f4..00000000000 --- a/sys/i386/ibcs2/ibcs2_dirent.h +++ /dev/null @@ -1,60 +0,0 @@ -/* $NetBSD: ibcs2_dirent.h,v 1.2 1994/10/26 02:52:51 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef _IBCS2_DIRENT_H -#define _IBCS2_DIRENT_H 1 - -#include - -#define IBCS2_MAXNAMLEN 512 -#define IBCS2_DIRBUF 1048 - -typedef struct { - int dd_fd; - int dd_loc; - int dd_size; - char *dd_buf; -} IBCS2_DIR; - -struct ibcs2_dirent { - ibcs2_ino_t d_ino; - short d_pad; - ibcs2_off_t d_off; - u_short d_reclen; - char d_name[1]; -}; - -#endif /* _IBCS2_DIRENT_H */ diff --git a/sys/i386/ibcs2/ibcs2_errno.c b/sys/i386/ibcs2/ibcs2_errno.c deleted file mode 100644 index 6511ac59e1c..00000000000 --- a/sys/i386/ibcs2/ibcs2_errno.c +++ /dev/null @@ -1,129 +0,0 @@ -/*- - * ibcs2_errno.c - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1995 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include - -int bsd_to_ibcs2_errno[ELAST + 1] = { - 0, /* 0 */ - IBCS2_EPERM, /* 1 */ - IBCS2_ENOENT, /* 2 */ - IBCS2_ESRCH, /* 3 */ - IBCS2_EINTR, /* 4 */ - IBCS2_EIO, /* 5 */ - IBCS2_ENXIO, /* 6 */ - IBCS2_E2BIG, /* 7 */ - IBCS2_ENOEXEC, /* 8 */ - IBCS2_EBADF, /* 9 */ - IBCS2_ECHILD, /* 10 */ - IBCS2_EDEADLK, /* 11 */ - IBCS2_ENOMEM, /* 12 */ - IBCS2_EACCES, /* 13 */ - IBCS2_EFAULT, /* 14 */ - IBCS2_ENOTBLK, /* 15 */ - IBCS2_EBUSY, /* 16 */ - IBCS2_EEXIST, /* 17 */ - IBCS2_EXDEV, /* 18 */ - IBCS2_ENODEV, /* 19 */ - IBCS2_ENOTDIR, /* 20 */ - IBCS2_EISDIR, /* 21 */ - IBCS2_EINVAL, /* 22 */ - IBCS2_ENFILE, /* 23 */ - IBCS2_EMFILE, /* 24 */ - IBCS2_ENOTTY, /* 25 */ - IBCS2_ETXTBSY, /* 26 */ - IBCS2_EFBIG, /* 27 */ - IBCS2_ENOSPC, /* 28 */ - IBCS2_ESPIPE, /* 29 */ - IBCS2_EROFS, /* 30 */ - IBCS2_EMLINK, /* 31 */ - IBCS2_EPIPE, /* 32 */ - IBCS2_EDOM, /* 33 */ - IBCS2_ERANGE, /* 34 */ - IBCS2_EAGAIN, /* 35 */ - IBCS2_EINPROGRESS, /* 36 */ - IBCS2_EALREADY, /* 37 */ - IBCS2_ENOTSOCK, /* 38 */ - IBCS2_EDESTADDRREQ, /* 39 */ - IBCS2_EMSGSIZE, /* 40 */ - IBCS2_EPROTOTYPE, /* 41 */ - IBCS2_ENOPROTOOPT, /* 42 */ - IBCS2_EPROTONOSUPPORT, /* 43 */ - IBCS2_ESOCKTNOSUPPORT, /* 44 */ - IBCS2_EOPNOTSUPP, /* 45 */ - IBCS2_EPFNOSUPPORT, /* 46 */ - IBCS2_EAFNOSUPPORT, /* 47 */ - IBCS2_EADDRINUSE, /* 48 */ - IBCS2_EADDRNOTAVAIL, /* 49 */ - IBCS2_ENETDOWN, /* 50 */ - IBCS2_ENETUNREACH, /* 51 */ - IBCS2_ENETRESET, /* 52 */ - IBCS2_ECONNABORTED, /* 53 */ - IBCS2_ECONNRESET, /* 54 */ - IBCS2_ENOBUFS, /* 55 */ - IBCS2_EISCONN, /* 56 */ - IBCS2_ENOTCONN, /* 57 */ - IBCS2_ESHUTDOWN, /* 58 */ - IBCS2_ETOOMANYREFS, /* 59 */ - IBCS2_ETIMEDOUT, /* 60 */ - IBCS2_ECONNREFUSED, /* 61 */ - IBCS2_ELOOP, /* 62 */ - IBCS2_ENAMETOOLONG, /* 63 */ - IBCS2_EHOSTDOWN, /* 64 */ - IBCS2_EHOSTUNREACH, /* 65 */ - IBCS2_ENOTEMPTY, /* 66 */ - 0, /* 67 */ - 0, /* 68 */ - 0, /* 69 */ - IBCS2_ESTALE, /* 70 */ - IBCS2_EREMOTE, /* 71 */ - 0, /* 72 */ - 0, /* 73 */ - 0, /* 74 */ - 0, /* 75 */ - 0, /* 76 */ - IBCS2_ENOLCK, /* 77 */ - IBCS2_ENOSYS, /* 78 */ - 0, /* 79 */ - 0, /* 80 */ - 0, /* 81 */ - IBCS2_EIDRM, /* 82 */ - IBCS2_ENOMSG, /* 83 */ - IBCS2_EOVERFLOW, /* 84 */ - 0, /* 85 */ - IBCS2_EILSEQ, /* 86 */ -}; - diff --git a/sys/i386/ibcs2/ibcs2_errno.h b/sys/i386/ibcs2/ibcs2_errno.h deleted file mode 100644 index 0ef1adf1637..00000000000 --- a/sys/i386/ibcs2/ibcs2_errno.h +++ /dev/null @@ -1,157 +0,0 @@ -/*- - * ibcs2_errno.h - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1995 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _IBCS2_ERRNO_H -#define _IBCS2_ERRNO_H - -#define _SCO_NET 1 - -#define IBCS2_EPERM 1 -#define IBCS2_ENOENT 2 -#define IBCS2_ESRCH 3 -#define IBCS2_EINTR 4 -#define IBCS2_EIO 5 -#define IBCS2_ENXIO 6 -#define IBCS2_E2BIG 7 -#define IBCS2_ENOEXEC 8 -#define IBCS2_EBADF 9 -#define IBCS2_ECHILD 10 -#define IBCS2_EAGAIN 11 -#define IBCS2_ENOMEM 12 -#define IBCS2_EACCES 13 -#define IBCS2_EFAULT 14 -#define IBCS2_ENOTBLK 15 -#define IBCS2_EBUSY 16 -#define IBCS2_EEXIST 17 -#define IBCS2_EXDEV 18 -#define IBCS2_ENODEV 19 -#define IBCS2_ENOTDIR 20 -#define IBCS2_EISDIR 21 -#define IBCS2_EINVAL 22 -#define IBCS2_ENFILE 23 -#define IBCS2_EMFILE 24 -#define IBCS2_ENOTTY 25 -#define IBCS2_ETXTBSY 26 -#define IBCS2_EFBIG 27 -#define IBCS2_ENOSPC 28 -#define IBCS2_ESPIPE 29 -#define IBCS2_EROFS 30 -#define IBCS2_EMLINK 31 -#define IBCS2_EPIPE 32 -#define IBCS2_EDOM 33 -#define IBCS2_ERANGE 34 -#define IBCS2_ENOMSG 35 -#define IBCS2_EIDRM 36 -#define IBCS2_ECHRNG 37 -#define IBCS2_EL2NSYNC 38 -#define IBCS2_EL3HLT 39 -#define IBCS2_EL3RST 40 -#define IBCS2_ELNRNG 41 -#define IBCS2_EUNATCH 42 -#define IBCS2_ENOCSI 43 -#define IBCS2_EL2HLT 44 -#define IBCS2_EDEADLK 45 -#define IBCS2_ENOLCK 46 -#define IBCS2_ENOSTR 60 -#define IBCS2_ENODATA 61 -#define IBCS2_ETIME 62 -#define IBCS2_ENOSR 63 -#define IBCS2_ENONET 64 -#define IBCS2_ENOPKG 65 -#define IBCS2_EREMOTE 66 -#define IBCS2_ENOLINK 67 -#define IBCS2_EADV 68 -#define IBCS2_ESRMNT 69 -#define IBCS2_ECOMM 70 -#define IBCS2_EPROTO 71 -#define IBCS2_EMULTIHOP 74 -#define IBCS2_ELBIN 75 -#define IBCS2_EDOTDOT 76 -#define IBCS2_EBADMSG 77 -#define IBCS2_ENAMETOOLONG 78 -#define IBCS2_EOVERFLOW 79 -#define IBCS2_ENOTUNIQ 80 -#define IBCS2_EBADFD 81 -#define IBCS2_EREMCHG 82 -#define IBCS2_EILSEQ 88 -#define IBCS2_ENOSYS 89 - -#if defined(_SCO_NET) /* not strict iBCS2 */ -#define IBCS2_EWOULDBLOCK 90 -#define IBCS2_EINPROGRESS 91 -#define IBCS2_EALREADY 92 -#define IBCS2_ENOTSOCK 93 -#define IBCS2_EDESTADDRREQ 94 -#define IBCS2_EMSGSIZE 95 -#define IBCS2_EPROTOTYPE 96 -#define IBCS2_EPROTONOSUPPORT 97 -#define IBCS2_ESOCKTNOSUPPORT 98 -#define IBCS2_EOPNOTSUPP 99 -#define IBCS2_EPFNOSUPPORT 100 -#define IBCS2_EAFNOSUPPORT 101 -#define IBCS2_EADDRINUSE 102 -#define IBCS2_EADDRNOTAVAIL 103 -#define IBCS2_ENETDOWN 104 -#define IBCS2_ENETUNREACH 105 -#define IBCS2_ENETRESET 106 -#define IBCS2_ECONNABORTED 107 -#define IBCS2_ECONNRESET 108 -#define IBCS2_ENOBUFS IBCS2_ENOSR -#define IBCS2_EISCONN 110 -#define IBCS2_ENOTCONN 111 -#define IBCS2_ESHUTDOWN 112 -#define IBCS2_ETOOMANYREFS 113 -#define IBCS2_ETIMEDOUT 114 -#define IBCS2_ECONNREFUSED 115 -#define IBCS2_EHOSTDOWN 116 -#define IBCS2_EHOSTUNREACH 117 -#define IBCS2_ENOPROTOOPT 118 -#define IBCS2_ENOTEMPTY 145 -#define IBCS2_ELOOP 150 -#else -#define IBCS2_ELOOP 90 -#define IBCS2_EWOULDBLOCK 90 -#define IBCS2_ERESTART 91 -#define IBCS2_ESTRPIPE 92 -#define IBCS2_ENOTEMPTY 93 -#define IBCS2_EUSERS 94 -#endif - -#define IBCS2_ESTALE 151 -#define IBCS2_EIORESID 500 - -extern int bsd2ibcs_errno[]; - -#endif /* _IBCS2_ERRNO_H */ diff --git a/sys/i386/ibcs2/ibcs2_fcntl.c b/sys/i386/ibcs2/ibcs2_fcntl.c deleted file mode 100644 index 39156821055..00000000000 --- a/sys/i386/ibcs2/ibcs2_fcntl.c +++ /dev/null @@ -1,319 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1995 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include "opt_spx_hack.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -static void cvt_iflock2flock(struct ibcs2_flock *, struct flock *); -static void cvt_flock2iflock(struct flock *, struct ibcs2_flock *); -static int cvt_o_flags(int); -static int oflags2ioflags(int); -static int ioflags2oflags(int); - -static int -cvt_o_flags(flags) - int flags; -{ - int r = 0; - - /* convert mode into NetBSD mode */ - if (flags & IBCS2_O_WRONLY) r |= O_WRONLY; - if (flags & IBCS2_O_RDWR) r |= O_RDWR; - if (flags & (IBCS2_O_NDELAY | IBCS2_O_NONBLOCK)) r |= O_NONBLOCK; - if (flags & IBCS2_O_APPEND) r |= O_APPEND; - if (flags & IBCS2_O_SYNC) r |= O_FSYNC; - if (flags & IBCS2_O_CREAT) r |= O_CREAT; - if (flags & IBCS2_O_TRUNC) r |= O_TRUNC /* | O_CREAT ??? */; - if (flags & IBCS2_O_EXCL) r |= O_EXCL; - if (flags & IBCS2_O_RDONLY) r |= O_RDONLY; - if (flags & IBCS2_O_PRIV) r |= O_EXLOCK; - if (flags & IBCS2_O_NOCTTY) r |= O_NOCTTY; - return r; -} - -static void -cvt_flock2iflock(flp, iflp) - struct flock *flp; - struct ibcs2_flock *iflp; -{ - switch (flp->l_type) { - case F_RDLCK: - iflp->l_type = IBCS2_F_RDLCK; - break; - case F_WRLCK: - iflp->l_type = IBCS2_F_WRLCK; - break; - case F_UNLCK: - iflp->l_type = IBCS2_F_UNLCK; - break; - } - iflp->l_whence = (short)flp->l_whence; - iflp->l_start = (ibcs2_off_t)flp->l_start; - iflp->l_len = (ibcs2_off_t)flp->l_len; - iflp->l_sysid = flp->l_sysid; - iflp->l_pid = (ibcs2_pid_t)flp->l_pid; -} - -#ifdef DEBUG_IBCS2 -static void -print_flock(struct flock *flp) -{ - printf("flock: start=%x len=%x pid=%d type=%d whence=%d\n", - (int)flp->l_start, (int)flp->l_len, (int)flp->l_pid, - flp->l_type, flp->l_whence); -} -#endif - -static void -cvt_iflock2flock(iflp, flp) - struct ibcs2_flock *iflp; - struct flock *flp; -{ - flp->l_start = (off_t)iflp->l_start; - flp->l_len = (off_t)iflp->l_len; - flp->l_pid = (pid_t)iflp->l_pid; - switch (iflp->l_type) { - case IBCS2_F_RDLCK: - flp->l_type = F_RDLCK; - break; - case IBCS2_F_WRLCK: - flp->l_type = F_WRLCK; - break; - case IBCS2_F_UNLCK: - flp->l_type = F_UNLCK; - break; - } - flp->l_whence = iflp->l_whence; - flp->l_sysid = iflp->l_sysid; -} - -/* convert iBCS2 mode into NetBSD mode */ -static int -ioflags2oflags(flags) - int flags; -{ - int r = 0; - - if (flags & IBCS2_O_RDONLY) r |= O_RDONLY; - if (flags & IBCS2_O_WRONLY) r |= O_WRONLY; - if (flags & IBCS2_O_RDWR) r |= O_RDWR; - if (flags & IBCS2_O_NDELAY) r |= O_NONBLOCK; - if (flags & IBCS2_O_APPEND) r |= O_APPEND; - if (flags & IBCS2_O_SYNC) r |= O_FSYNC; - if (flags & IBCS2_O_NONBLOCK) r |= O_NONBLOCK; - if (flags & IBCS2_O_CREAT) r |= O_CREAT; - if (flags & IBCS2_O_TRUNC) r |= O_TRUNC; - if (flags & IBCS2_O_EXCL) r |= O_EXCL; - if (flags & IBCS2_O_NOCTTY) r |= O_NOCTTY; - return r; -} - -/* convert NetBSD mode into iBCS2 mode */ -static int -oflags2ioflags(flags) - int flags; -{ - int r = 0; - - if (flags & O_RDONLY) r |= IBCS2_O_RDONLY; - if (flags & O_WRONLY) r |= IBCS2_O_WRONLY; - if (flags & O_RDWR) r |= IBCS2_O_RDWR; - if (flags & O_NDELAY) r |= IBCS2_O_NONBLOCK; - if (flags & O_APPEND) r |= IBCS2_O_APPEND; - if (flags & O_FSYNC) r |= IBCS2_O_SYNC; - if (flags & O_NONBLOCK) r |= IBCS2_O_NONBLOCK; - if (flags & O_CREAT) r |= IBCS2_O_CREAT; - if (flags & O_TRUNC) r |= IBCS2_O_TRUNC; - if (flags & O_EXCL) r |= IBCS2_O_EXCL; - if (flags & O_NOCTTY) r |= IBCS2_O_NOCTTY; - return r; -} - -int -ibcs2_open(td, uap) - struct thread *td; - struct ibcs2_open_args *uap; -{ - struct proc *p; - char *path; - int flags, noctty, ret; - - p = td->td_proc; - noctty = uap->flags & IBCS2_O_NOCTTY; - flags = cvt_o_flags(uap->flags); - if (uap->flags & O_CREAT) - CHECKALTCREAT(td, uap->path, &path); - else - CHECKALTEXIST(td, uap->path, &path); - ret = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, flags, uap->mode); - -#ifdef SPX_HACK - if (ret == ENXIO) { - if (!strcmp(path, "/compat/ibcs2/dev/spx")) - ret = spx_open(td); - free(path, M_TEMP); - } else -#endif /* SPX_HACK */ - free(path, M_TEMP); - PROC_LOCK(p); - if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { - cap_rights_t rights; - struct file *fp; - int error; - - error = fget(td, td->td_retval[0], - cap_rights_init(&rights, CAP_IOCTL), &fp); - PROC_UNLOCK(p); - if (error) - return (EBADF); - - /* ignore any error, just give it a try */ - if (fp->f_type == DTYPE_VNODE) - fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td->td_ucred, - td); - fdrop(fp, td); - } else - PROC_UNLOCK(p); - return ret; -} - -int -ibcs2_creat(td, uap) - struct thread *td; - struct ibcs2_creat_args *uap; -{ - char *path; - int error; - - CHECKALTCREAT(td, uap->path, &path); - error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, - O_WRONLY | O_CREAT | O_TRUNC, uap->mode); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_access(td, uap) - struct thread *td; - struct ibcs2_access_args *uap; -{ - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE, 0, uap->amode); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_fcntl(td, uap) - struct thread *td; - struct ibcs2_fcntl_args *uap; -{ - intptr_t arg; - int error; - struct flock fl; - struct ibcs2_flock ifl; - - arg = (intptr_t)uap->arg; - switch(uap->cmd) { - case IBCS2_F_DUPFD: - return (kern_fcntl(td, uap->fd, F_DUPFD, arg)); - case IBCS2_F_GETFD: - return (kern_fcntl(td, uap->fd, F_GETFD, arg)); - case IBCS2_F_SETFD: - return (kern_fcntl(td, uap->fd, F_SETFD, arg)); - case IBCS2_F_GETFL: - error = kern_fcntl(td, uap->fd, F_GETFL, arg); - if (error) - return error; - td->td_retval[0] = oflags2ioflags(td->td_retval[0]); - return error; - case IBCS2_F_SETFL: - return (kern_fcntl(td, uap->fd, F_SETFL, - ioflags2oflags(arg))); - - case IBCS2_F_GETLK: - { - error = copyin((caddr_t)uap->arg, (caddr_t)&ifl, - ibcs2_flock_len); - if (error) - return error; - cvt_iflock2flock(&ifl, &fl); - error = kern_fcntl(td, uap->fd, F_GETLK, (intptr_t)&fl); - if (error) - return error; - cvt_flock2iflock(&fl, &ifl); - return copyout((caddr_t)&ifl, (caddr_t)uap->arg, - ibcs2_flock_len); - } - - case IBCS2_F_SETLK: - { - error = copyin((caddr_t)uap->arg, (caddr_t)&ifl, - ibcs2_flock_len); - if (error) - return error; - cvt_iflock2flock(&ifl, &fl); - return (kern_fcntl(td, uap->fd, F_SETLK, (intptr_t)&fl)); - } - - case IBCS2_F_SETLKW: - { - error = copyin((caddr_t)uap->arg, (caddr_t)&ifl, - ibcs2_flock_len); - if (error) - return error; - cvt_iflock2flock(&ifl, &fl); - return (kern_fcntl(td, uap->fd, F_SETLKW, (intptr_t)&fl)); - } - } - return ENOSYS; -} diff --git a/sys/i386/ibcs2/ibcs2_fcntl.h b/sys/i386/ibcs2/ibcs2_fcntl.h deleted file mode 100644 index ee12d2a6aea..00000000000 --- a/sys/i386/ibcs2/ibcs2_fcntl.h +++ /dev/null @@ -1,80 +0,0 @@ -/* $NetBSD: ibcs2_fcntl.h,v 1.2 1994/10/26 02:52:54 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_FCNTL_H -#define _IBCS2_FCNTL_H 1 - -#include - -#define IBCS2_O_RDONLY 0x0000 -#define IBCS2_O_WRONLY 0x0001 -#define IBCS2_O_RDWR 0x0002 -#define IBCS2_O_NDELAY 0x0004 -#define IBCS2_O_APPEND 0x0008 -#define IBCS2_O_SYNC 0x0010 -#define IBCS2_O_NONBLOCK 0x0080 -#define IBCS2_O_CREAT 0x0100 -#define IBCS2_O_TRUNC 0x0200 -#define IBCS2_O_EXCL 0x0400 -#define IBCS2_O_NOCTTY 0x0800 -#define IBCS2_O_PRIV 0x1000 - -#define IBCS2_F_DUPFD 0 -#define IBCS2_F_GETFD 1 -#define IBCS2_F_SETFD 2 -#define IBCS2_F_GETFL 3 -#define IBCS2_F_SETFL 4 -#define IBCS2_F_GETLK 5 -#define IBCS2_F_SETLK 6 -#define IBCS2_F_SETLKW 7 - -struct ibcs2_flock { - short l_type; - short l_whence; - ibcs2_off_t l_start; - ibcs2_off_t l_len; - short l_sysid; - ibcs2_pid_t l_pid; -}; -#define ibcs2_flock_len (sizeof(struct ibcs2_flock)) - -#define IBCS2_F_RDLCK 1 -#define IBCS2_F_WRLCK 2 -#define IBCS2_F_UNLCK 3 - -#define IBCS2_O_ACCMODE 3 -#define IBCS2_FD_CLOEXEC 1 - -#endif /* _IBCS2_FCNTL_H */ diff --git a/sys/i386/ibcs2/ibcs2_ioctl.c b/sys/i386/ibcs2/ibcs2_ioctl.c deleted file mode 100644 index 75352a51e24..00000000000 --- a/sys/i386/ibcs2/ibcs2_ioctl.c +++ /dev/null @@ -1,691 +0,0 @@ -/* $NetBSD: ibcs2_ioctl.c,v 1.6 1995/03/14 15:12:28 scottb Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 1994, 1995 Scott Bartram - * All rights reserved. - * - * based on compat/sunos/sun_ioctl.c - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -static void stios2btios(struct ibcs2_termios *, struct termios *); -static void btios2stios(struct termios *, struct ibcs2_termios *); -static void stios2stio(struct ibcs2_termios *, struct ibcs2_termio *); -static void stio2stios(struct ibcs2_termio *, struct ibcs2_termios *); - -/* - * iBCS2 ioctl calls. - */ - -struct speedtab { - int sp_speed; /* Speed. */ - int sp_code; /* Code. */ -}; - -static struct speedtab sptab[] = { - { 0, 0 }, - { 50, 1 }, - { 75, 2 }, - { 110, 3 }, - { 134, 4 }, - { 135, 4 }, - { 150, 5 }, - { 200, 6 }, - { 300, 7 }, - { 600, 8 }, - { 1200, 9 }, - { 1800, 10 }, - { 2400, 11 }, - { 4800, 12 }, - { 9600, 13 }, - { 19200, 14 }, - { 38400, 15 }, - { -1, -1 } -}; - -static u_long s2btab[] = { - 0, - 50, - 75, - 110, - 134, - 150, - 200, - 300, - 600, - 1200, - 1800, - 2400, - 4800, - 9600, - 19200, - 38400, -}; - -static int -ttspeedtab(int speed, struct speedtab *table) -{ - - for ( ; table->sp_speed != -1; table++) - if (table->sp_speed == speed) - return (table->sp_code); - return (-1); -} - -static void -stios2btios(st, bt) - struct ibcs2_termios *st; - struct termios *bt; -{ - register u_long l, r; - - l = st->c_iflag; r = 0; - if (l & IBCS2_IGNBRK) r |= IGNBRK; - if (l & IBCS2_BRKINT) r |= BRKINT; - if (l & IBCS2_IGNPAR) r |= IGNPAR; - if (l & IBCS2_PARMRK) r |= PARMRK; - if (l & IBCS2_INPCK) r |= INPCK; - if (l & IBCS2_ISTRIP) r |= ISTRIP; - if (l & IBCS2_INLCR) r |= INLCR; - if (l & IBCS2_IGNCR) r |= IGNCR; - if (l & IBCS2_ICRNL) r |= ICRNL; - if (l & IBCS2_IXON) r |= IXON; - if (l & IBCS2_IXANY) r |= IXANY; - if (l & IBCS2_IXOFF) r |= IXOFF; - if (l & IBCS2_IMAXBEL) r |= IMAXBEL; - bt->c_iflag = r; - - l = st->c_oflag; r = 0; - if (l & IBCS2_OPOST) r |= OPOST; - if (l & IBCS2_ONLCR) r |= ONLCR; - if (l & IBCS2_TAB3) r |= TAB3; - bt->c_oflag = r; - - l = st->c_cflag; r = 0; - switch (l & IBCS2_CSIZE) { - case IBCS2_CS5: r |= CS5; break; - case IBCS2_CS6: r |= CS6; break; - case IBCS2_CS7: r |= CS7; break; - case IBCS2_CS8: r |= CS8; break; - } - if (l & IBCS2_CSTOPB) r |= CSTOPB; - if (l & IBCS2_CREAD) r |= CREAD; - if (l & IBCS2_PARENB) r |= PARENB; - if (l & IBCS2_PARODD) r |= PARODD; - if (l & IBCS2_HUPCL) r |= HUPCL; - if (l & IBCS2_CLOCAL) r |= CLOCAL; - bt->c_cflag = r; - - bt->c_ispeed = bt->c_ospeed = s2btab[l & 0x0000000f]; - - l = st->c_lflag; r = 0; - if (l & IBCS2_ISIG) r |= ISIG; - if (l & IBCS2_ICANON) r |= ICANON; - if (l & IBCS2_ECHO) r |= ECHO; - if (l & IBCS2_ECHOE) r |= ECHOE; - if (l & IBCS2_ECHOK) r |= ECHOK; - if (l & IBCS2_ECHONL) r |= ECHONL; - if (l & IBCS2_NOFLSH) r |= NOFLSH; - if (l & IBCS2_TOSTOP) r |= TOSTOP; - bt->c_lflag = r; - - bt->c_cc[VINTR] = - st->c_cc[IBCS2_VINTR] ? st->c_cc[IBCS2_VINTR] : _POSIX_VDISABLE; - bt->c_cc[VQUIT] = - st->c_cc[IBCS2_VQUIT] ? st->c_cc[IBCS2_VQUIT] : _POSIX_VDISABLE; - bt->c_cc[VERASE] = - st->c_cc[IBCS2_VERASE] ? st->c_cc[IBCS2_VERASE] : _POSIX_VDISABLE; - bt->c_cc[VKILL] = - st->c_cc[IBCS2_VKILL] ? st->c_cc[IBCS2_VKILL] : _POSIX_VDISABLE; - if (bt->c_lflag & ICANON) { - bt->c_cc[VEOF] = - st->c_cc[IBCS2_VEOF] ? st->c_cc[IBCS2_VEOF] : _POSIX_VDISABLE; - bt->c_cc[VEOL] = - st->c_cc[IBCS2_VEOL] ? st->c_cc[IBCS2_VEOL] : _POSIX_VDISABLE; - } else { - bt->c_cc[VMIN] = st->c_cc[IBCS2_VMIN]; - bt->c_cc[VTIME] = st->c_cc[IBCS2_VTIME]; - } - bt->c_cc[VEOL2] = - st->c_cc[IBCS2_VEOL2] ? st->c_cc[IBCS2_VEOL2] : _POSIX_VDISABLE; -#if 0 - bt->c_cc[VSWTCH] = - st->c_cc[IBCS2_VSWTCH] ? st->c_cc[IBCS2_VSWTCH] : _POSIX_VDISABLE; -#endif - bt->c_cc[VSTART] = - st->c_cc[IBCS2_VSTART] ? st->c_cc[IBCS2_VSTART] : _POSIX_VDISABLE; - bt->c_cc[VSTOP] = - st->c_cc[IBCS2_VSTOP] ? st->c_cc[IBCS2_VSTOP] : _POSIX_VDISABLE; - bt->c_cc[VSUSP] = - st->c_cc[IBCS2_VSUSP] ? st->c_cc[IBCS2_VSUSP] : _POSIX_VDISABLE; - bt->c_cc[VDSUSP] = _POSIX_VDISABLE; - bt->c_cc[VREPRINT] = _POSIX_VDISABLE; - bt->c_cc[VDISCARD] = _POSIX_VDISABLE; - bt->c_cc[VWERASE] = _POSIX_VDISABLE; - bt->c_cc[VLNEXT] = _POSIX_VDISABLE; - bt->c_cc[VSTATUS] = _POSIX_VDISABLE; -} - -static void -btios2stios(bt, st) - struct termios *bt; - struct ibcs2_termios *st; -{ - register u_long l, r; - - l = bt->c_iflag; r = 0; - if (l & IGNBRK) r |= IBCS2_IGNBRK; - if (l & BRKINT) r |= IBCS2_BRKINT; - if (l & IGNPAR) r |= IBCS2_IGNPAR; - if (l & PARMRK) r |= IBCS2_PARMRK; - if (l & INPCK) r |= IBCS2_INPCK; - if (l & ISTRIP) r |= IBCS2_ISTRIP; - if (l & INLCR) r |= IBCS2_INLCR; - if (l & IGNCR) r |= IBCS2_IGNCR; - if (l & ICRNL) r |= IBCS2_ICRNL; - if (l & IXON) r |= IBCS2_IXON; - if (l & IXANY) r |= IBCS2_IXANY; - if (l & IXOFF) r |= IBCS2_IXOFF; - if (l & IMAXBEL) r |= IBCS2_IMAXBEL; - st->c_iflag = r; - - l = bt->c_oflag; r = 0; - if (l & OPOST) r |= IBCS2_OPOST; - if (l & ONLCR) r |= IBCS2_ONLCR; - if (l & TAB3) r |= IBCS2_TAB3; - st->c_oflag = r; - - l = bt->c_cflag; r = 0; - switch (l & CSIZE) { - case CS5: r |= IBCS2_CS5; break; - case CS6: r |= IBCS2_CS6; break; - case CS7: r |= IBCS2_CS7; break; - case CS8: r |= IBCS2_CS8; break; - } - if (l & CSTOPB) r |= IBCS2_CSTOPB; - if (l & CREAD) r |= IBCS2_CREAD; - if (l & PARENB) r |= IBCS2_PARENB; - if (l & PARODD) r |= IBCS2_PARODD; - if (l & HUPCL) r |= IBCS2_HUPCL; - if (l & CLOCAL) r |= IBCS2_CLOCAL; - st->c_cflag = r; - - l = bt->c_lflag; r = 0; - if (l & ISIG) r |= IBCS2_ISIG; - if (l & ICANON) r |= IBCS2_ICANON; - if (l & ECHO) r |= IBCS2_ECHO; - if (l & ECHOE) r |= IBCS2_ECHOE; - if (l & ECHOK) r |= IBCS2_ECHOK; - if (l & ECHONL) r |= IBCS2_ECHONL; - if (l & NOFLSH) r |= IBCS2_NOFLSH; - if (l & TOSTOP) r |= IBCS2_TOSTOP; - st->c_lflag = r; - - l = ttspeedtab(bt->c_ospeed, sptab); - if ((int)l >= 0) - st->c_cflag |= l; - - st->c_cc[IBCS2_VINTR] = - bt->c_cc[VINTR] != _POSIX_VDISABLE ? bt->c_cc[VINTR] : 0; - st->c_cc[IBCS2_VQUIT] = - bt->c_cc[VQUIT] != _POSIX_VDISABLE ? bt->c_cc[VQUIT] : 0; - st->c_cc[IBCS2_VERASE] = - bt->c_cc[VERASE] != _POSIX_VDISABLE ? bt->c_cc[VERASE] : 0; - st->c_cc[IBCS2_VKILL] = - bt->c_cc[VKILL] != _POSIX_VDISABLE ? bt->c_cc[VKILL] : 0; - if (bt->c_lflag & ICANON) { - st->c_cc[IBCS2_VEOF] = - bt->c_cc[VEOF] != _POSIX_VDISABLE ? bt->c_cc[VEOF] : 0; - st->c_cc[IBCS2_VEOL] = - bt->c_cc[VEOL] != _POSIX_VDISABLE ? bt->c_cc[VEOL] : 0; - } else { - st->c_cc[IBCS2_VMIN] = bt->c_cc[VMIN]; - st->c_cc[IBCS2_VTIME] = bt->c_cc[VTIME]; - } - st->c_cc[IBCS2_VEOL2] = - bt->c_cc[VEOL2] != _POSIX_VDISABLE ? bt->c_cc[VEOL2] : 0; - st->c_cc[IBCS2_VSWTCH] = - 0; - st->c_cc[IBCS2_VSUSP] = - bt->c_cc[VSUSP] != _POSIX_VDISABLE ? bt->c_cc[VSUSP] : 0; - st->c_cc[IBCS2_VSTART] = - bt->c_cc[VSTART] != _POSIX_VDISABLE ? bt->c_cc[VSTART] : 0; - st->c_cc[IBCS2_VSTOP] = - bt->c_cc[VSTOP] != _POSIX_VDISABLE ? bt->c_cc[VSTOP] : 0; - - st->c_line = 0; -} - -static void -stios2stio(ts, t) - struct ibcs2_termios *ts; - struct ibcs2_termio *t; -{ - t->c_iflag = ts->c_iflag; - t->c_oflag = ts->c_oflag; - t->c_cflag = ts->c_cflag; - t->c_lflag = ts->c_lflag; - t->c_line = ts->c_line; - bcopy(ts->c_cc, t->c_cc, IBCS2_NCC); -} - -static void -stio2stios(t, ts) - struct ibcs2_termio *t; - struct ibcs2_termios *ts; -{ - ts->c_iflag = t->c_iflag; - ts->c_oflag = t->c_oflag; - ts->c_cflag = t->c_cflag; - ts->c_lflag = t->c_lflag; - ts->c_line = t->c_line; - bcopy(t->c_cc, ts->c_cc, IBCS2_NCC); -} - -int -ibcs2_ioctl(td, uap) - struct thread *td; - struct ibcs2_ioctl_args *uap; -{ - struct proc *p = td->td_proc; - cap_rights_t rights; - struct file *fp; - int error; - - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_IOCTL), &fp); - if (error != 0) { - DPRINTF(("ibcs2_ioctl(%d): bad fd %d ", p->p_pid, - uap->fd)); - return EBADF; - } - - if ((fp->f_flag & (FREAD|FWRITE)) == 0) { - fdrop(fp, td); - DPRINTF(("ibcs2_ioctl(%d): bad fp flag ", p->p_pid)); - return EBADF; - } - - switch (uap->cmd) { - case IBCS2_TCGETA: - case IBCS2_XCGETA: - case IBCS2_OXCGETA: - { - struct termios bts; - struct ibcs2_termios sts; - struct ibcs2_termio st; - - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts, - td->td_ucred, td)) != 0) - break; - - btios2stios (&bts, &sts); - if (uap->cmd == IBCS2_TCGETA) { - stios2stio (&sts, &st); - error = copyout((caddr_t)&st, uap->data, - sizeof (st)); -#ifdef DEBUG_IBCS2 - if (error) - DPRINTF(("ibcs2_ioctl(%d): copyout failed ", - p->p_pid)); -#endif - break; - } else { - error = copyout((caddr_t)&sts, uap->data, - sizeof (sts)); - break; - } - /*NOTREACHED*/ - } - - case IBCS2_TCSETA: - case IBCS2_TCSETAW: - case IBCS2_TCSETAF: - { - struct termios bts; - struct ibcs2_termios sts; - struct ibcs2_termio st; - - if ((error = copyin(uap->data, (caddr_t)&st, - sizeof(st))) != 0) { - DPRINTF(("ibcs2_ioctl(%d): TCSET copyin failed ", - p->p_pid)); - break; - } - - /* get full BSD termios so we don't lose information */ - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts, - td->td_ucred, td)) != 0) { - DPRINTF(("ibcs2_ioctl(%d): TCSET ctl failed fd %d ", - p->p_pid, uap->fd)); - break; - } - - /* - * convert to iBCS2 termios, copy in information from - * termio, and convert back, then set new values. - */ - btios2stios(&bts, &sts); - stio2stios(&st, &sts); - stios2btios(&sts, &bts); - - error = fo_ioctl(fp, uap->cmd - IBCS2_TCSETA + TIOCSETA, - (caddr_t)&bts, td->td_ucred, td); - break; - } - - case IBCS2_XCSETA: - case IBCS2_XCSETAW: - case IBCS2_XCSETAF: - { - struct termios bts; - struct ibcs2_termios sts; - - if ((error = copyin(uap->data, (caddr_t)&sts, - sizeof (sts))) != 0) - break; - stios2btios (&sts, &bts); - error = fo_ioctl(fp, uap->cmd - IBCS2_XCSETA + TIOCSETA, - (caddr_t)&bts, td->td_ucred, td); - break; - } - - case IBCS2_OXCSETA: - case IBCS2_OXCSETAW: - case IBCS2_OXCSETAF: - { - struct termios bts; - struct ibcs2_termios sts; - - if ((error = copyin(uap->data, (caddr_t)&sts, - sizeof (sts))) != 0) - break; - stios2btios (&sts, &bts); - error = fo_ioctl(fp, uap->cmd - IBCS2_OXCSETA + TIOCSETA, - (caddr_t)&bts, td->td_ucred, td); - break; - } - - case IBCS2_TCSBRK: - DPRINTF(("ibcs2_ioctl(%d): TCSBRK ", p->p_pid)); - error = ENOSYS; - break; - - case IBCS2_TCXONC: - { - switch ((int)uap->data) { - case 0: - case 1: - DPRINTF(("ibcs2_ioctl(%d): TCXONC ", p->p_pid)); - error = ENOSYS; - break; - case 2: - error = fo_ioctl(fp, TIOCSTOP, (caddr_t)0, - td->td_ucred, td); - break; - case 3: - error = fo_ioctl(fp, TIOCSTART, (caddr_t)1, - td->td_ucred, td); - break; - default: - error = EINVAL; - break; - } - break; - } - - case IBCS2_TCFLSH: - { - int arg; - - switch ((int)uap->data) { - case 0: - arg = FREAD; - break; - case 1: - arg = FWRITE; - break; - case 2: - arg = FREAD | FWRITE; - break; - default: - fdrop(fp, td); - return EINVAL; - } - error = fo_ioctl(fp, TIOCFLUSH, (caddr_t)&arg, td->td_ucred, - td); - break; - } - - case IBCS2_TIOCGWINSZ: - uap->cmd = TIOCGWINSZ; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_TIOCSWINSZ: - uap->cmd = TIOCSWINSZ; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_TIOCGPGRP: - { - pid_t pg_id; - - PROC_LOCK(p); - pg_id = p->p_pgrp->pg_id; - PROC_UNLOCK(p); - error = copyout((caddr_t)&pg_id, uap->data, - sizeof(pg_id)); - break; - } - - case IBCS2_TIOCSPGRP: /* XXX - is uap->data a pointer to pgid? */ - { - struct setpgid_args sa; - - sa.pid = 0; - sa.pgid = (int)uap->data; - error = sys_setpgid(td, &sa); - break; - } - - case IBCS2_TCGETSC: /* SCO console - get scancode flags */ - error = EINTR; /* ENOSYS; */ - break; - - case IBCS2_TCSETSC: /* SCO console - set scancode flags */ - error = 0; /* ENOSYS; */ - break; - - case IBCS2_JWINSIZE: /* Unix to Jerq I/O control */ - { - struct ibcs2_jwinsize { - char bytex, bytey; - short bitx, bity; - } ibcs2_jwinsize; - - PROC_LOCK(p); - SESS_LOCK(p->p_session); - ibcs2_jwinsize.bytex = 80; - /* p->p_session->s_ttyp->t_winsize.ws_col; XXX */ - ibcs2_jwinsize.bytey = 25; - /* p->p_session->s_ttyp->t_winsize.ws_row; XXX */ - ibcs2_jwinsize.bitx = - p->p_session->s_ttyp->t_winsize.ws_xpixel; - ibcs2_jwinsize.bity = - p->p_session->s_ttyp->t_winsize.ws_ypixel; - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); - error = copyout((caddr_t)&ibcs2_jwinsize, uap->data, - sizeof(ibcs2_jwinsize)); - break; - } - - /* keyboard and display ioctl's -- type 'K' */ - case IBCS2_KDGKBMODE: /* get keyboard translation mode */ - uap->cmd = KDGKBMODE; -/* printf("ioctl KDGKBMODE = %x\n", uap->cmd);*/ - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDSKBMODE: /* set keyboard translation mode */ - uap->cmd = KDSKBMODE; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDMKTONE: /* sound tone */ - uap->cmd = KDMKTONE; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDGETMODE: /* get text/graphics mode */ - uap->cmd = KDGETMODE; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDSETMODE: /* set text/graphics mode */ - uap->cmd = KDSETMODE; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDSBORDER: /* set ega color border */ - uap->cmd = KDSBORDER; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDGKBSTATE: - uap->cmd = KDGKBSTATE; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDSETRAD: - uap->cmd = KDSETRAD; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDENABIO: /* enable direct I/O to ports */ - uap->cmd = KDENABIO; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDDISABIO: /* disable direct I/O to ports */ - uap->cmd = KDDISABIO; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KIOCSOUND: /* start sound generation */ - uap->cmd = KIOCSOUND; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDGKBTYPE: /* get keyboard type */ - uap->cmd = KDGKBTYPE; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDGETLED: /* get keyboard LED status */ - uap->cmd = KDGETLED; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_KDSETLED: /* set keyboard LED status */ - uap->cmd = KDSETLED; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - /* Xenix keyboard and display ioctl's from sys/kd.h -- type 'k' */ - case IBCS2_GETFKEY: /* Get function key */ - uap->cmd = GETFKEY; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_SETFKEY: /* Set function key */ - uap->cmd = SETFKEY; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_GIO_SCRNMAP: /* Get screen output map table */ - uap->cmd = GIO_SCRNMAP; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_PIO_SCRNMAP: /* Set screen output map table */ - uap->cmd = PIO_SCRNMAP; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_GIO_KEYMAP: /* Get keyboard map table */ - uap->cmd = OGIO_KEYMAP; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - case IBCS2_PIO_KEYMAP: /* Set keyboard map table */ - uap->cmd = OPIO_KEYMAP; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - /* socksys */ - case IBCS2_SIOCSOCKSYS: - error = ibcs2_socksys(td, (struct ibcs2_socksys_args *)uap); - break; - - case IBCS2_FIONREAD: - case IBCS2_I_NREAD: /* STREAMS */ - uap->cmd = FIONREAD; - error = sys_ioctl(td, (struct ioctl_args *)uap); - break; - - default: - DPRINTF(("ibcs2_ioctl(%d): unknown cmd 0x%lx ", - td->proc->p_pid, uap->cmd)); - error = ENOSYS; - break; - } - - fdrop(fp, td); - return error; -} diff --git a/sys/i386/ibcs2/ibcs2_ioctl.h b/sys/i386/ibcs2/ibcs2_ioctl.h deleted file mode 100644 index eb66cb00f65..00000000000 --- a/sys/i386/ibcs2/ibcs2_ioctl.h +++ /dev/null @@ -1,55 +0,0 @@ -/* misc IOCTL's */ - -/* Unix to Jerq I/O control */ -#define IBCS2_JTYPE ('j'<<8) -#define IBCS2_JBOOT (IBCS2_JTYPE|1) -#define IBCS2_JTERM (IBCS2_JTYPE|2) -#define IBCS2_JMPX (IBCS2_JTYPE|3) -#define IBCS2_JTIMO (IBCS2_JTYPE|4) -#define IBCS2_JWINSIZE (IBCS2_JTYPE|5) -#define IBCS2_JTIMOM (IBCS2_JTYPE|6) -#define IBCS2_JZOMBOOT (IBCS2_JTYPE|7) -#define IBCS2_JAGENT (IBCS2_JTYPE|9) -#define IBCS2_JTRUN (IBCS2_JTYPE|10) - - -/* Defines for keyboard and display ioctl's */ -#define IBCS2_KIOC ('K'<<8) -#define IBCS2_KDDISPTYPE (IBCS2_KIOC|1) -#define IBCS2_KDMAPDISP (IBCS2_KIOC|2) -#define IBCS2_KDUNMAPDISP (IBCS2_KIOC|3) -#define IBCS2_KDGKBENT (IBCS2_KIOC|4) -#define IBCS2_KDSKBENT (IBCS2_KIOC|5) -#define IBCS2_KDGKBMODE (IBCS2_KIOC|6) -#define IBCS2_KDSKBMODE (IBCS2_KIOC|7) -#define IBCS2_KDMKTONE (IBCS2_KIOC|8) -#define IBCS2_KDGETMODE (IBCS2_KIOC|9) -#define IBCS2_KDSETMODE (IBCS2_KIOC|10) -#define IBCS2_KDADDIO (IBCS2_KIOC|11) -#define IBCS2_KDDELIO (IBCS2_KIOC|12) -#define IBCS2_KDSBORDER (IBCS2_KIOC|13) -#define IBCS2_KDQUEMODE (IBCS2_KIOC|15) -#define IBCS2_KDVDCTYPE (IBCS2_KIOC|16) -#define IBCS2_KDGKBSTATE (IBCS2_KIOC|19) -#define IBCS2_KDSETRAD (IBCS2_KIOC|20) -#define IBCS2_KDENABIO (IBCS2_KIOC|60) -#define IBCS2_KDDISABIO (IBCS2_KIOC|61) -#define IBCS2_KIOCINFO (IBCS2_KIOC|62) -#define IBCS2_KIOCSOUND (IBCS2_KIOC|63) -#define IBCS2_KDGKBTYPE (IBCS2_KIOC|64) -#define IBCS2_KDGETLED (IBCS2_KIOC|65) -#define IBCS2_KDSETLED (IBCS2_KIOC|66) - - -/* Defines for Xenix keyboard and display ioctl's */ -#define IBCS2_MIOC ('k' << 8) -#define IBCS2_GETFKEY (IBCS2_MIOC | 0) -#define IBCS2_SETFKEY (IBCS2_MIOC | 1) -#define IBCS2_GIO_SCRNMAP (IBCS2_MIOC | 2) -#define IBCS2_PIO_SCRNMAP (IBCS2_MIOC | 3) -#define IBCS2_GIO_STRMAP_21 (IBCS2_MIOC | 4) -#define IBCS2_PIO_STRMAP_21 (IBCS2_MIOC | 5) -#define IBCS2_GIO_KEYMAP (IBCS2_MIOC | 6) -#define IBCS2_PIO_KEYMAP (IBCS2_MIOC | 7) -#define IBCS2_GIO_STRMAP (IBCS2_MIOC | 11) -#define IBCS2_PIO_STRMAP (IBCS2_MIOC | 12) diff --git a/sys/i386/ibcs2/ibcs2_ipc.c b/sys/i386/ibcs2/ibcs2_ipc.c deleted file mode 100644 index ae4a4c74760..00000000000 --- a/sys/i386/ibcs2/ibcs2_ipc.c +++ /dev/null @@ -1,562 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1995 Scott Bartram - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define IBCS2_IPC_RMID 0 -#define IBCS2_IPC_SET 1 -#define IBCS2_IPC_STAT 2 -#define IBCS2_SETVAL 8 - - - -static void cvt_msqid2imsqid(struct msqid_ds *, struct ibcs2_msqid_ds *); -static void cvt_imsqid2msqid(struct ibcs2_msqid_ds *, struct msqid_ds *); -#ifdef unused -static void cvt_sem2isem(struct sem *, struct ibcs2_sem *); -static void cvt_isem2sem(struct ibcs2_sem *, struct sem *); -#endif -static void cvt_semid2isemid(struct semid_ds *, struct ibcs2_semid_ds *); -static void cvt_isemid2semid(struct ibcs2_semid_ds *, struct semid_ds *); -static void cvt_shmid2ishmid(struct shmid_ds *, struct ibcs2_shmid_ds *); -static void cvt_ishmid2shmid(struct ibcs2_shmid_ds *, struct shmid_ds *); -static void cvt_perm2iperm(struct ipc_perm *, struct ibcs2_ipc_perm *); -static void cvt_iperm2perm(struct ibcs2_ipc_perm *, struct ipc_perm *); - - -/* - * iBCS2 msgsys call - */ - -static void -cvt_msqid2imsqid(bp, ibp) -struct msqid_ds *bp; -struct ibcs2_msqid_ds *ibp; -{ - memset(ibp, 0, sizeof(*ibp)); - cvt_perm2iperm(&bp->msg_perm, &ibp->msg_perm); - ibp->msg_cbytes = (u_short)bp->msg_cbytes; - ibp->msg_qnum = (u_short)bp->msg_qnum; - ibp->msg_qbytes = (u_short)bp->msg_qbytes; - ibp->msg_lspid = (u_short)bp->msg_lspid; - ibp->msg_lrpid = (u_short)bp->msg_lrpid; - ibp->msg_stime = bp->msg_stime; - ibp->msg_rtime = bp->msg_rtime; - ibp->msg_ctime = bp->msg_ctime; - return; -} - -static void -cvt_imsqid2msqid(ibp, bp) -struct ibcs2_msqid_ds *ibp; -struct msqid_ds *bp; -{ - cvt_iperm2perm(&ibp->msg_perm, &bp->msg_perm); - bp->msg_cbytes = ibp->msg_cbytes; - bp->msg_qnum = ibp->msg_qnum; - bp->msg_qbytes = ibp->msg_qbytes; - bp->msg_lspid = ibp->msg_lspid; - bp->msg_lrpid = ibp->msg_lrpid; - bp->msg_stime = ibp->msg_stime; - bp->msg_rtime = ibp->msg_rtime; - bp->msg_ctime = ibp->msg_ctime; - return; -} - -struct ibcs2_msgget_args { - int what; - ibcs2_key_t key; - int msgflg; -}; - -static int -ibcs2_msgget(struct thread *td, void *v) -{ - struct ibcs2_msgget_args *uap = v; - struct msgget_args ap; - - ap.key = uap->key; - ap.msgflg = uap->msgflg; - return sys_msgget(td, &ap); -} - -struct ibcs2_msgctl_args { - int what; - int msqid; - int cmd; - struct ibcs2_msqid_ds *buf; -}; - -static int -ibcs2_msgctl(struct thread *td, void *v) -{ - struct ibcs2_msgctl_args *uap = v; - struct ibcs2_msqid_ds is; - struct msqid_ds bs; - int error; - - memset(&is, 0, sizeof(is)); - - switch (uap->cmd) { - case IBCS2_IPC_STAT: - error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs); - if (!error) { - cvt_msqid2imsqid(&bs, &is); - error = copyout(&is, uap->buf, sizeof(is)); - } - return (error); - case IBCS2_IPC_SET: - error = copyin(uap->buf, &is, sizeof(is)); - if (error) - return (error); - cvt_imsqid2msqid(&is, &bs); - return (kern_msgctl(td, uap->msqid, IPC_SET, &bs)); - case IBCS2_IPC_RMID: - return (kern_msgctl(td, uap->msqid, IPC_RMID, NULL)); - } - return (EINVAL); -} - -struct ibcs2_msgrcv_args { - int what; - int msqid; - void *msgp; - size_t msgsz; - long msgtyp; - int msgflg; -}; - -static int -ibcs2_msgrcv(struct thread *td, void *v) -{ - struct ibcs2_msgrcv_args *uap = v; - struct msgrcv_args ap; - - ap.msqid = uap->msqid; - ap.msgp = uap->msgp; - ap.msgsz = uap->msgsz; - ap.msgtyp = uap->msgtyp; - ap.msgflg = uap->msgflg; - return (sys_msgrcv(td, &ap)); -} - -struct ibcs2_msgsnd_args { - int what; - int msqid; - void *msgp; - size_t msgsz; - int msgflg; -}; - -static int -ibcs2_msgsnd(struct thread *td, void *v) -{ - struct ibcs2_msgsnd_args *uap = v; - struct msgsnd_args ap; - - ap.msqid = uap->msqid; - ap.msgp = uap->msgp; - ap.msgsz = uap->msgsz; - ap.msgflg = uap->msgflg; - return (sys_msgsnd(td, &ap)); -} - -int -ibcs2_msgsys(td, uap) - struct thread *td; - struct ibcs2_msgsys_args *uap; -{ - switch (uap->which) { - case 0: - return (ibcs2_msgget(td, uap)); - case 1: - return (ibcs2_msgctl(td, uap)); - case 2: - return (ibcs2_msgrcv(td, uap)); - case 3: - return (ibcs2_msgsnd(td, uap)); - default: - return (EINVAL); - } -} - -/* - * iBCS2 semsys call - */ -#ifdef unused -static void -cvt_sem2isem(bp, ibp) -struct sem *bp; -struct ibcs2_sem *ibp; -{ - ibp->semval = bp->semval; - ibp->sempid = bp->sempid; - ibp->semncnt = bp->semncnt; - ibp->semzcnt = bp->semzcnt; - return; -} - -static void -cvt_isem2sem(ibp, bp) -struct ibcs2_sem *ibp; -struct sem *bp; -{ - bp->semval = ibp->semval; - bp->sempid = ibp->sempid; - bp->semncnt = ibp->semncnt; - bp->semzcnt = ibp->semzcnt; - return; -} -#endif - -static void -cvt_iperm2perm(ipp, pp) -struct ibcs2_ipc_perm *ipp; -struct ipc_perm *pp; -{ - pp->uid = ipp->uid; - pp->gid = ipp->gid; - pp->cuid = ipp->cuid; - pp->cgid = ipp->cgid; - pp->mode = ipp->mode; - pp->seq = ipp->seq; - pp->key = ipp->key; -} - -static void -cvt_perm2iperm(pp, ipp) -struct ipc_perm *pp; -struct ibcs2_ipc_perm *ipp; -{ - ipp->uid = pp->uid; - ipp->gid = pp->gid; - ipp->cuid = pp->cuid; - ipp->cgid = pp->cgid; - ipp->mode = pp->mode; - ipp->seq = pp->seq; - ipp->key = pp->key; -} - -static void -cvt_semid2isemid(bp, ibp) -struct semid_ds *bp; -struct ibcs2_semid_ds *ibp; -{ - memset(ibp, 0, sizeof(*ibp)); - cvt_perm2iperm(&bp->sem_perm, &ibp->sem_perm); - ibp->sem_nsems = bp->sem_nsems; - ibp->sem_otime = bp->sem_otime; - ibp->sem_ctime = bp->sem_ctime; - return; -} - -static void -cvt_isemid2semid(ibp, bp) -struct ibcs2_semid_ds *ibp; -struct semid_ds *bp; -{ - cvt_iperm2perm(&ibp->sem_perm, &bp->sem_perm); - bp->sem_nsems = ibp->sem_nsems; - bp->sem_otime = ibp->sem_otime; - bp->sem_ctime = ibp->sem_ctime; - return; -} - -struct ibcs2_semctl_args { - int what; - int semid; - int semnum; - int cmd; - union semun arg; -}; - -static int -ibcs2_semctl(struct thread *td, void *v) -{ - struct ibcs2_semctl_args *uap = v; - struct ibcs2_semid_ds is; - struct semid_ds bs; - union semun semun; - register_t rval; - int error; - - memset(&is, 0, sizeof(is)); - - switch(uap->cmd) { - case IBCS2_IPC_STAT: - semun.buf = &bs; - error = kern_semctl(td, uap->semid, uap->semnum, IPC_STAT, - &semun, &rval); - if (error) - return (error); - cvt_semid2isemid(&bs, &is); - error = copyout(&is, uap->arg.buf, sizeof(is)); - if (error == 0) - td->td_retval[0] = rval; - return (error); - - case IBCS2_IPC_SET: - error = copyin(uap->arg.buf, &is, sizeof(is)); - if (error) - return (error); - cvt_isemid2semid(&is, &bs); - semun.buf = &bs; - return (kern_semctl(td, uap->semid, uap->semnum, IPC_SET, - &semun, td->td_retval)); - } - - return (kern_semctl(td, uap->semid, uap->semnum, uap->cmd, &uap->arg, - td->td_retval)); -} - -struct ibcs2_semget_args { - int what; - ibcs2_key_t key; - int nsems; - int semflg; -}; - -static int -ibcs2_semget(struct thread *td, void *v) -{ - struct ibcs2_semget_args *uap = v; - struct semget_args ap; - - ap.key = uap->key; - ap.nsems = uap->nsems; - ap.semflg = uap->semflg; - return (sys_semget(td, &ap)); -} - -struct ibcs2_semop_args { - int what; - int semid; - struct sembuf *sops; - size_t nsops; -}; - -static int -ibcs2_semop(struct thread *td, void *v) -{ - struct ibcs2_semop_args *uap = v; - struct semop_args ap; - - ap.semid = uap->semid; - ap.sops = uap->sops; - ap.nsops = uap->nsops; - return (sys_semop(td, &ap)); -} - -int -ibcs2_semsys(td, uap) - struct thread *td; - struct ibcs2_semsys_args *uap; -{ - - switch (uap->which) { - case 0: - return (ibcs2_semctl(td, uap)); - case 1: - return (ibcs2_semget(td, uap)); - case 2: - return (ibcs2_semop(td, uap)); - } - return (EINVAL); -} - - -/* - * iBCS2 shmsys call - */ - -static void -cvt_shmid2ishmid(bp, ibp) -struct shmid_ds *bp; -struct ibcs2_shmid_ds *ibp; -{ - cvt_perm2iperm(&bp->shm_perm, &ibp->shm_perm); - ibp->shm_segsz = bp->shm_segsz; - ibp->shm_lpid = bp->shm_lpid; - ibp->shm_cpid = bp->shm_cpid; - if (bp->shm_nattch > SHRT_MAX) - ibp->shm_nattch = SHRT_MAX; - else - ibp->shm_nattch = bp->shm_nattch; - ibp->shm_cnattch = 0; /* ignored anyway */ - ibp->shm_atime = bp->shm_atime; - ibp->shm_dtime = bp->shm_dtime; - ibp->shm_ctime = bp->shm_ctime; - return; -} - -static void -cvt_ishmid2shmid(ibp, bp) -struct ibcs2_shmid_ds *ibp; -struct shmid_ds *bp; -{ - cvt_iperm2perm(&ibp->shm_perm, &bp->shm_perm); - bp->shm_segsz = ibp->shm_segsz; - bp->shm_lpid = ibp->shm_lpid; - bp->shm_cpid = ibp->shm_cpid; - bp->shm_nattch = ibp->shm_nattch; - bp->shm_atime = ibp->shm_atime; - bp->shm_dtime = ibp->shm_dtime; - bp->shm_ctime = ibp->shm_ctime; - return; -} - -struct ibcs2_shmat_args { - int what; - int shmid; - const void *shmaddr; - int shmflg; -}; - -static int -ibcs2_shmat(struct thread *td, void *v) -{ - struct ibcs2_shmat_args *uap = v; - struct shmat_args ap; - - ap.shmid = uap->shmid; - ap.shmaddr = uap->shmaddr; - ap.shmflg = uap->shmflg; - return (sys_shmat(td, &ap)); -} - -struct ibcs2_shmctl_args { - int what; - int shmid; - int cmd; - struct ibcs2_shmid_ds *buf; -}; - -static int -ibcs2_shmctl(struct thread *td, void *v) -{ - struct ibcs2_shmctl_args *uap = v; - struct ibcs2_shmid_ds is; - struct shmid_ds bs; - int error; - - switch(uap->cmd) { - case IBCS2_IPC_STAT: - error = kern_shmctl(td, uap->shmid, IPC_STAT, &bs, NULL); - if (error) - return (error); - cvt_shmid2ishmid(&bs, &is); - return (copyout(&is, uap->buf, sizeof(is))); - - case IBCS2_IPC_SET: - error = copyin(uap->buf, &is, sizeof(is)); - if (error) - return (error); - cvt_ishmid2shmid(&is, &bs); - return (kern_shmctl(td, uap->shmid, IPC_SET, &bs, NULL)); - - case IPC_INFO: - case SHM_INFO: - case SHM_STAT: - /* XXX: */ - return (EINVAL); - } - - return (kern_shmctl(td, uap->shmid, uap->cmd, NULL, NULL)); -} - -struct ibcs2_shmdt_args { - int what; - const void *shmaddr; -}; - -static int -ibcs2_shmdt(struct thread *td, void *v) -{ - struct ibcs2_shmdt_args *uap = v; - struct shmdt_args ap; - - ap.shmaddr = uap->shmaddr; - return (sys_shmdt(td, &ap)); -} - -struct ibcs2_shmget_args { - int what; - ibcs2_key_t key; - size_t size; - int shmflg; -}; - -static int -ibcs2_shmget(struct thread *td, void *v) -{ - struct ibcs2_shmget_args *uap = v; - struct shmget_args ap; - - ap.key = uap->key; - ap.size = uap->size; - ap.shmflg = uap->shmflg; - return (sys_shmget(td, &ap)); -} - -int -ibcs2_shmsys(td, uap) - struct thread *td; - struct ibcs2_shmsys_args *uap; -{ - - switch (uap->which) { - case 0: - return (ibcs2_shmat(td, uap)); - case 1: - return (ibcs2_shmctl(td, uap)); - case 2: - return (ibcs2_shmdt(td, uap)); - case 3: - return (ibcs2_shmget(td, uap)); - } - return (EINVAL); -} - -MODULE_DEPEND(ibcs2, sysvmsg, 1, 1, 1); -MODULE_DEPEND(ibcs2, sysvsem, 1, 1, 1); -MODULE_DEPEND(ibcs2, sysvshm, 1, 1, 1); diff --git a/sys/i386/ibcs2/ibcs2_ipc.h b/sys/i386/ibcs2/ibcs2_ipc.h deleted file mode 100644 index e6de18b4880..00000000000 --- a/sys/i386/ibcs2/ibcs2_ipc.h +++ /dev/null @@ -1,87 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Steven Wallace. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - - -struct ibcs2_ipc_perm { - u_short uid; /* user id */ - u_short gid; /* group id */ - u_short cuid; /* creator user id */ - u_short cgid; /* creator group id */ - u_short mode; /* r/w permission */ - u_short seq; /* sequence # (to generate unique msg/sem/shm id) */ - ibcs2_key_t key; /* user specified msg/sem/shm key */ -}; - -struct ibcs2_msqid_ds { - struct ibcs2_ipc_perm msg_perm; - struct msg *msg_first; - struct msg *msg_last; - u_short msg_cbytes; - u_short msg_qnum; - u_short msg_qbytes; - u_short msg_lspid; - u_short msg_lrpid; - ibcs2_time_t msg_stime; - ibcs2_time_t msg_rtime; - ibcs2_time_t msg_ctime; -}; - -struct ibcs2_semid_ds { - struct ibcs2_ipc_perm sem_perm; - struct ibcs2_sem *sem_base; - u_short sem_nsems; - ibcs2_time_t sem_otime; - ibcs2_time_t sem_ctime; -}; - -struct ibcs2_sem { - u_short semval; - ibcs2_pid_t sempid; - u_short semncnt; - u_short semzcnt; -}; - -struct ibcs2_shmid_ds { - struct ibcs2_ipc_perm shm_perm; - int shm_segsz; - int pad1; - char pad2[4]; - u_short shm_lpid; - u_short shm_cpid; - u_short shm_nattch; - u_short shm_cnattch; - ibcs2_time_t shm_atime; - ibcs2_time_t shm_dtime; - ibcs2_time_t shm_ctime; -}; diff --git a/sys/i386/ibcs2/ibcs2_isc.c b/sys/i386/ibcs2/ibcs2_isc.c deleted file mode 100644 index 04480548603..00000000000 --- a/sys/i386/ibcs2/ibcs2_isc.c +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1994 Søren Schmidt - * Copyright (c) 1994 Sean Eric Fagan - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -extern struct sysent isc_sysent[]; - -int -ibcs2_isc(struct thread *td, struct ibcs2_isc_args *uap) -{ - struct trapframe *tf = td->td_frame; - struct sysent *callp; - u_int code; - int error; - - code = (tf->tf_eax & 0xffffff00) >> 8; - callp = &isc_sysent[code]; - - if (code < IBCS2_ISC_MAXSYSCALL) - error = (*callp->sy_call)(td, (void *)uap); - else - error = ENOSYS; - return (error); -} diff --git a/sys/i386/ibcs2/ibcs2_isc_syscall.h b/sys/i386/ibcs2/ibcs2_isc_syscall.h deleted file mode 100644 index 7b4e68475d2..00000000000 --- a/sys/i386/ibcs2/ibcs2_isc_syscall.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * System call numbers. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.isc 160798 2006-07-28 19:05:28Z jhb - */ - -#define IBCS2_ISC_ibcs2_rename 2 -#define IBCS2_ISC_ibcs2_sigaction 3 -#define IBCS2_ISC_ibcs2_sigprocmask 4 -#define IBCS2_ISC_ibcs2_sigpending 5 -#define IBCS2_ISC_getgroups 6 -#define IBCS2_ISC_setgroups 7 -#define IBCS2_ISC_ibcs2_pathconf 8 -#define IBCS2_ISC_ibcs2_fpathconf 9 -#define IBCS2_ISC_ibcs2_wait 11 -#define IBCS2_ISC_setsid 12 -#define IBCS2_ISC_getpid 13 -#define IBCS2_ISC_ibcs2_sysconf 16 -#define IBCS2_ISC_ibcs2_sigsuspend 17 -#define IBCS2_ISC_ibcs2_symlink 18 -#define IBCS2_ISC_ibcs2_readlink 19 -#define IBCS2_ISC_MAXSYSCALL 21 diff --git a/sys/i386/ibcs2/ibcs2_isc_sysent.c b/sys/i386/ibcs2/ibcs2_isc_sysent.c deleted file mode 100644 index fc5b1baa8c2..00000000000 --- a/sys/i386/ibcs2/ibcs2_isc_sysent.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * System call switch table. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.isc 160798 2006-07-28 19:05:28Z jhb - */ - -#include -#include -#include -#include -#include -#include -#include - -#define AS(name) (sizeof(struct name) / sizeof(register_t)) - -/* The casts are bogus but will do for now. */ -struct sysent isc_sysent[] = { - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 1 = isc_setostype */ - { AS(ibcs2_rename_args), (sy_call_t *)ibcs2_rename, AUE_RENAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = ibcs2_rename */ - { AS(ibcs2_sigaction_args), (sy_call_t *)ibcs2_sigaction, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = ibcs2_sigaction */ - { AS(ibcs2_sigprocmask_args), (sy_call_t *)ibcs2_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = ibcs2_sigprocmask */ - { AS(ibcs2_sigpending_args), (sy_call_t *)ibcs2_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = ibcs2_sigpending */ - { AS(getgroups_args), (sy_call_t *)sys_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 6 = getgroups */ - { AS(setgroups_args), (sy_call_t *)sys_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = setgroups */ - { AS(ibcs2_pathconf_args), (sy_call_t *)ibcs2_pathconf, AUE_PATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = ibcs2_pathconf */ - { AS(ibcs2_fpathconf_args), (sy_call_t *)ibcs2_fpathconf, AUE_FPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = ibcs2_fpathconf */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 10 = nosys */ - { AS(ibcs2_wait_args), (sy_call_t *)ibcs2_wait, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 11 = ibcs2_wait */ - { 0, (sy_call_t *)sys_setsid, AUE_SETSID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = setsid */ - { 0, (sy_call_t *)sys_getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 13 = getpid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 14 = isc_adduser */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 15 = isc_setuser */ - { AS(ibcs2_sysconf_args), (sy_call_t *)ibcs2_sysconf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = ibcs2_sysconf */ - { AS(ibcs2_sigsuspend_args), (sy_call_t *)ibcs2_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = ibcs2_sigsuspend */ - { AS(ibcs2_symlink_args), (sy_call_t *)ibcs2_symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = ibcs2_symlink */ - { AS(ibcs2_readlink_args), (sy_call_t *)ibcs2_readlink, AUE_READLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = ibcs2_readlink */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 20 = isc_getmajor */ -}; diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c deleted file mode 100644 index 871fa17aa31..00000000000 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ /dev/null @@ -1,1198 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1995 Steven Wallace - * Copyright (c) 1994, 1995 Scott Bartram - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Lawrence Berkeley Laboratory. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp - * - * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * IBCS2 compatibility module. - * - * IBCS2 system calls that are implemented differently in BSD are - * handled here. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* Must come after sys/malloc.h */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -int -ibcs2_ulimit(struct thread *td, struct ibcs2_ulimit_args *uap) -{ - struct rlimit rl; - int error; -#define IBCS2_GETFSIZE 1 -#define IBCS2_SETFSIZE 2 -#define IBCS2_GETPSIZE 3 -#define IBCS2_GETDTABLESIZE 4 - - switch (uap->cmd) { - case IBCS2_GETFSIZE: - td->td_retval[0] = lim_cur(td, RLIMIT_FSIZE); - if (td->td_retval[0] == -1) - td->td_retval[0] = 0x7fffffff; - return 0; - case IBCS2_SETFSIZE: - rl.rlim_max = lim_max(td, RLIMIT_FSIZE); - rl.rlim_cur = uap->newlimit; - error = kern_setrlimit(td, RLIMIT_FSIZE, &rl); - if (!error) { - td->td_retval[0] = lim_cur(td, RLIMIT_FSIZE); - } else { - DPRINTF(("failed ")); - } - return error; - case IBCS2_GETPSIZE: - td->td_retval[0] = lim_cur(td, RLIMIT_RSS); /* XXX */ - return 0; - case IBCS2_GETDTABLESIZE: - uap->cmd = IBCS2_SC_OPEN_MAX; - return ibcs2_sysconf(td, (struct ibcs2_sysconf_args *)uap); - default: - return ENOSYS; - } -} - -#define IBCS2_WSTOPPED 0177 -#define IBCS2_STOPCODE(sig) ((sig) << 8 | IBCS2_WSTOPPED) -int -ibcs2_wait(struct thread *td, struct ibcs2_wait_args *uap) -{ - int error, options, status; - int *statusp; - pid_t pid; - struct trapframe *tf = td->td_frame; - - if ((tf->tf_eflags & (PSL_Z|PSL_PF|PSL_N|PSL_V)) - == (PSL_Z|PSL_PF|PSL_N|PSL_V)) { - /* waitpid */ - pid = uap->a1; - statusp = (int *)uap->a2; - options = uap->a3; - } else { - /* wait */ - pid = WAIT_ANY; - statusp = (int *)uap->a1; - options = 0; - } - error = kern_wait(td, pid, &status, options, NULL); - if (error) - return error; - if (statusp) { - /* - * Convert status/signal result. - */ - if (WIFSTOPPED(status)) { - if (WSTOPSIG(status) <= 0 || - WSTOPSIG(status) > IBCS2_SIGTBLSZ) - return (EINVAL); - status = - IBCS2_STOPCODE(bsd_to_ibcs2_sig[_SIG_IDX(WSTOPSIG(status))]); - } else if (WIFSIGNALED(status)) { - if (WTERMSIG(status) <= 0 || - WTERMSIG(status) > IBCS2_SIGTBLSZ) - return (EINVAL); - status = bsd_to_ibcs2_sig[_SIG_IDX(WTERMSIG(status))]; - } - /* else exit status -- identical */ - - /* record result/status */ - td->td_retval[1] = status; - return copyout(&status, statusp, sizeof(status)); - } - - return 0; -} - -int -ibcs2_execv(struct thread *td, struct ibcs2_execv_args *uap) -{ - struct image_args eargs; - struct vmspace *oldvmspace; - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - - error = pre_execve(td, &oldvmspace); - if (error != 0) { - free(path, M_TEMP); - return (error); - } - error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, NULL); - free(path, M_TEMP); - if (error == 0) - error = kern_execve(td, &eargs, NULL); - post_execve(td, error, oldvmspace); - return (error); -} - -int -ibcs2_execve(struct thread *td, struct ibcs2_execve_args *uap) -{ - struct image_args eargs; - struct vmspace *oldvmspace; - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - - error = pre_execve(td, &oldvmspace); - if (error != 0) { - free(path, M_TEMP); - return (error); - } - error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, - uap->envp); - free(path, M_TEMP); - if (error == 0) - error = kern_execve(td, &eargs, NULL); - post_execve(td, error, oldvmspace); - return (error); -} - -int -ibcs2_umount(struct thread *td, struct ibcs2_umount_args *uap) -{ - struct unmount_args um; - - um.path = uap->name; - um.flags = 0; - return sys_unmount(td, &um); -} - -int -ibcs2_mount(struct thread *td, struct ibcs2_mount_args *uap) -{ -#ifdef notyet - int oflags = uap->flags, nflags, error; - char fsname[MFSNAMELEN]; - - if (oflags & (IBCS2_MS_NOSUB | IBCS2_MS_SYS5)) - return (EINVAL); - if ((oflags & IBCS2_MS_NEWTYPE) == 0) - return (EINVAL); - nflags = 0; - if (oflags & IBCS2_MS_RDONLY) - nflags |= MNT_RDONLY; - if (oflags & IBCS2_MS_NOSUID) - nflags |= MNT_NOSUID; - if (oflags & IBCS2_MS_REMOUNT) - nflags |= MNT_UPDATE; - uap->flags = nflags; - - if (error = copyinstr((caddr_t)uap->type, fsname, sizeof fsname, - (u_int *)0)) - return (error); - - if (strcmp(fsname, "4.2") == 0) { - uap->type = (caddr_t)STACK_ALLOC(); - if (error = copyout("ufs", uap->type, sizeof("ufs"))) - return (error); - } else if (strcmp(fsname, "nfs") == 0) { - struct ibcs2_nfs_args sna; - struct sockaddr_in sain; - struct nfs_args na; - struct sockaddr sa; - - if (error = copyin(uap->data, &sna, sizeof sna)) - return (error); - if (error = copyin(sna.addr, &sain, sizeof sain)) - return (error); - bcopy(&sain, &sa, sizeof sa); - sa.sa_len = sizeof(sain); - uap->data = (caddr_t)STACK_ALLOC(); - na.addr = (struct sockaddr *)((int)uap->data + sizeof na); - na.sotype = SOCK_DGRAM; - na.proto = IPPROTO_UDP; - na.fh = (nfsv2fh_t *)sna.fh; - na.flags = sna.flags; - na.wsize = sna.wsize; - na.rsize = sna.rsize; - na.timeo = sna.timeo; - na.retrans = sna.retrans; - na.hostname = sna.hostname; - - if (error = copyout(&sa, na.addr, sizeof sa)) - return (error); - if (error = copyout(&na, uap->data, sizeof na)) - return (error); - } - return (mount(td, uap)); -#else - return EINVAL; -#endif -} - -/* - * Read iBCS2-style directory entries. We suck them into kernel space so - * that they can be massaged before being copied out to user code. Like - * SunOS, we squish out `empty' entries. - * - * This is quite ugly, but what do you expect from compatibility code? - */ - -int -ibcs2_getdents(struct thread *td, struct ibcs2_getdents_args *uap) -{ - struct vnode *vp; - caddr_t inp, buf; /* BSD-format */ - int len, reclen; /* BSD-format */ - caddr_t outp; /* iBCS2-format */ - int resid; /* iBCS2-format */ - cap_rights_t rights; - struct file *fp; - struct uio auio; - struct iovec aiov; - struct ibcs2_dirent idb; - off_t off; /* true file offset */ - int buflen, error, eofflag; - u_long *cookies = NULL, *cookiep; - int ncookies; -#define BSD_DIRENT(cp) ((struct dirent *)(cp)) -#define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short)) - - memset(&idb, 0, sizeof(idb)); - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); - if (error != 0) - return (error); - if ((fp->f_flag & FREAD) == 0) { - fdrop(fp, td); - return (EBADF); - } - vp = fp->f_vnode; - if (vp->v_type != VDIR) { /* XXX vnode readdir op should do this */ - fdrop(fp, td); - return (EINVAL); - } - - off = fp->f_offset; -#define DIRBLKSIZ 512 /* XXX we used to use ufs's DIRBLKSIZ */ - buflen = max(DIRBLKSIZ, uap->nbytes); - buflen = min(buflen, MAXBSIZE); - buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_SHARED | LK_RETRY); -again: - aiov.iov_base = buf; - aiov.iov_len = buflen; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_rw = UIO_READ; - auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = td; - auio.uio_resid = buflen; - auio.uio_offset = off; - - if (cookies) { - free(cookies, M_TEMP); - cookies = NULL; - } - -#ifdef MAC - error = mac_vnode_check_readdir(td->td_ucred, vp); - if (error) - goto out; -#endif - - /* - * First we read into the malloc'ed buffer, then - * we massage it into user space, one record at a time. - */ - if ((error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies, &cookies)) != 0) - goto out; - inp = buf; - outp = uap->buf; - resid = uap->nbytes; - if ((len = buflen - auio.uio_resid) <= 0) - goto eof; - - cookiep = cookies; - - if (cookies) { - /* - * When using cookies, the vfs has the option of reading from - * a different offset than that supplied (UFS truncates the - * offset to a block boundary to make sure that it never reads - * partway through a directory entry, even if the directory - * has been compacted). - */ - while (len > 0 && ncookies > 0 && *cookiep <= off) { - len -= BSD_DIRENT(inp)->d_reclen; - inp += BSD_DIRENT(inp)->d_reclen; - cookiep++; - ncookies--; - } - } - - for (; len > 0; len -= reclen) { - if (cookiep && ncookies == 0) - break; - reclen = BSD_DIRENT(inp)->d_reclen; - if (reclen & 3) { - printf("ibcs2_getdents: reclen=%d\n", reclen); - error = EFAULT; - goto out; - } - if (BSD_DIRENT(inp)->d_fileno == 0) { - inp += reclen; /* it is a hole; squish it out */ - if (cookiep) { - off = *cookiep++; - ncookies--; - } else - off += reclen; - continue; - } - if (reclen > len || resid < IBCS2_RECLEN(reclen)) { - /* entry too big for buffer, so just stop */ - outp++; - break; - } - /* - * Massage in place to make an iBCS2-shaped dirent (otherwise - * we have to worry about touching user memory outside of - * the copyout() call). - */ - idb.d_ino = (ibcs2_ino_t)BSD_DIRENT(inp)->d_fileno; - idb.d_off = (ibcs2_off_t)off; - idb.d_reclen = (u_short)IBCS2_RECLEN(reclen); - if ((error = copyout((caddr_t)&idb, outp, 10)) != 0 || - (error = copyout(BSD_DIRENT(inp)->d_name, outp + 10, - BSD_DIRENT(inp)->d_namlen + 1)) != 0) - goto out; - /* advance past this real entry */ - if (cookiep) { - off = *cookiep++; - ncookies--; - } else - off += reclen; - inp += reclen; - /* advance output past iBCS2-shaped entry */ - outp += IBCS2_RECLEN(reclen); - resid -= IBCS2_RECLEN(reclen); - } - /* if we squished out the whole block, try again */ - if (outp == uap->buf) - goto again; - fp->f_offset = off; /* update the vnode offset */ -eof: - td->td_retval[0] = uap->nbytes - resid; -out: - VOP_UNLOCK(vp, 0); - fdrop(fp, td); - if (cookies) - free(cookies, M_TEMP); - free(buf, M_TEMP); - return (error); -} - -int -ibcs2_read(struct thread *td, struct ibcs2_read_args *uap) -{ - struct vnode *vp; - caddr_t inp, buf; /* BSD-format */ - int len, reclen; /* BSD-format */ - caddr_t outp; /* iBCS2-format */ - int resid; /* iBCS2-format */ - cap_rights_t rights; - struct file *fp; - struct uio auio; - struct iovec aiov; - struct ibcs2_direct { - ibcs2_ino_t ino; - char name[14]; - } idb; - off_t off; /* true file offset */ - int buflen, error, eofflag, size; - u_long *cookies = NULL, *cookiep; - int ncookies; - - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); - if (error != 0) { - if (error == EINVAL) - return sys_read(td, (struct read_args *)uap); - else - return error; - } - if ((fp->f_flag & FREAD) == 0) { - fdrop(fp, td); - return (EBADF); - } - vp = fp->f_vnode; - if (vp->v_type != VDIR) { - fdrop(fp, td); - return sys_read(td, (struct read_args *)uap); - } - - off = fp->f_offset; - - DPRINTF(("ibcs2_read: read directory\n")); - - buflen = max(DIRBLKSIZ, uap->nbytes); - buflen = min(buflen, MAXBSIZE); - buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_SHARED | LK_RETRY); -again: - aiov.iov_base = buf; - aiov.iov_len = buflen; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_rw = UIO_READ; - auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = td; - auio.uio_resid = buflen; - auio.uio_offset = off; - - if (cookies) { - free(cookies, M_TEMP); - cookies = NULL; - } - -#ifdef MAC - error = mac_vnode_check_readdir(td->td_ucred, vp); - if (error) - goto out; -#endif - - /* - * First we read into the malloc'ed buffer, then - * we massage it into user space, one record at a time. - */ - if ((error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies, &cookies)) != 0) { - DPRINTF(("VOP_READDIR failed: %d\n", error)); - goto out; - } - inp = buf; - outp = uap->buf; - resid = uap->nbytes; - if ((len = buflen - auio.uio_resid) <= 0) - goto eof; - - cookiep = cookies; - - if (cookies) { - /* - * When using cookies, the vfs has the option of reading from - * a different offset than that supplied (UFS truncates the - * offset to a block boundary to make sure that it never reads - * partway through a directory entry, even if the directory - * has been compacted). - */ - while (len > 0 && ncookies > 0 && *cookiep <= off) { - len -= BSD_DIRENT(inp)->d_reclen; - inp += BSD_DIRENT(inp)->d_reclen; - cookiep++; - ncookies--; - } - } - - for (; len > 0 && resid > 0; len -= reclen) { - if (cookiep && ncookies == 0) - break; - reclen = BSD_DIRENT(inp)->d_reclen; - if (reclen & 3) { - printf("ibcs2_read: reclen=%d\n", reclen); - error = EFAULT; - goto out; - } - if (BSD_DIRENT(inp)->d_fileno == 0) { - inp += reclen; /* it is a hole; squish it out */ - if (cookiep) { - off = *cookiep++; - ncookies--; - } else - off += reclen; - continue; - } - if (reclen > len || resid < sizeof(struct ibcs2_direct)) { - /* entry too big for buffer, so just stop */ - outp++; - break; - } - /* - * Massage in place to make an iBCS2-shaped dirent (otherwise - * we have to worry about touching user memory outside of - * the copyout() call). - * - * TODO: if length(filename) > 14, then break filename into - * multiple entries and set inode = 0xffff except last - */ - idb.ino = (BSD_DIRENT(inp)->d_fileno > 0xfffe) ? 0xfffe : - BSD_DIRENT(inp)->d_fileno; - (void)copystr(BSD_DIRENT(inp)->d_name, idb.name, 14, &size); - bzero(idb.name + size, 14 - size); - if ((error = copyout(&idb, outp, sizeof(struct ibcs2_direct))) != 0) - goto out; - /* advance past this real entry */ - if (cookiep) { - off = *cookiep++; - ncookies--; - } else - off += reclen; - inp += reclen; - /* advance output past iBCS2-shaped entry */ - outp += sizeof(struct ibcs2_direct); - resid -= sizeof(struct ibcs2_direct); - } - /* if we squished out the whole block, try again */ - if (outp == uap->buf) - goto again; - fp->f_offset = off; /* update the vnode offset */ -eof: - td->td_retval[0] = uap->nbytes - resid; -out: - VOP_UNLOCK(vp, 0); - fdrop(fp, td); - if (cookies) - free(cookies, M_TEMP); - free(buf, M_TEMP); - return (error); -} - -int -ibcs2_mknod(struct thread *td, struct ibcs2_mknod_args *uap) -{ - char *path; - int error; - - CHECKALTCREAT(td, uap->path, &path); - if (S_ISFIFO(uap->mode)) { - error = kern_mkfifoat(td, AT_FDCWD, path, - UIO_SYSSPACE, uap->mode); - } else { - error = kern_mknodat(td, AT_FDCWD, path, UIO_SYSSPACE, - uap->mode, uap->dev); - } - free(path, M_TEMP); - return (error); -} - -int -ibcs2_getgroups(struct thread *td, struct ibcs2_getgroups_args *uap) -{ - struct ucred *cred; - ibcs2_gid_t *iset; - u_int i, ngrp; - int error; - - cred = td->td_ucred; - ngrp = cred->cr_ngroups; - - if (uap->gidsetsize == 0) { - error = 0; - goto out; - } - if (uap->gidsetsize < ngrp) - return (EINVAL); - - iset = malloc(ngrp * sizeof(*iset), M_TEMP, M_WAITOK); - for (i = 0; i < ngrp; i++) - iset[i] = (ibcs2_gid_t)cred->cr_groups[i]; - error = copyout(iset, uap->gidset, ngrp * sizeof(ibcs2_gid_t)); - free(iset, M_TEMP); -out: - td->td_retval[0] = ngrp; - return (error); -} - -int -ibcs2_setgroups(struct thread *td, struct ibcs2_setgroups_args *uap) -{ - ibcs2_gid_t *iset; - gid_t *gp; - int error, i; - - if (uap->gidsetsize < 0 || uap->gidsetsize > ngroups_max + 1) - return (EINVAL); - if (uap->gidsetsize && uap->gidset == NULL) - return (EINVAL); - gp = malloc(uap->gidsetsize * sizeof(*gp), M_TEMP, M_WAITOK); - if (uap->gidsetsize) { - iset = malloc(uap->gidsetsize * sizeof(*iset), M_TEMP, M_WAITOK); - error = copyin(uap->gidset, iset, sizeof(ibcs2_gid_t) * - uap->gidsetsize); - if (error) { - free(iset, M_TEMP); - goto out; - } - for (i = 0; i < uap->gidsetsize; i++) - gp[i] = (gid_t)iset[i]; - } - - error = kern_setgroups(td, uap->gidsetsize, gp); -out: - free(gp, M_TEMP); - return (error); -} - -int -ibcs2_setuid(struct thread *td, struct ibcs2_setuid_args *uap) -{ - struct setuid_args sa; - - sa.uid = (uid_t)uap->uid; - return sys_setuid(td, &sa); -} - -int -ibcs2_setgid(struct thread *td, struct ibcs2_setgid_args *uap) -{ - struct setgid_args sa; - - sa.gid = (gid_t)uap->gid; - return sys_setgid(td, &sa); -} - -int -ibcs2_time(struct thread *td, struct ibcs2_time_args *uap) -{ - struct timeval tv; - - microtime(&tv); - td->td_retval[0] = tv.tv_sec; - if (uap->tp) - return copyout((caddr_t)&tv.tv_sec, (caddr_t)uap->tp, - sizeof(ibcs2_time_t)); - else - return 0; -} - -int -ibcs2_pathconf(struct thread *td, struct ibcs2_pathconf_args *uap) -{ - char *path; - long value; - int error; - - CHECKALTEXIST(td, uap->path, &path); - uap->name++; /* iBCS2 _PC_* defines are offset by one */ - error = kern_pathconf(td, path, UIO_SYSSPACE, uap->name, FOLLOW, - &value); - free(path, M_TEMP); - if (error == 0) - td->td_retval[0] = value; - return (error); -} - -int -ibcs2_fpathconf(struct thread *td, struct ibcs2_fpathconf_args *uap) -{ - uap->name++; /* iBCS2 _PC_* defines are offset by one */ - return sys_fpathconf(td, (struct fpathconf_args *)uap); -} - -int -ibcs2_sysconf(struct thread *td, struct ibcs2_sysconf_args *uap) -{ - int mib[2], value, len, error; - - switch(uap->name) { - case IBCS2_SC_ARG_MAX: - mib[1] = KERN_ARGMAX; - break; - - case IBCS2_SC_CHILD_MAX: - td->td_retval[0] = lim_cur(td, RLIMIT_NPROC); - return 0; - - case IBCS2_SC_CLK_TCK: - td->td_retval[0] = hz; - return 0; - - case IBCS2_SC_NGROUPS_MAX: - mib[1] = KERN_NGROUPS; - break; - - case IBCS2_SC_OPEN_MAX: - td->td_retval[0] = lim_cur(td, RLIMIT_NOFILE); - return 0; - - case IBCS2_SC_JOB_CONTROL: - mib[1] = KERN_JOB_CONTROL; - break; - - case IBCS2_SC_SAVED_IDS: - mib[1] = KERN_SAVED_IDS; - break; - - case IBCS2_SC_VERSION: - mib[1] = KERN_POSIX1; - break; - - case IBCS2_SC_PASS_MAX: - td->td_retval[0] = 128; /* XXX - should we create PASS_MAX ? */ - return 0; - - case IBCS2_SC_XOPEN_VERSION: - td->td_retval[0] = 2; /* XXX: What should that be? */ - return 0; - - default: - return EINVAL; - } - - mib[0] = CTL_KERN; - len = sizeof(value); - error = kernel_sysctl(td, mib, 2, &value, &len, NULL, 0, NULL, 0); - if (error) - return error; - td->td_retval[0] = value; - return 0; -} - -int -ibcs2_alarm(struct thread *td, struct ibcs2_alarm_args *uap) -{ - struct itimerval itv, oitv; - int error; - - timevalclear(&itv.it_interval); - itv.it_value.tv_sec = uap->sec; - itv.it_value.tv_usec = 0; - error = kern_setitimer(td, ITIMER_REAL, &itv, &oitv); - if (error) - return (error); - if (oitv.it_value.tv_usec != 0) - oitv.it_value.tv_sec++; - td->td_retval[0] = oitv.it_value.tv_sec; - return (0); -} - -int -ibcs2_times(struct thread *td, struct ibcs2_times_args *uap) -{ - struct rusage ru; - struct timeval t; - struct tms tms; - int error; - -#define CONVTCK(r) (r.tv_sec * hz + r.tv_usec / (1000000 / hz)) - - error = kern_getrusage(td, RUSAGE_SELF, &ru); - if (error) - return (error); - tms.tms_utime = CONVTCK(ru.ru_utime); - tms.tms_stime = CONVTCK(ru.ru_stime); - - error = kern_getrusage(td, RUSAGE_CHILDREN, &ru); - if (error) - return (error); - tms.tms_cutime = CONVTCK(ru.ru_utime); - tms.tms_cstime = CONVTCK(ru.ru_stime); - - microtime(&t); - td->td_retval[0] = CONVTCK(t); - - return (copyout(&tms, uap->tp, sizeof(struct tms))); -} - -int -ibcs2_stime(struct thread *td, struct ibcs2_stime_args *uap) -{ - struct timeval tv; - long secs; - int error; - - error = copyin(uap->timep, &secs, sizeof(long)); - if (error) - return (error); - tv.tv_sec = secs; - tv.tv_usec = 0; - error = kern_settimeofday(td, &tv, NULL); - if (error) - error = EPERM; - return (error); -} - -int -ibcs2_utime(struct thread *td, struct ibcs2_utime_args *uap) -{ - struct ibcs2_utimbuf ubuf; - struct timeval tbuf[2], *tp; - char *path; - int error; - - if (uap->buf) { - error = copyin(uap->buf, &ubuf, sizeof(ubuf)); - if (error) - return (error); - tbuf[0].tv_sec = ubuf.actime; - tbuf[0].tv_usec = 0; - tbuf[1].tv_sec = ubuf.modtime; - tbuf[1].tv_usec = 0; - tp = tbuf; - } else - tp = NULL; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_utimesat(td, AT_FDCWD, path, UIO_SYSSPACE, - tp, UIO_SYSSPACE); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_nice(struct thread *td, struct ibcs2_nice_args *uap) -{ - int error; - struct setpriority_args sa; - - sa.which = PRIO_PROCESS; - sa.who = 0; - sa.prio = td->td_proc->p_nice + uap->incr; - if ((error = sys_setpriority(td, &sa)) != 0) - return EPERM; - td->td_retval[0] = td->td_proc->p_nice; - return 0; -} - -/* - * iBCS2 getpgrp, setpgrp, setsid, and setpgid - */ - -int -ibcs2_pgrpsys(struct thread *td, struct ibcs2_pgrpsys_args *uap) -{ - struct proc *p = td->td_proc; - switch (uap->type) { - case 0: /* getpgrp */ - PROC_LOCK(p); - td->td_retval[0] = p->p_pgrp->pg_id; - PROC_UNLOCK(p); - return 0; - - case 1: /* setpgrp */ - { - struct setpgid_args sa; - - sa.pid = 0; - sa.pgid = 0; - sys_setpgid(td, &sa); - PROC_LOCK(p); - td->td_retval[0] = p->p_pgrp->pg_id; - PROC_UNLOCK(p); - return 0; - } - - case 2: /* setpgid */ - { - struct setpgid_args sa; - - sa.pid = uap->pid; - sa.pgid = uap->pgid; - return sys_setpgid(td, &sa); - } - - case 3: /* setsid */ - return sys_setsid(td, NULL); - - default: - return EINVAL; - } -} - -/* - * XXX - need to check for nested calls - */ - -int -ibcs2_plock(struct thread *td, struct ibcs2_plock_args *uap) -{ - int error; -#define IBCS2_UNLOCK 0 -#define IBCS2_PROCLOCK 1 -#define IBCS2_TEXTLOCK 2 -#define IBCS2_DATALOCK 4 - - - switch(uap->cmd) { - case IBCS2_UNLOCK: - error = priv_check(td, PRIV_VM_MUNLOCK); - if (error) - return (error); - /* XXX - TODO */ - return (0); - - case IBCS2_PROCLOCK: - case IBCS2_TEXTLOCK: - case IBCS2_DATALOCK: - error = priv_check(td, PRIV_VM_MLOCK); - if (error) - return (error); - /* XXX - TODO */ - return 0; - } - return EINVAL; -} - -int -ibcs2_uadmin(struct thread *td, struct ibcs2_uadmin_args *uap) -{ -#define SCO_A_REBOOT 1 -#define SCO_A_SHUTDOWN 2 -#define SCO_A_REMOUNT 4 -#define SCO_A_CLOCK 8 -#define SCO_A_SETCONFIG 128 -#define SCO_A_GETDEV 130 - -#define SCO_AD_HALT 0 -#define SCO_AD_BOOT 1 -#define SCO_AD_IBOOT 2 -#define SCO_AD_PWRDOWN 3 -#define SCO_AD_PWRNAP 4 - -#define SCO_AD_PANICBOOT 1 - -#define SCO_AD_GETBMAJ 0 -#define SCO_AD_GETCMAJ 1 - - switch(uap->cmd) { - case SCO_A_REBOOT: - case SCO_A_SHUTDOWN: - switch(uap->func) { - struct reboot_args r; - case SCO_AD_HALT: - case SCO_AD_PWRDOWN: - case SCO_AD_PWRNAP: - r.opt = RB_HALT; - return (sys_reboot(td, &r)); - case SCO_AD_BOOT: - case SCO_AD_IBOOT: - r.opt = RB_AUTOBOOT; - return (sys_reboot(td, &r)); - } - return EINVAL; - case SCO_A_REMOUNT: - case SCO_A_CLOCK: - case SCO_A_SETCONFIG: - return 0; - case SCO_A_GETDEV: - return EINVAL; /* XXX - TODO */ - } - return EINVAL; -} - -int -ibcs2_sysfs(struct thread *td, struct ibcs2_sysfs_args *uap) -{ -#define IBCS2_GETFSIND 1 -#define IBCS2_GETFSTYP 2 -#define IBCS2_GETNFSTYP 3 - - switch(uap->cmd) { - case IBCS2_GETFSIND: - case IBCS2_GETFSTYP: - case IBCS2_GETNFSTYP: - break; - } - return EINVAL; /* XXX - TODO */ -} - -int -ibcs2_unlink(struct thread *td, struct ibcs2_unlink_args *uap) -{ - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_unlinkat(td, AT_FDCWD, path, UIO_SYSSPACE, 0); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_chdir(struct thread *td, struct ibcs2_chdir_args *uap) -{ - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_chdir(td, path, UIO_SYSSPACE); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_chmod(struct thread *td, struct ibcs2_chmod_args *uap) -{ - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_fchmodat(td, AT_FDCWD, path, UIO_SYSSPACE, uap->mode, 0); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_chown(struct thread *td, struct ibcs2_chown_args *uap) -{ - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, uap->uid, - uap->gid, 0); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_rmdir(struct thread *td, struct ibcs2_rmdir_args *uap) -{ - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_rmdirat(td, AT_FDCWD, path, UIO_SYSSPACE); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_mkdir(struct thread *td, struct ibcs2_mkdir_args *uap) -{ - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_mkdirat(td, AT_FDCWD, path, UIO_SYSSPACE, uap->mode); - free(path, M_TEMP); - return (error); -} - -int -ibcs2_symlink(struct thread *td, struct ibcs2_symlink_args *uap) -{ - char *path, *link; - int error; - - CHECKALTEXIST(td, uap->path, &path); - - /* - * Have to expand CHECKALTCREAT() so that 'path' can be freed on - * errors. - */ - error = ibcs2_emul_find(td, uap->link, UIO_USERSPACE, &link, 1); - if (link == NULL) { - free(path, M_TEMP); - return (error); - } - error = kern_symlinkat(td, path, AT_FDCWD, link, UIO_SYSSPACE); - free(path, M_TEMP); - free(link, M_TEMP); - return (error); -} - -int -ibcs2_rename(struct thread *td, struct ibcs2_rename_args *uap) -{ - char *from, *to; - int error; - - CHECKALTEXIST(td, uap->from, &from); - - /* - * Have to expand CHECKALTCREAT() so that 'from' can be freed on - * errors. - */ - error = ibcs2_emul_find(td, uap->to, UIO_USERSPACE, &to, 1); - if (to == NULL) { - free(from, M_TEMP); - return (error); - } - error = kern_renameat(td, AT_FDCWD, from, AT_FDCWD, to, UIO_SYSSPACE); - free(from, M_TEMP); - free(to, M_TEMP); - return (error); -} - -int -ibcs2_readlink(struct thread *td, struct ibcs2_readlink_args *uap) -{ - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_readlinkat(td, AT_FDCWD, path, UIO_SYSSPACE, - uap->buf, UIO_USERSPACE, uap->count); - free(path, M_TEMP); - return (error); -} diff --git a/sys/i386/ibcs2/ibcs2_mount.h b/sys/i386/ibcs2/ibcs2_mount.h deleted file mode 100644 index 050511ac55d..00000000000 --- a/sys/i386/ibcs2/ibcs2_mount.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $NetBSD: ibcs2_mount.h,v 1.2 1994/10/26 02:53:00 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_MOUNT_H -#define _IBCS2_MOUNT_H - -#define IBCS2_MS_RDONLY 0x01 -#define IBCS2_MS_FSS 0x02 -#define IBCS2_MS_DATA 0x04 -#define IBCS2_MS_CACHE 0x08 - -#endif /* _IBCS2_MOUNT_H */ diff --git a/sys/i386/ibcs2/ibcs2_msg.c b/sys/i386/ibcs2/ibcs2_msg.c deleted file mode 100644 index 4e47adc0b29..00000000000 --- a/sys/i386/ibcs2/ibcs2_msg.c +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * IBCS2 message compatibility module. - * - */ - -#include -#include -#include -#include - -#include -#include -#include -#include - - -int -ibcs2_getmsg(td, uap) - struct thread *td; - struct ibcs2_getmsg_args *uap; -{ - return 0; /* fake */ -} - -int -ibcs2_putmsg(td, uap) - struct thread *td; - struct ibcs2_putmsg_args *uap; -{ - return 0; /* fake */ -} diff --git a/sys/i386/ibcs2/ibcs2_other.c b/sys/i386/ibcs2/ibcs2_other.c deleted file mode 100644 index f6e08be0f7d..00000000000 --- a/sys/i386/ibcs2/ibcs2_other.c +++ /dev/null @@ -1,121 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * IBCS2 compatibility module. - */ - -#include "opt_spx_hack.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define IBCS2_SECURE_GETLUID 1 -#define IBCS2_SECURE_SETLUID 2 - -int -ibcs2_secure(struct thread *td, struct ibcs2_secure_args *uap) -{ - switch (uap->cmd) { - - case IBCS2_SECURE_GETLUID: /* get login uid */ - td->td_retval[0] = td->td_ucred->cr_uid; - return 0; - - case IBCS2_SECURE_SETLUID: /* set login uid */ - return EPERM; - - default: - printf("IBCS2: 'secure' cmd=%d not implemented\n", uap->cmd); - } - - return EINVAL; -} - -int -ibcs2_lseek(struct thread *td, struct ibcs2_lseek_args *uap) -{ - struct lseek_args largs; - int error; - - largs.fd = uap->fd; - largs.offset = uap->offset; - largs.whence = uap->whence; - error = sys_lseek(td, &largs); - return (error); -} - -#ifdef SPX_HACK -#include -#include - -int -spx_open(struct thread *td) -{ - struct socket_args sock; - struct sockaddr_un sun; - int fd, error; - - /* obtain a socket. */ - DPRINTF(("SPX: open socket\n")); - sock.domain = AF_UNIX; - sock.type = SOCK_STREAM; - sock.protocol = 0; - error = sys_socket(td, &sock); - if (error) - return error; - fd = td->td_retval[0]; - - /* connect the socket to standard X socket */ - DPRINTF(("SPX: connect to /tmp/X11-unix/X0\n")); - sun.sun_family = AF_UNIX; - strcpy(sun.sun_path, "/tmp/.X11-unix/X0"); - sun.sun_len = sizeof(struct sockaddr_un) - sizeof(sun.sun_path) + - strlen(sun.sun_path) + 1; - - error = kern_connectat(td, AT_FDCWD, fd, (struct sockaddr *)&sun); - if (error) { - kern_close(td, fd); - return error; - } - td->td_retval[0] = fd; - return 0; -} -#endif /* SPX_HACK */ diff --git a/sys/i386/ibcs2/ibcs2_proto.h b/sys/i386/ibcs2/ibcs2_proto.h deleted file mode 100644 index 837cd41a10d..00000000000 --- a/sys/i386/ibcs2/ibcs2_proto.h +++ /dev/null @@ -1,426 +0,0 @@ -/* - * System call prototypes. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - */ - -#ifndef _IBCS2_SYSPROTO_H_ -#define _IBCS2_SYSPROTO_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -struct proc; - -struct thread; - -#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ - 0 : sizeof(register_t) - sizeof(t)) - -#if BYTE_ORDER == LITTLE_ENDIAN -#define PADL_(t) 0 -#define PADR_(t) PAD_(t) -#else -#define PADL_(t) PAD_(t) -#define PADR_(t) 0 -#endif - -struct ibcs2_read_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char nbytes_l_[PADL_(u_int)]; u_int nbytes; char nbytes_r_[PADR_(u_int)]; -}; -struct ibcs2_open_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; -}; -struct ibcs2_wait_args { - char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; -}; -struct ibcs2_creat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; -}; -struct ibcs2_unlink_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; -}; -struct ibcs2_execv_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)]; -}; -struct ibcs2_chdir_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; -}; -struct ibcs2_time_args { - char tp_l_[PADL_(ibcs2_time_t *)]; ibcs2_time_t * tp; char tp_r_[PADR_(ibcs2_time_t *)]; -}; -struct ibcs2_mknod_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; - char dev_l_[PADL_(int)]; int dev; char dev_r_[PADR_(int)]; -}; -struct ibcs2_chmod_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; -}; -struct ibcs2_chown_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)]; - char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)]; -}; -struct ibcs2_stat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char st_l_[PADL_(struct ibcs2_stat *)]; struct ibcs2_stat * st; char st_r_[PADR_(struct ibcs2_stat *)]; -}; -struct ibcs2_lseek_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char offset_l_[PADL_(long)]; long offset; char offset_r_[PADR_(long)]; - char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; -}; -struct ibcs2_mount_args { - char special_l_[PADL_(char *)]; char * special; char special_r_[PADR_(char *)]; - char dir_l_[PADL_(char *)]; char * dir; char dir_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char fstype_l_[PADL_(int)]; int fstype; char fstype_r_[PADR_(int)]; - char data_l_[PADL_(char *)]; char * data; char data_r_[PADR_(char *)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; -}; -struct ibcs2_umount_args { - char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; -}; -struct ibcs2_setuid_args { - char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)]; -}; -struct ibcs2_stime_args { - char timep_l_[PADL_(long *)]; long * timep; char timep_r_[PADR_(long *)]; -}; -struct ibcs2_alarm_args { - char sec_l_[PADL_(unsigned)]; unsigned sec; char sec_r_[PADR_(unsigned)]; -}; -struct ibcs2_fstat_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char st_l_[PADL_(struct ibcs2_stat *)]; struct ibcs2_stat * st; char st_r_[PADR_(struct ibcs2_stat *)]; -}; -struct ibcs2_pause_args { - register_t dummy; -}; -struct ibcs2_utime_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char buf_l_[PADL_(struct ibcs2_utimbuf *)]; struct ibcs2_utimbuf * buf; char buf_r_[PADR_(struct ibcs2_utimbuf *)]; -}; -struct ibcs2_access_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)]; -}; -struct ibcs2_nice_args { - char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)]; -}; -struct ibcs2_statfs_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char buf_l_[PADL_(struct ibcs2_statfs *)]; struct ibcs2_statfs * buf; char buf_r_[PADR_(struct ibcs2_statfs *)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; - char fstype_l_[PADL_(int)]; int fstype; char fstype_r_[PADR_(int)]; -}; -struct ibcs2_kill_args { - char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; - char signo_l_[PADL_(int)]; int signo; char signo_r_[PADR_(int)]; -}; -struct ibcs2_fstatfs_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(struct ibcs2_statfs *)]; struct ibcs2_statfs * buf; char buf_r_[PADR_(struct ibcs2_statfs *)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; - char fstype_l_[PADL_(int)]; int fstype; char fstype_r_[PADR_(int)]; -}; -struct ibcs2_pgrpsys_args { - char type_l_[PADL_(int)]; int type; char type_r_[PADR_(int)]; - char dummy_l_[PADL_(caddr_t)]; caddr_t dummy; char dummy_r_[PADR_(caddr_t)]; - char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; - char pgid_l_[PADL_(int)]; int pgid; char pgid_r_[PADR_(int)]; -}; -struct ibcs2_xenix_args { - char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; - char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; - char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)]; -}; -struct ibcs2_times_args { - char tp_l_[PADL_(struct tms *)]; struct tms * tp; char tp_r_[PADR_(struct tms *)]; -}; -struct ibcs2_plock_args { - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; -}; -struct ibcs2_setgid_args { - char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)]; -}; -struct ibcs2_sigsys_args { - char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; - char fp_l_[PADL_(ibcs2_sig_t)]; ibcs2_sig_t fp; char fp_r_[PADR_(ibcs2_sig_t)]; -}; -struct ibcs2_msgsys_args { - char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; - char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; - char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)]; - char a6_l_[PADL_(int)]; int a6; char a6_r_[PADR_(int)]; -}; -struct ibcs2_sysi86_args { - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char arg_l_[PADL_(int *)]; int * arg; char arg_r_[PADR_(int *)]; -}; -struct ibcs2_shmsys_args { - char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; - char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; -}; -struct ibcs2_semsys_args { - char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; - char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; - char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)]; -}; -struct ibcs2_ioctl_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)]; -}; -struct ibcs2_uadmin_args { - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char func_l_[PADL_(int)]; int func; char func_r_[PADR_(int)]; - char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)]; -}; -struct ibcs2_utssys_args { - char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; -}; -struct ibcs2_execve_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)]; - char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)]; -}; -struct ibcs2_fcntl_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char arg_l_[PADL_(char *)]; char * arg; char arg_r_[PADR_(char *)]; -}; -struct ibcs2_ulimit_args { - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char newlimit_l_[PADL_(int)]; int newlimit; char newlimit_r_[PADR_(int)]; -}; -struct ibcs2_rmdir_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; -}; -struct ibcs2_mkdir_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; -}; -struct ibcs2_getdents_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char nbytes_l_[PADL_(int)]; int nbytes; char nbytes_r_[PADR_(int)]; -}; -struct ibcs2_sysfs_args { - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char d1_l_[PADL_(caddr_t)]; caddr_t d1; char d1_r_[PADR_(caddr_t)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; -}; -struct ibcs2_getmsg_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char ctl_l_[PADL_(struct ibcs2_stropts *)]; struct ibcs2_stropts * ctl; char ctl_r_[PADR_(struct ibcs2_stropts *)]; - char dat_l_[PADL_(struct ibcs2_stropts *)]; struct ibcs2_stropts * dat; char dat_r_[PADR_(struct ibcs2_stropts *)]; - char flags_l_[PADL_(int *)]; int * flags; char flags_r_[PADR_(int *)]; -}; -struct ibcs2_putmsg_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char ctl_l_[PADL_(struct ibcs2_stropts *)]; struct ibcs2_stropts * ctl; char ctl_r_[PADR_(struct ibcs2_stropts *)]; - char dat_l_[PADL_(struct ibcs2_stropts *)]; struct ibcs2_stropts * dat; char dat_r_[PADR_(struct ibcs2_stropts *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct ibcs2_secure_args { - char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char a1_l_[PADL_(int)]; int a1; char a1_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; - char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; - char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)]; -}; -struct ibcs2_symlink_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char link_l_[PADL_(char *)]; char * link; char link_r_[PADR_(char *)]; -}; -struct ibcs2_lstat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char st_l_[PADL_(struct ibcs2_stat *)]; struct ibcs2_stat * st; char st_r_[PADR_(struct ibcs2_stat *)]; -}; -struct ibcs2_readlink_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char count_l_[PADL_(int)]; int count; char count_r_[PADR_(int)]; -}; -struct ibcs2_isc_args { - register_t dummy; -}; -int ibcs2_read(struct thread *, struct ibcs2_read_args *); -int ibcs2_open(struct thread *, struct ibcs2_open_args *); -int ibcs2_wait(struct thread *, struct ibcs2_wait_args *); -int ibcs2_creat(struct thread *, struct ibcs2_creat_args *); -int ibcs2_unlink(struct thread *, struct ibcs2_unlink_args *); -int ibcs2_execv(struct thread *, struct ibcs2_execv_args *); -int ibcs2_chdir(struct thread *, struct ibcs2_chdir_args *); -int ibcs2_time(struct thread *, struct ibcs2_time_args *); -int ibcs2_mknod(struct thread *, struct ibcs2_mknod_args *); -int ibcs2_chmod(struct thread *, struct ibcs2_chmod_args *); -int ibcs2_chown(struct thread *, struct ibcs2_chown_args *); -int ibcs2_stat(struct thread *, struct ibcs2_stat_args *); -int ibcs2_lseek(struct thread *, struct ibcs2_lseek_args *); -int ibcs2_mount(struct thread *, struct ibcs2_mount_args *); -int ibcs2_umount(struct thread *, struct ibcs2_umount_args *); -int ibcs2_setuid(struct thread *, struct ibcs2_setuid_args *); -int ibcs2_stime(struct thread *, struct ibcs2_stime_args *); -int ibcs2_alarm(struct thread *, struct ibcs2_alarm_args *); -int ibcs2_fstat(struct thread *, struct ibcs2_fstat_args *); -int ibcs2_pause(struct thread *, struct ibcs2_pause_args *); -int ibcs2_utime(struct thread *, struct ibcs2_utime_args *); -int ibcs2_access(struct thread *, struct ibcs2_access_args *); -int ibcs2_nice(struct thread *, struct ibcs2_nice_args *); -int ibcs2_statfs(struct thread *, struct ibcs2_statfs_args *); -int ibcs2_kill(struct thread *, struct ibcs2_kill_args *); -int ibcs2_fstatfs(struct thread *, struct ibcs2_fstatfs_args *); -int ibcs2_pgrpsys(struct thread *, struct ibcs2_pgrpsys_args *); -int ibcs2_xenix(struct thread *, struct ibcs2_xenix_args *); -int ibcs2_times(struct thread *, struct ibcs2_times_args *); -int ibcs2_plock(struct thread *, struct ibcs2_plock_args *); -int ibcs2_setgid(struct thread *, struct ibcs2_setgid_args *); -int ibcs2_sigsys(struct thread *, struct ibcs2_sigsys_args *); -int ibcs2_msgsys(struct thread *, struct ibcs2_msgsys_args *); -int ibcs2_sysi86(struct thread *, struct ibcs2_sysi86_args *); -int ibcs2_shmsys(struct thread *, struct ibcs2_shmsys_args *); -int ibcs2_semsys(struct thread *, struct ibcs2_semsys_args *); -int ibcs2_ioctl(struct thread *, struct ibcs2_ioctl_args *); -int ibcs2_uadmin(struct thread *, struct ibcs2_uadmin_args *); -int ibcs2_utssys(struct thread *, struct ibcs2_utssys_args *); -int ibcs2_execve(struct thread *, struct ibcs2_execve_args *); -int ibcs2_fcntl(struct thread *, struct ibcs2_fcntl_args *); -int ibcs2_ulimit(struct thread *, struct ibcs2_ulimit_args *); -int ibcs2_rmdir(struct thread *, struct ibcs2_rmdir_args *); -int ibcs2_mkdir(struct thread *, struct ibcs2_mkdir_args *); -int ibcs2_getdents(struct thread *, struct ibcs2_getdents_args *); -int ibcs2_sysfs(struct thread *, struct ibcs2_sysfs_args *); -int ibcs2_getmsg(struct thread *, struct ibcs2_getmsg_args *); -int ibcs2_putmsg(struct thread *, struct ibcs2_putmsg_args *); -int ibcs2_secure(struct thread *, struct ibcs2_secure_args *); -int ibcs2_symlink(struct thread *, struct ibcs2_symlink_args *); -int ibcs2_lstat(struct thread *, struct ibcs2_lstat_args *); -int ibcs2_readlink(struct thread *, struct ibcs2_readlink_args *); -int ibcs2_isc(struct thread *, struct ibcs2_isc_args *); - -#ifdef COMPAT_43 - - -#endif /* COMPAT_43 */ - - -#ifdef COMPAT_FREEBSD4 - - -#endif /* COMPAT_FREEBSD4 */ - - -#ifdef COMPAT_FREEBSD6 - - -#endif /* COMPAT_FREEBSD6 */ - - -#ifdef COMPAT_FREEBSD7 - - -#endif /* COMPAT_FREEBSD7 */ - - -#ifdef COMPAT_FREEBSD10 - - -#endif /* COMPAT_FREEBSD10 */ - - -#ifdef COMPAT_FREEBSD11 - - -#endif /* COMPAT_FREEBSD11 */ - -#define IBCS2_SYS_AUE_ibcs2_read AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_open AUE_OPEN_RWTC -#define IBCS2_SYS_AUE_ibcs2_wait AUE_WAIT4 -#define IBCS2_SYS_AUE_ibcs2_creat AUE_CREAT -#define IBCS2_SYS_AUE_ibcs2_unlink AUE_UNLINK -#define IBCS2_SYS_AUE_ibcs2_execv AUE_EXECVE -#define IBCS2_SYS_AUE_ibcs2_chdir AUE_CHDIR -#define IBCS2_SYS_AUE_ibcs2_time AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_mknod AUE_MKNOD -#define IBCS2_SYS_AUE_ibcs2_chmod AUE_CHMOD -#define IBCS2_SYS_AUE_ibcs2_chown AUE_CHOWN -#define IBCS2_SYS_AUE_ibcs2_stat AUE_STAT -#define IBCS2_SYS_AUE_ibcs2_lseek AUE_LSEEK -#define IBCS2_SYS_AUE_ibcs2_mount AUE_MOUNT -#define IBCS2_SYS_AUE_ibcs2_umount AUE_UMOUNT -#define IBCS2_SYS_AUE_ibcs2_setuid AUE_SETUID -#define IBCS2_SYS_AUE_ibcs2_stime AUE_SETTIMEOFDAY -#define IBCS2_SYS_AUE_ibcs2_alarm AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_fstat AUE_FSTAT -#define IBCS2_SYS_AUE_ibcs2_pause AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_utime AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_access AUE_ACCESS -#define IBCS2_SYS_AUE_ibcs2_nice AUE_NICE -#define IBCS2_SYS_AUE_ibcs2_statfs AUE_STATFS -#define IBCS2_SYS_AUE_ibcs2_kill AUE_KILL -#define IBCS2_SYS_AUE_ibcs2_fstatfs AUE_FSTATFS -#define IBCS2_SYS_AUE_ibcs2_pgrpsys AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_xenix AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_times AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_plock AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_setgid AUE_SETGID -#define IBCS2_SYS_AUE_ibcs2_sigsys AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_msgsys AUE_MSGSYS -#define IBCS2_SYS_AUE_ibcs2_sysi86 AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_shmsys AUE_SHMSYS -#define IBCS2_SYS_AUE_ibcs2_semsys AUE_SEMSYS -#define IBCS2_SYS_AUE_ibcs2_ioctl AUE_IOCTL -#define IBCS2_SYS_AUE_ibcs2_uadmin AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_utssys AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_execve AUE_EXECVE -#define IBCS2_SYS_AUE_ibcs2_fcntl AUE_FCNTL -#define IBCS2_SYS_AUE_ibcs2_ulimit AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_rmdir AUE_RMDIR -#define IBCS2_SYS_AUE_ibcs2_mkdir AUE_MKDIR -#define IBCS2_SYS_AUE_ibcs2_getdents AUE_GETDIRENTRIES -#define IBCS2_SYS_AUE_ibcs2_sysfs AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_getmsg AUE_GETMSG -#define IBCS2_SYS_AUE_ibcs2_putmsg AUE_PUTMSG -#define IBCS2_SYS_AUE_ibcs2_secure AUE_NULL -#define IBCS2_SYS_AUE_ibcs2_symlink AUE_SYMLINK -#define IBCS2_SYS_AUE_ibcs2_lstat AUE_LSTAT -#define IBCS2_SYS_AUE_ibcs2_readlink AUE_READLINK -#define IBCS2_SYS_AUE_ibcs2_isc AUE_NULL - -#undef PAD_ -#undef PADL_ -#undef PADR_ - -#endif /* !_IBCS2_SYSPROTO_H_ */ diff --git a/sys/i386/ibcs2/ibcs2_signal.c b/sys/i386/ibcs2/ibcs2_signal.c deleted file mode 100644 index 1e3a6f44673..00000000000 --- a/sys/i386/ibcs2/ibcs2_signal.c +++ /dev/null @@ -1,429 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1995 Scott Bartram - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define sigemptyset(s) SIGEMPTYSET(*(s)) -#define sigismember(s, n) SIGISMEMBER(*(s), n) -#define sigaddset(s, n) SIGADDSET(*(s), n) - -#define ibcs2_sigmask(n) (1 << ((n) - 1)) -#define ibcs2_sigemptyset(s) bzero((s), sizeof(*(s))) -#define ibcs2_sigismember(s, n) (*(s) & ibcs2_sigmask(n)) -#define ibcs2_sigaddset(s, n) (*(s) |= ibcs2_sigmask(n)) - -static void ibcs2_to_bsd_sigset(const ibcs2_sigset_t *, sigset_t *); -static void bsd_to_ibcs2_sigset(const sigset_t *, ibcs2_sigset_t *); -static void ibcs2_to_bsd_sigaction(struct ibcs2_sigaction *, - struct sigaction *); -static void bsd_to_ibcs2_sigaction(struct sigaction *, - struct ibcs2_sigaction *); - -int bsd_to_ibcs2_sig[IBCS2_SIGTBLSZ] = { - IBCS2_SIGHUP, /* 1 */ - IBCS2_SIGINT, /* 2 */ - IBCS2_SIGQUIT, /* 3 */ - IBCS2_SIGILL, /* 4 */ - IBCS2_SIGTRAP, /* 5 */ - IBCS2_SIGABRT, /* 6 */ - IBCS2_SIGEMT, /* 7 */ - IBCS2_SIGFPE, /* 8 */ - IBCS2_SIGKILL, /* 9 */ - IBCS2_SIGBUS, /* 10 */ - IBCS2_SIGSEGV, /* 11 */ - IBCS2_SIGSYS, /* 12 */ - IBCS2_SIGPIPE, /* 13 */ - IBCS2_SIGALRM, /* 14 */ - IBCS2_SIGTERM, /* 15 */ - 0, /* 16 - SIGURG */ - IBCS2_SIGSTOP, /* 17 */ - IBCS2_SIGTSTP, /* 18 */ - IBCS2_SIGCONT, /* 19 */ - IBCS2_SIGCLD, /* 20 */ - IBCS2_SIGTTIN, /* 21 */ - IBCS2_SIGTTOU, /* 22 */ - IBCS2_SIGPOLL, /* 23 */ - 0, /* 24 - SIGXCPU */ - 0, /* 25 - SIGXFSZ */ - IBCS2_SIGVTALRM, /* 26 */ - IBCS2_SIGPROF, /* 27 */ - IBCS2_SIGWINCH, /* 28 */ - 0, /* 29 */ - IBCS2_SIGUSR1, /* 30 */ - IBCS2_SIGUSR2, /* 31 */ - 0 /* 32 */ -}; - -static int ibcs2_to_bsd_sig[IBCS2_SIGTBLSZ] = { - SIGHUP, /* 1 */ - SIGINT, /* 2 */ - SIGQUIT, /* 3 */ - SIGILL, /* 4 */ - SIGTRAP, /* 5 */ - SIGABRT, /* 6 */ - SIGEMT, /* 7 */ - SIGFPE, /* 8 */ - SIGKILL, /* 9 */ - SIGBUS, /* 10 */ - SIGSEGV, /* 11 */ - SIGSYS, /* 12 */ - SIGPIPE, /* 13 */ - SIGALRM, /* 14 */ - SIGTERM, /* 15 */ - SIGUSR1, /* 16 */ - SIGUSR2, /* 17 */ - SIGCHLD, /* 18 */ - 0, /* 19 - SIGPWR */ - SIGWINCH, /* 20 */ - 0, /* 21 */ - SIGIO, /* 22 */ - SIGSTOP, /* 23 */ - SIGTSTP, /* 24 */ - SIGCONT, /* 25 */ - SIGTTIN, /* 26 */ - SIGTTOU, /* 27 */ - SIGVTALRM, /* 28 */ - SIGPROF, /* 29 */ - 0, /* 30 */ - 0, /* 31 */ - 0 /* 32 */ -}; - -void -ibcs2_to_bsd_sigset(iss, bss) - const ibcs2_sigset_t *iss; - sigset_t *bss; -{ - int i, newsig; - - sigemptyset(bss); - for (i = 1; i <= IBCS2_SIGTBLSZ; i++) { - if (ibcs2_sigismember(iss, i)) { - newsig = ibcs2_to_bsd_sig[_SIG_IDX(i)]; - if (newsig) - sigaddset(bss, newsig); - } - } -} - -static void -bsd_to_ibcs2_sigset(bss, iss) - const sigset_t *bss; - ibcs2_sigset_t *iss; -{ - int i, newsig; - - ibcs2_sigemptyset(iss); - for (i = 1; i <= IBCS2_SIGTBLSZ; i++) { - if (sigismember(bss, i)) { - newsig = bsd_to_ibcs2_sig[_SIG_IDX(i)]; - if (newsig) - ibcs2_sigaddset(iss, newsig); - } - } -} - -static void -ibcs2_to_bsd_sigaction(isa, bsa) - struct ibcs2_sigaction *isa; - struct sigaction *bsa; -{ - - bsa->sa_handler = isa->isa_handler; - ibcs2_to_bsd_sigset(&isa->isa_mask, &bsa->sa_mask); - bsa->sa_flags = 0; /* ??? SA_NODEFER */ - if ((isa->isa_flags & IBCS2_SA_NOCLDSTOP) != 0) - bsa->sa_flags |= SA_NOCLDSTOP; -} - -static void -bsd_to_ibcs2_sigaction(bsa, isa) - struct sigaction *bsa; - struct ibcs2_sigaction *isa; -{ - - isa->isa_handler = bsa->sa_handler; - bsd_to_ibcs2_sigset(&bsa->sa_mask, &isa->isa_mask); - isa->isa_flags = 0; - if ((bsa->sa_flags & SA_NOCLDSTOP) != 0) - isa->isa_flags |= IBCS2_SA_NOCLDSTOP; -} - -int -ibcs2_sigaction(struct thread *td, struct ibcs2_sigaction_args *uap) -{ - struct ibcs2_sigaction isa; - struct sigaction nbsa, obsa; - struct sigaction *nbsap; - int error; - - if (uap->act != NULL) { - if ((error = copyin(uap->act, &isa, sizeof(isa))) != 0) - return (error); - ibcs2_to_bsd_sigaction(&isa, &nbsa); - nbsap = &nbsa; - } else - nbsap = NULL; - if (uap->sig <= 0 || uap->sig > IBCS2_NSIG) - return (EINVAL); - error = kern_sigaction(td, ibcs2_to_bsd_sig[_SIG_IDX(uap->sig)], &nbsa, - &obsa, 0); - if (error == 0 && uap->oact != NULL) { - bsd_to_ibcs2_sigaction(&obsa, &isa); - error = copyout(&isa, uap->oact, sizeof(isa)); - } - return (error); -} - -int -ibcs2_sigsys(struct thread *td, struct ibcs2_sigsys_args *uap) -{ - struct proc *p = td->td_proc; - struct sigaction sa; - int signum = IBCS2_SIGNO(uap->sig); - int error; - - if (signum <= 0 || signum > IBCS2_NSIG) { - if (IBCS2_SIGCALL(uap->sig) == IBCS2_SIGNAL_MASK || - IBCS2_SIGCALL(uap->sig) == IBCS2_SIGSET_MASK) - td->td_retval[0] = (int)IBCS2_SIG_ERR; - return EINVAL; - } - signum = ibcs2_to_bsd_sig[_SIG_IDX(signum)]; - - switch (IBCS2_SIGCALL(uap->sig)) { - case IBCS2_SIGSET_MASK: - /* - * Check for SIG_HOLD action. - * Otherwise, perform signal() except with different sa_flags. - */ - if (uap->fp != IBCS2_SIG_HOLD) { - /* add sig to mask before exececuting signal handler */ - sa.sa_flags = 0; - goto ibcs2_sigset; - } - /* else FALLTHROUGH to sighold */ - - case IBCS2_SIGHOLD_MASK: - { - sigset_t mask; - - SIGEMPTYSET(mask); - SIGADDSET(mask, signum); - return (kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, - 0)); - } - - case IBCS2_SIGNAL_MASK: - { - struct sigaction osa; - - /* do not automatically block signal */ - sa.sa_flags = SA_NODEFER; -#ifdef SA_RESETHAND - if((signum != IBCS2_SIGILL) && - (signum != IBCS2_SIGTRAP) && - (signum != IBCS2_SIGPWR)) - /* set to SIG_DFL before executing handler */ - sa.sa_flags |= SA_RESETHAND; -#endif - ibcs2_sigset: - sa.sa_handler = uap->fp; - sigemptyset(&sa.sa_mask); -#if 0 - if (signum != SIGALRM) - sa.sa_flags |= SA_RESTART; -#endif - error = kern_sigaction(td, signum, &sa, &osa, 0); - if (error != 0) { - DPRINTF(("signal: sigaction failed: %d\n", - error)); - td->td_retval[0] = (int)IBCS2_SIG_ERR; - return (error); - } - td->td_retval[0] = (int)osa.sa_handler; - - /* special sigset() check */ - if(IBCS2_SIGCALL(uap->sig) == IBCS2_SIGSET_MASK) { - PROC_LOCK(p); - /* check to make sure signal is not blocked */ - if(sigismember(&td->td_sigmask, signum)) { - /* return SIG_HOLD and unblock signal*/ - td->td_retval[0] = (int)IBCS2_SIG_HOLD; - SIGDELSET(td->td_sigmask, signum); - signotify(td); - } - PROC_UNLOCK(p); - } - - return 0; - } - - case IBCS2_SIGRELSE_MASK: - { - sigset_t mask; - - SIGEMPTYSET(mask); - SIGADDSET(mask, signum); - return (kern_sigprocmask(td, SIG_UNBLOCK, &mask, NULL, - 0)); - } - - case IBCS2_SIGIGNORE_MASK: - { - sa.sa_handler = SIG_IGN; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - error = kern_sigaction(td, signum, &sa, NULL, 0); - if (error != 0) - DPRINTF(("sigignore: sigaction failed\n")); - return (error); - } - - case IBCS2_SIGPAUSE_MASK: - { - sigset_t mask; - - PROC_LOCK(p); - mask = td->td_sigmask; - PROC_UNLOCK(p); - SIGDELSET(mask, signum); - return kern_sigsuspend(td, mask); - } - - default: - return ENOSYS; - } -} - -int -ibcs2_sigprocmask(struct thread *td, struct ibcs2_sigprocmask_args *uap) -{ - ibcs2_sigset_t iss; - sigset_t oss, nss; - sigset_t *nssp; - int error, how; - - switch (uap->how) { - case IBCS2_SIG_BLOCK: - how = SIG_BLOCK; - break; - case IBCS2_SIG_UNBLOCK: - how = SIG_UNBLOCK; - break; - case IBCS2_SIG_SETMASK: - how = SIG_SETMASK; - break; - default: - return (EINVAL); - } - if (uap->set != NULL) { - if ((error = copyin(uap->set, &iss, sizeof(iss))) != 0) - return error; - ibcs2_to_bsd_sigset(&iss, &nss); - nssp = &nss; - } else - nssp = NULL; - error = kern_sigprocmask(td, how, nssp, &oss, 0); - if (error == 0 && uap->oset != NULL) { - bsd_to_ibcs2_sigset(&oss, &iss); - error = copyout(&iss, uap->oset, sizeof(iss)); - } - return (error); -} - -int -ibcs2_sigpending(struct thread *td, struct ibcs2_sigpending_args *uap) -{ - struct proc *p = td->td_proc; - sigset_t bss; - ibcs2_sigset_t iss; - - PROC_LOCK(p); - bss = td->td_siglist; - SIGSETOR(bss, p->p_siglist); - SIGSETAND(bss, td->td_sigmask); - PROC_UNLOCK(p); - bsd_to_ibcs2_sigset(&bss, &iss); - - return copyout(&iss, uap->mask, sizeof(iss)); -} - -int -ibcs2_sigsuspend(struct thread *td, struct ibcs2_sigsuspend_args *uap) -{ - ibcs2_sigset_t sss; - sigset_t bss; - int error; - - if ((error = copyin(uap->mask, &sss, sizeof(sss))) != 0) - return error; - - ibcs2_to_bsd_sigset(&sss, &bss); - return kern_sigsuspend(td, bss); -} - -int -ibcs2_pause(struct thread *td, struct ibcs2_pause_args *uap) -{ - sigset_t mask; - - PROC_LOCK(td->td_proc); - mask = td->td_sigmask; - PROC_UNLOCK(td->td_proc); - return kern_sigsuspend(td, mask); -} - -int -ibcs2_kill(struct thread *td, struct ibcs2_kill_args *uap) -{ - struct kill_args ka; - - if (uap->signo <= 0 || uap->signo > IBCS2_NSIG) - return (EINVAL); - ka.pid = uap->pid; - ka.signum = ibcs2_to_bsd_sig[_SIG_IDX(uap->signo)]; - return sys_kill(td, &ka); -} diff --git a/sys/i386/ibcs2/ibcs2_signal.h b/sys/i386/ibcs2/ibcs2_signal.h deleted file mode 100644 index 6d47b63722b..00000000000 --- a/sys/i386/ibcs2/ibcs2_signal.h +++ /dev/null @@ -1,112 +0,0 @@ -/* $NetBSD: ibcs2_signal.h,v 1.7 1995/08/14 02:26:01 mycroft Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994, 1995 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _IBCS2_SIGNAL_H -#define _IBCS2_SIGNAL_H - -#define IBCS2_SIGHUP 1 -#define IBCS2_SIGINT 2 -#define IBCS2_SIGQUIT 3 -#define IBCS2_SIGILL 4 -#define IBCS2_SIGTRAP 5 -#define IBCS2_SIGIOT 6 -#define IBCS2_SIGABRT 6 -#define IBCS2_SIGEMT 7 -#define IBCS2_SIGFPE 8 -#define IBCS2_SIGKILL 9 -#define IBCS2_SIGBUS 10 -#define IBCS2_SIGSEGV 11 -#define IBCS2_SIGSYS 12 -#define IBCS2_SIGPIPE 13 -#define IBCS2_SIGALRM 14 -#define IBCS2_SIGTERM 15 -#define IBCS2_SIGUSR1 16 -#define IBCS2_SIGUSR2 17 -#define IBCS2_SIGCLD 18 -#define IBCS2_SIGPWR 19 -#define IBCS2_SIGWINCH 20 -#define IBCS2_SIGPOLL 22 -#define IBCS2_NSIG 32 -#define IBCS2_SIGTBLSZ 32 - -/* - * SCO-specific - */ -#define IBCS2_SIGSTOP 23 -#define IBCS2_SIGTSTP 24 -#define IBCS2_SIGCONT 25 -#define IBCS2_SIGTTIN 26 -#define IBCS2_SIGTTOU 27 -#define IBCS2_SIGVTALRM 28 -#define IBCS2_SIGPROF 29 - -#define IBCS2_SIGNO_MASK 0x00FF -#define IBCS2_SIGNAL_MASK 0x0000 -#define IBCS2_SIGSET_MASK 0x0100 -#define IBCS2_SIGHOLD_MASK 0x0200 -#define IBCS2_SIGRELSE_MASK 0x0400 -#define IBCS2_SIGIGNORE_MASK 0x0800 -#define IBCS2_SIGPAUSE_MASK 0x1000 - -#define IBCS2_SIGNO(x) ((x) & IBCS2_SIGNO_MASK) -#define IBCS2_SIGCALL(x) ((x) & ~IBCS2_SIGNO_MASK) - -typedef long ibcs2_sigset_t; -typedef void (*ibcs2_sig_t)(int); - -struct ibcs2_sigaction { - ibcs2_sig_t isa_handler; - ibcs2_sigset_t isa_mask; - int isa_flags; -}; - -#define IBCS2_SIG_DFL ((ibcs2_sig_t)0) -#define IBCS2_SIG_ERR ((ibcs2_sig_t)-1) -#define IBCS2_SIG_IGN ((ibcs2_sig_t)1) -#define IBCS2_SIG_HOLD ((ibcs2_sig_t)2) - -#define IBCS2_SIG_SETMASK 0 -#define IBCS2_SIG_BLOCK 1 -#define IBCS2_SIG_UNBLOCK 2 - -/* sa_flags */ -#define IBCS2_SA_NOCLDSTOP 1 - -#define IBCS2_MINSIGSTKSZ 8192 - -extern int bsd_to_ibcs2_sig[]; - -#endif /* _IBCS2_SIGNAL_H */ diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c deleted file mode 100644 index a11a4b9f668..00000000000 --- a/sys/i386/ibcs2/ibcs2_socksys.c +++ /dev/null @@ -1,206 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1994, 1995 Scott Bartram - * Copyright (c) 1994 Arne H Juul - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include - -#include -#include - -/* Local structures */ -struct getipdomainname_args { - char *ipdomainname; - int len; -}; - -struct setipdomainname_args { - char *ipdomainname; - int len; -}; - -/* Local prototypes */ -static int ibcs2_getipdomainname(struct thread *, - struct getipdomainname_args *); -static int ibcs2_setipdomainname(struct thread *, - struct setipdomainname_args *); - -/* - * iBCS2 socksys calls. - */ - -int -ibcs2_socksys(struct thread *td, struct ibcs2_socksys_args *uap) -{ - int error; - int realargs[7]; /* 1 for command, 6 for recvfrom */ - void *passargs; - - /* - * SOCKET should only be legal on /dev/socksys. - * GETIPDOMAINNAME should only be legal on /dev/socksys ? - * The others are (and should be) only legal on sockets. - */ - - if ((error = copyin(uap->argsp, (caddr_t)realargs, sizeof(realargs))) != 0) - return error; - DPRINTF(("ibcs2_socksys: %08x %08x %08x %08x %08x %08x %08x\n", - realargs[0], realargs[1], realargs[2], realargs[3], - realargs[4], realargs[5], realargs[6])); - - passargs = (void *)(realargs + 1); - switch (realargs[0]) { - case SOCKSYS_ACCEPT: - return sys_accept(td, passargs); - case SOCKSYS_BIND: - return sys_bind(td, passargs); - case SOCKSYS_CONNECT: - return sys_connect(td, passargs); - case SOCKSYS_GETPEERNAME: - return sys_getpeername(td, passargs); - case SOCKSYS_GETSOCKNAME: - return sys_getsockname(td, passargs); - case SOCKSYS_GETSOCKOPT: - return sys_getsockopt(td, passargs); - case SOCKSYS_LISTEN: - return sys_listen(td, passargs); - case SOCKSYS_RECV: - realargs[5] = realargs[6] = 0; - /* FALLTHROUGH */ - case SOCKSYS_RECVFROM: - return sys_recvfrom(td, passargs); - case SOCKSYS_SEND: - realargs[5] = realargs[6] = 0; - /* FALLTHROUGH */ - case SOCKSYS_SENDTO: - return sys_sendto(td, passargs); - case SOCKSYS_SETSOCKOPT: - return sys_setsockopt(td, passargs); - case SOCKSYS_SHUTDOWN: - return sys_shutdown(td, passargs); - case SOCKSYS_SOCKET: - return sys_socket(td, passargs); - case SOCKSYS_SELECT: - return sys_select(td, passargs); - case SOCKSYS_GETIPDOMAIN: - return ibcs2_getipdomainname(td, passargs); - case SOCKSYS_SETIPDOMAIN: - return ibcs2_setipdomainname(td, passargs); - case SOCKSYS_ADJTIME: - return sys_adjtime(td, passargs); - case SOCKSYS_SETREUID: - return sys_setreuid(td, passargs); - case SOCKSYS_SETREGID: - return sys_setregid(td, passargs); - case SOCKSYS_GETTIME: - return sys_gettimeofday(td, passargs); - case SOCKSYS_SETTIME: - return sys_settimeofday(td, passargs); - case SOCKSYS_GETITIMER: - return sys_getitimer(td, passargs); - case SOCKSYS_SETITIMER: - return sys_setitimer(td, passargs); - - default: - printf("socksys unknown %08x %08x %08x %08x %08x %08x %08x\n", - realargs[0], realargs[1], realargs[2], realargs[3], - realargs[4], realargs[5], realargs[6]); - return EINVAL; - } - /* NOTREACHED */ -} - -/* ARGSUSED */ -static int -ibcs2_getipdomainname(struct thread *td, struct getipdomainname_args *uap) -{ - char hname[MAXHOSTNAMELEN], *dptr; - int len; - - /* Get the domain name. */ - getcredhostname(td->td_ucred, hname, sizeof(hname)); - - dptr = strchr(hname, '.'); - if ( dptr ) - dptr++; - else - /* Make it effectively an empty string */ - dptr = hname + strlen(hname); - - len = strlen(dptr) + 1; - if ((u_int)uap->len > len + 1) - uap->len = len + 1; - return (copyout((caddr_t)dptr, (caddr_t)uap->ipdomainname, uap->len)); -} - -/* ARGSUSED */ -static int -ibcs2_setipdomainname(struct thread *td, struct setipdomainname_args *uap) -{ - char hname[MAXHOSTNAMELEN], *ptr; - int error, sctl[2], hlen; - - /* Get the domain name */ - getcredhostname(td->td_ucred, hname, sizeof(hname)); - - /* W/out a hostname a domain-name is nonsense */ - if ( strlen(hname) == 0 ) - return EINVAL; - - /* Get the host's unqualified name (strip off the domain) */ - ptr = strchr(hname, '.'); - if ( ptr != NULL ) { - ptr++; - *ptr = '\0'; - } else { - if (strlcat(hname, ".", sizeof(hname)) >= sizeof(hname)) - return (EINVAL); - } - - /* Set ptr to the end of the string so we can append to it */ - hlen = strlen(hname); - ptr = hname + hlen; - if ((u_int)uap->len > (sizeof (hname) - hlen - 1)) - return EINVAL; - - /* Append the ipdomain to the end */ - error = copyinstr((caddr_t)uap->ipdomainname, ptr, uap->len, NULL); - if (error) - return (error); - - /* 'sethostname' with the new information */ - sctl[0] = CTL_KERN; - sctl[1] = KERN_HOSTNAME; - hlen = strlen(hname) + 1; - return (kernel_sysctl(td, sctl, 2, 0, 0, hname, hlen, 0, 0)); -} diff --git a/sys/i386/ibcs2/ibcs2_socksys.h b/sys/i386/ibcs2/ibcs2_socksys.h deleted file mode 100644 index b403063fedc..00000000000 --- a/sys/i386/ibcs2/ibcs2_socksys.h +++ /dev/null @@ -1,130 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1994, 1995 Scott Bartram - * Copyright (c) 1994 Arne H Juul - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _I386_IBCS2_IBCS2_SOCKSYS_H_ -#define _I386_IBCS2_IBCS2_SOCKSYS_H_ - -#include - -#include - -#define SOCKSYS_ACCEPT 1 -#define SOCKSYS_BIND 2 -#define SOCKSYS_CONNECT 3 -#define SOCKSYS_GETPEERNAME 4 -#define SOCKSYS_GETSOCKNAME 5 -#define SOCKSYS_GETSOCKOPT 6 -#define SOCKSYS_LISTEN 7 -#define SOCKSYS_RECV 8 -#define SOCKSYS_RECVFROM 9 -#define SOCKSYS_SEND 10 -#define SOCKSYS_SENDTO 11 -#define SOCKSYS_SETSOCKOPT 12 -#define SOCKSYS_SHUTDOWN 13 -#define SOCKSYS_SOCKET 14 -#define SOCKSYS_SELECT 15 -#define SOCKSYS_GETIPDOMAIN 16 -#define SOCKSYS_SETIPDOMAIN 17 -#define SOCKSYS_ADJTIME 18 -#define SOCKSYS_SETREUID 19 -#define SOCKSYS_SETREGID 20 -#define SOCKSYS_GETTIME 21 -#define SOCKSYS_SETTIME 22 -#define SOCKSYS_GETITIMER 23 -#define SOCKSYS_SETITIMER 24 - -#define IBCS2_SIOCSHIWAT _IOW('S', 1, int) -#define IBCS2_SIOCGHIWAT _IOR('S', 2, int) -#define IBCS2_SIOCSLOWAT _IOW('S', 3, int) -#define IBCS2_SIOCGLOWAT _IOR('S', 4, int) -#define IBCS2_SIOCATMARK _IOR('S', 5, int) -#define IBCS2_SIOCSPGRP _IOW('S', 6, int) -#define IBCS2_SIOCGPGRP _IOR('S', 7, int) -#define IBCS2_FIONREAD _IOR('S', 8, int) -#define IBCS2_FIONBIO _IOW('S', 9, int) -#define IBCS2_FIOASYNC _IOW('S', 10, int) -#define IBCS2_SIOCPROTO _IOW('S', 11, struct socknewproto) -#define IBCS2_SIOCGETNAME _IOR('S', 12, struct sockaddr) -#define IBCS2_SIOCGETPEER _IOR('S', 13, struct sockaddr) -#define IBCS2_IF_UNITSEL _IOW('S', 14, int) -#define IBCS2_SIOCXPROTO _IO('S', 15) - -#define IBCS2_SIOCADDRT _IOW('R', 9, struct rtentry) -#define IBCS2_SIOCDELRT _IOW('R', 10, struct rtentry) - -#define IBCS2_SIOCSIFADDR _IOW('I', 11, struct ifreq) -#define IBCS2_SIOCGIFADDR _IOWR('I', 12, struct ifreq) -#define IBCS2_SIOCSIFDSTADDR _IOW('I', 13, struct ifreq) -#define IBCS2_SIOCGIFDSTADDR _IOWR('I', 14, struct ifreq) -#define IBCS2_SIOCSIFFLAGS _IOW('I', 15, struct ifreq) -#define IBCS2_SIOCGIFFLAGS _IOWR('I', 16, struct ifreq) -#define IBCS2_SIOCGIFCONF _IOWR('I', 17, struct ifconf) -#define IBCS2_SIOCSIFMTU _IOW('I', 21, struct ifreq) -#define IBCS2_SIOCGIFMTU _IOWR('I', 22, struct ifreq) -#define IBCS2_SIOCIFDETACH _IOW('I', 26, struct ifreq) -#define IBCS2_SIOCGENPSTATS _IOWR('I', 27, struct ifreq) -#define IBCS2_SIOCX25XMT _IOWR('I', 29, struct ifreq) -#define IBCS2_SIOCX25RCV _IOWR('I', 30, struct ifreq) -#define IBCS2_SIOCX25TBL _IOWR('I', 31, struct ifreq) -#define IBCS2_SIOCGIFBRDADDR _IOWR('I', 32, struct ifreq) -#define IBCS2_SIOCSIFBRDADDR _IOW('I', 33, struct ifreq) -#define IBCS2_SIOCGIFNETMASK _IOWR('I', 34, struct ifreq) -#define IBCS2_SIOCSIFNETMASK _IOW('I', 35, struct ifreq) -#define IBCS2_SIOCGIFMETRIC _IOWR('I', 36, struct ifreq) -#define IBCS2_SIOCSIFMETRIC _IOW('I', 37, struct ifreq) -#define IBCS2_SIOCSARP _IOW('I', 38, struct arpreq) -#define IBCS2_SIOCGARP _IOWR('I', 39, struct arpreq) -#define IBCS2_SIOCDARP _IOW('I', 40, struct arpreq) -#define IBCS2_SIOCSIFNAME _IOW('I', 41, struct ifreq) -#define IBCS2_SIOCGIFONEP _IOWR('I', 42, struct ifreq) -#define IBCS2_SIOCSIFONEP _IOW('I', 43, struct ifreq) -#define IBCS2_SIOCGENADDR _IOWR('I', 65, struct ifreq) -#define IBCS2_SIOCSOCKSYS _IOW('I', 66, struct socksysreq) - -struct socksysreq { - int realargs[7]; -}; - -struct socknewproto { - int family; - int type; - int proto; - ibcs2_dev_t dev; - int flags; -}; - -struct ibcs2_socksys_args { - int fd; - int magic; - caddr_t argsp; -}; - -int ibcs2_socksys(struct thread *, struct ibcs2_socksys_args *); - -#endif /* !_I386_IBCS2_IBCS2_SOCKSYS_H_ */ diff --git a/sys/i386/ibcs2/ibcs2_stat.c b/sys/i386/ibcs2/ibcs2_stat.c deleted file mode 100644 index 4f0a073e6a9..00000000000 --- a/sys/i386/ibcs2/ibcs2_stat.c +++ /dev/null @@ -1,245 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1995 Scott Bartram - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - - -static void bsd_stat2ibcs_stat(struct stat *, struct ibcs2_stat *); -static int cvt_statfs(struct statfs *, caddr_t, int); - -static void -bsd_stat2ibcs_stat(st, st4) - struct stat *st; - struct ibcs2_stat *st4; -{ - bzero(st4, sizeof(*st4)); - st4->st_dev = (ibcs2_dev_t)st->st_dev; - st4->st_ino = (ibcs2_ino_t)st->st_ino; - st4->st_mode = (ibcs2_mode_t)st->st_mode; - st4->st_nlink= (ibcs2_nlink_t)st->st_nlink; - st4->st_uid = (ibcs2_uid_t)st->st_uid; - st4->st_gid = (ibcs2_gid_t)st->st_gid; - st4->st_rdev = (ibcs2_dev_t)st->st_rdev; - if (st->st_size < (quad_t)1 << 32) - st4->st_size = (ibcs2_off_t)st->st_size; - else - st4->st_size = -2; - st4->st_atim = (ibcs2_time_t)st->st_atim.tv_sec; - st4->st_mtim = (ibcs2_time_t)st->st_mtim.tv_sec; - st4->st_ctim = (ibcs2_time_t)st->st_ctim.tv_sec; -} - -static int -cvt_statfs(sp, buf, len) - struct statfs *sp; - caddr_t buf; - int len; -{ - struct ibcs2_statfs ssfs; - - if (len < 0) - return (EINVAL); - else if (len > sizeof(ssfs)) - len = sizeof(ssfs); - bzero(&ssfs, sizeof ssfs); - ssfs.f_fstyp = 0; - ssfs.f_bsize = sp->f_bsize; - ssfs.f_frsize = 0; - ssfs.f_blocks = sp->f_blocks; - ssfs.f_bfree = sp->f_bfree; - ssfs.f_files = sp->f_files; - ssfs.f_ffree = sp->f_ffree; - ssfs.f_fname[0] = 0; - ssfs.f_fpack[0] = 0; - return copyout((caddr_t)&ssfs, buf, len); -} - -int -ibcs2_statfs(td, uap) - struct thread *td; - struct ibcs2_statfs_args *uap; -{ - struct statfs *sf; - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); - error = kern_statfs(td, path, UIO_SYSSPACE, sf); - free(path, M_TEMP); - if (error == 0) - error = cvt_statfs(sf, (caddr_t)uap->buf, uap->len); - free(sf, M_STATFS); - return (error); -} - -int -ibcs2_fstatfs(td, uap) - struct thread *td; - struct ibcs2_fstatfs_args *uap; -{ - struct statfs *sf; - int error; - - sf = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK); - error = kern_fstatfs(td, uap->fd, sf); - if (error == 0) - error = cvt_statfs(sf, (caddr_t)uap->buf, uap->len); - free(sf, M_STATFS); - return (error); -} - -int -ibcs2_stat(td, uap) - struct thread *td; - struct ibcs2_stat_args *uap; -{ - struct ibcs2_stat ibcs2_st; - struct stat st; - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - - error = kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &st, NULL); - free(path, M_TEMP); - if (error) - return (error); - bsd_stat2ibcs_stat(&st, &ibcs2_st); - return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st, - ibcs2_stat_len); -} - -int -ibcs2_lstat(td, uap) - struct thread *td; - struct ibcs2_lstat_args *uap; -{ - struct ibcs2_stat ibcs2_st; - struct stat st; - char *path; - int error; - - CHECKALTEXIST(td, uap->path, &path); - - error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path, - UIO_SYSSPACE, &st, NULL); - free(path, M_TEMP); - if (error) - return (error); - bsd_stat2ibcs_stat(&st, &ibcs2_st); - return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st, - ibcs2_stat_len); -} - -int -ibcs2_fstat(td, uap) - struct thread *td; - struct ibcs2_fstat_args *uap; -{ - struct ibcs2_stat ibcs2_st; - struct stat st; - int error; - - error = kern_fstat(td, uap->fd, &st); - if (error) - return (error); - bsd_stat2ibcs_stat(&st, &ibcs2_st); - return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st, - ibcs2_stat_len); -} - -int -ibcs2_utssys(td, uap) - struct thread *td; - struct ibcs2_utssys_args *uap; -{ - switch (uap->flag) { - case 0: /* uname(2) */ - { - char machine_name[9], *p; - struct ibcs2_utsname sut; - bzero(&sut, ibcs2_utsname_len); - - strncpy(sut.sysname, - IBCS2_UNAME_SYSNAME, sizeof(sut.sysname) - 1); - strncpy(sut.release, - IBCS2_UNAME_RELEASE, sizeof(sut.release) - 1); - strncpy(sut.version, - IBCS2_UNAME_VERSION, sizeof(sut.version) - 1); - getcredhostname(td->td_ucred, machine_name, - sizeof(machine_name) - 1); - p = strchr(machine_name, '.'); - if ( p ) - *p = '\0'; - strncpy(sut.nodename, machine_name, sizeof(sut.nodename) - 1); - strncpy(sut.machine, machine, sizeof(sut.machine) - 1); - - DPRINTF(("IBCS2 uname: sys=%s rel=%s ver=%s node=%s mach=%s\n", - sut.sysname, sut.release, sut.version, sut.nodename, - sut.machine)); - return copyout((caddr_t)&sut, (caddr_t)uap->a1, - ibcs2_utsname_len); - } - - case 2: /* ustat(2) */ - { - return ENOSYS; /* XXX - TODO */ - } - - default: - return ENOSYS; - } -} diff --git a/sys/i386/ibcs2/ibcs2_stat.h b/sys/i386/ibcs2/ibcs2_stat.h deleted file mode 100644 index e22143a7b57..00000000000 --- a/sys/i386/ibcs2/ibcs2_stat.h +++ /dev/null @@ -1,92 +0,0 @@ -/* $NetBSD: ibcs2_stat.h,v 1.2 1994/10/26 02:53:03 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_STAT_H -#define _IBCS2_STAT_H - -#include - -struct ibcs2_stat { - ibcs2_dev_t st_dev; - ibcs2_ino_t st_ino; - ibcs2_mode_t st_mode; - ibcs2_nlink_t st_nlink; - ibcs2_uid_t st_uid; - ibcs2_gid_t st_gid; - ibcs2_dev_t st_rdev; - ibcs2_off_t st_size; - ibcs2_time_t st_atim; - ibcs2_time_t st_mtim; - ibcs2_time_t st_ctim; -}; - -#define ibcs2_stat_len (sizeof(struct ibcs2_stat)) - -#define IBCS2_S_IFMT 0xf000 -#define IBCS2_S_IFIFO 0x1000 -#define IBCS2_S_IFCHR 0x2000 -#define IBCS2_S_IFDIR 0x4000 -#define IBCS2_S_IFBLK 0x6000 -#define IBCS2_S_IFREG 0x8000 -#define IBCS2_S_IFSOCK 0xc000 - -#define IBCS2_S_IFNAM 0x5000 -#define IBCS2_S_IFLNK 0xa000 - -#define IBCS2_S_ISUID 0x0800 -#define IBCS2_S_ISGID 0x0400 -#define IBCS2_S_ISVTX 0x0200 - -#define IBCS2_S_IRWXU 0x01c0 -#define IBCS2_S_IRUSR 0x0100 -#define IBCS2_S_IWUSR 0x0080 -#define IBCS2_S_IXUSR 0x0040 -#define IBCS2_S_IRWXG 0x0038 -#define IBCS2_S_IRGRP 0x0020 -#define IBCS2_S_IWGRP 0x000f -#define IBCS2_S_IXGRP 0x0008 -#define IBCS2_S_IRWXO 0x0007 -#define IBCS2_S_IROTH 0x0004 -#define IBCS2_S_IWOTH 0x0002 -#define IBCS2_S_IXOTH 0x0001 - -#define IBCS2_S_ISFIFO(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFIFO) -#define IBCS2_S_ISCHR(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFCHR) -#define IBCS2_S_ISDIR(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFDIR) -#define IBCS2_S_ISBLK(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFBLK) -#define IBCS2_S_ISREG(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFREG) -#define IBCS2_S_ISSOCK(mode) (((mode) & IBCS2_S_IFMT) == IBCS2_S_IFSOCK) - -#endif /* _IBCS2_STAT_H */ diff --git a/sys/i386/ibcs2/ibcs2_statfs.h b/sys/i386/ibcs2/ibcs2_statfs.h deleted file mode 100644 index b5fd047213c..00000000000 --- a/sys/i386/ibcs2/ibcs2_statfs.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $NetBSD: ibcs2_statfs.h,v 1.2 1994/10/26 02:53:06 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_STATFS_H -#define _IBCS2_STATFS_H - -struct ibcs2_statfs { - short f_fstyp; - long f_bsize; - long f_frsize; - long f_blocks; - long f_bfree; - long f_files; - long f_ffree; - char f_fname[6]; - char f_fpack[6]; -}; - -#endif /* _IBCS2_STATFS_H */ diff --git a/sys/i386/ibcs2/ibcs2_stropts.h b/sys/i386/ibcs2/ibcs2_stropts.h deleted file mode 100644 index d05d6932b92..00000000000 --- a/sys/i386/ibcs2/ibcs2_stropts.h +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * ibcs2_stropts.h - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1995 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _IBCS2_STROPTS_H -#define _IBCS2_STROPTS_H - -#define IBCS2_STR ('S'<<8) -#define IBCS2_I_NREAD (IBCS2_STR|01) -#define IBCS2_I_PUSH (IBCS2_STR|02) -#define IBCS2_I_POP (IBCS2_STR|03) -#define IBCS2_I_LOOK (IBCS2_STR|04) -#define IBCS2_I_FLUSH (IBCS2_STR|05) -#define IBCS2_I_SRDOPT (IBCS2_STR|06) -#define IBCS2_I_GRDOPT (IBCS2_STR|07) -#define IBCS2_I_STR (IBCS2_STR|010) -#define IBCS2_I_SETSIG (IBCS2_STR|011) -#define IBCS2_I_GETSIG (IBCS2_STR|012) -#define IBCS2_I_FIND (IBCS2_STR|013) -#define IBCS2_I_LINK (IBCS2_STR|014) -#define IBCS2_I_UNLINK (IBCS2_STR|015) -#define IBCS2_I_PEEK (IBCS2_STR|017) -#define IBCS2_I_FDINSERT (IBCS2_STR|020) -#define IBCS2_I_SENDFD (IBCS2_STR|021) -#define IBCS2_I_RECVFD (IBCS2_STR|022) - -#endif /* _IBCS2_STROPTS_H */ diff --git a/sys/i386/ibcs2/ibcs2_syscall.h b/sys/i386/ibcs2/ibcs2_syscall.h deleted file mode 100644 index c8455e49694..00000000000 --- a/sys/i386/ibcs2/ibcs2_syscall.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * System call numbers. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - */ - -#define IBCS2_SYS_syscall 0 -#define IBCS2_SYS_exit 1 -#define IBCS2_SYS_fork 2 -#define IBCS2_SYS_ibcs2_read 3 -#define IBCS2_SYS_write 4 -#define IBCS2_SYS_ibcs2_open 5 -#define IBCS2_SYS_close 6 -#define IBCS2_SYS_ibcs2_wait 7 -#define IBCS2_SYS_ibcs2_creat 8 -#define IBCS2_SYS_link 9 -#define IBCS2_SYS_ibcs2_unlink 10 -#define IBCS2_SYS_ibcs2_execv 11 -#define IBCS2_SYS_ibcs2_chdir 12 -#define IBCS2_SYS_ibcs2_time 13 -#define IBCS2_SYS_ibcs2_mknod 14 -#define IBCS2_SYS_ibcs2_chmod 15 -#define IBCS2_SYS_ibcs2_chown 16 -#define IBCS2_SYS_break 17 -#define IBCS2_SYS_ibcs2_stat 18 -#define IBCS2_SYS_ibcs2_lseek 19 -#define IBCS2_SYS_getpid 20 -#define IBCS2_SYS_ibcs2_mount 21 -#define IBCS2_SYS_ibcs2_umount 22 -#define IBCS2_SYS_ibcs2_setuid 23 -#define IBCS2_SYS_getuid 24 -#define IBCS2_SYS_ibcs2_stime 25 -#define IBCS2_SYS_ptrace 26 -#define IBCS2_SYS_ibcs2_alarm 27 -#define IBCS2_SYS_ibcs2_fstat 28 -#define IBCS2_SYS_ibcs2_pause 29 -#define IBCS2_SYS_ibcs2_utime 30 -#define IBCS2_SYS_ibcs2_access 33 -#define IBCS2_SYS_ibcs2_nice 34 -#define IBCS2_SYS_ibcs2_statfs 35 -#define IBCS2_SYS_sync 36 -#define IBCS2_SYS_ibcs2_kill 37 -#define IBCS2_SYS_ibcs2_fstatfs 38 -#define IBCS2_SYS_ibcs2_pgrpsys 39 -#define IBCS2_SYS_ibcs2_xenix 40 -#define IBCS2_SYS_dup 41 -#define IBCS2_SYS_pipe 42 -#define IBCS2_SYS_ibcs2_times 43 -#define IBCS2_SYS_profil 44 -#define IBCS2_SYS_ibcs2_plock 45 -#define IBCS2_SYS_ibcs2_setgid 46 -#define IBCS2_SYS_getgid 47 -#define IBCS2_SYS_ibcs2_sigsys 48 -#define IBCS2_SYS_ibcs2_msgsys 49 -#define IBCS2_SYS_ibcs2_sysi86 50 -#define IBCS2_SYS_ibcs2_shmsys 52 -#define IBCS2_SYS_ibcs2_semsys 53 -#define IBCS2_SYS_ibcs2_ioctl 54 -#define IBCS2_SYS_ibcs2_uadmin 55 -#define IBCS2_SYS_ibcs2_utssys 57 -#define IBCS2_SYS_fsync 58 -#define IBCS2_SYS_ibcs2_execve 59 -#define IBCS2_SYS_umask 60 -#define IBCS2_SYS_chroot 61 -#define IBCS2_SYS_ibcs2_fcntl 62 -#define IBCS2_SYS_ibcs2_ulimit 63 - /* 70 is obsolete rfs_advfs */ - /* 71 is obsolete rfs_unadvfs */ - /* 72 is obsolete rfs_rmount */ - /* 73 is obsolete rfs_rumount */ - /* 74 is obsolete rfs_rfstart */ - /* 75 is obsolete rfs_sigret */ - /* 76 is obsolete rfs_rdebug */ - /* 77 is obsolete rfs_rfstop */ -#define IBCS2_SYS_ibcs2_rmdir 79 -#define IBCS2_SYS_ibcs2_mkdir 80 -#define IBCS2_SYS_ibcs2_getdents 81 -#define IBCS2_SYS_ibcs2_sysfs 84 -#define IBCS2_SYS_ibcs2_getmsg 85 -#define IBCS2_SYS_ibcs2_putmsg 86 -#define IBCS2_SYS_poll 87 -#define IBCS2_SYS_ibcs2_secure 89 -#define IBCS2_SYS_ibcs2_symlink 90 -#define IBCS2_SYS_ibcs2_lstat 91 -#define IBCS2_SYS_ibcs2_readlink 92 -#define IBCS2_SYS_sigreturn 103 -#define IBCS2_SYS_ibcs2_isc 105 -#define IBCS2_SYS_MAXSYSCALL 128 diff --git a/sys/i386/ibcs2/ibcs2_sysent.c b/sys/i386/ibcs2/ibcs2_sysent.c deleted file mode 100644 index 0ac11ee8ab4..00000000000 --- a/sys/i386/ibcs2/ibcs2_sysent.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * System call switch table. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - */ - -#include -#include -#include -#include -#include -#include - -#define AS(name) (sizeof(struct name) / sizeof(register_t)) - -/* The casts are bogus but will do for now. */ -struct sysent ibcs2_sysent[] = { - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 0 = syscall */ - { AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */ - { 0, (sy_call_t *)sys_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = fork */ - { AS(ibcs2_read_args), (sy_call_t *)ibcs2_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = ibcs2_read */ - { AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */ - { AS(ibcs2_open_args), (sy_call_t *)ibcs2_open, AUE_OPEN_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = ibcs2_open */ - { AS(close_args), (sy_call_t *)sys_close, AUE_CLOSE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 6 = close */ - { AS(ibcs2_wait_args), (sy_call_t *)ibcs2_wait, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = ibcs2_wait */ - { AS(ibcs2_creat_args), (sy_call_t *)ibcs2_creat, AUE_CREAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = ibcs2_creat */ - { AS(link_args), (sy_call_t *)sys_link, AUE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = link */ - { AS(ibcs2_unlink_args), (sy_call_t *)ibcs2_unlink, AUE_UNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 10 = ibcs2_unlink */ - { AS(ibcs2_execv_args), (sy_call_t *)ibcs2_execv, AUE_EXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 11 = ibcs2_execv */ - { AS(ibcs2_chdir_args), (sy_call_t *)ibcs2_chdir, AUE_CHDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = ibcs2_chdir */ - { AS(ibcs2_time_args), (sy_call_t *)ibcs2_time, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 13 = ibcs2_time */ - { AS(ibcs2_mknod_args), (sy_call_t *)ibcs2_mknod, AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = ibcs2_mknod */ - { AS(ibcs2_chmod_args), (sy_call_t *)ibcs2_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = ibcs2_chmod */ - { AS(ibcs2_chown_args), (sy_call_t *)ibcs2_chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = ibcs2_chown */ - { AS(break_args), (sy_call_t *)sys_break, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */ - { AS(ibcs2_stat_args), (sy_call_t *)ibcs2_stat, AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = ibcs2_stat */ - { AS(ibcs2_lseek_args), (sy_call_t *)ibcs2_lseek, AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = ibcs2_lseek */ - { 0, (sy_call_t *)sys_getpid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */ - { AS(ibcs2_mount_args), (sy_call_t *)ibcs2_mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = ibcs2_mount */ - { AS(ibcs2_umount_args), (sy_call_t *)ibcs2_umount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = ibcs2_umount */ - { AS(ibcs2_setuid_args), (sy_call_t *)ibcs2_setuid, AUE_SETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 23 = ibcs2_setuid */ - { 0, (sy_call_t *)sys_getuid, AUE_GETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 24 = getuid */ - { AS(ibcs2_stime_args), (sy_call_t *)ibcs2_stime, AUE_SETTIMEOFDAY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 25 = ibcs2_stime */ - { AS(ptrace_args), (sy_call_t *)sys_ptrace, AUE_PTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 26 = ptrace */ - { AS(ibcs2_alarm_args), (sy_call_t *)ibcs2_alarm, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 27 = ibcs2_alarm */ - { AS(ibcs2_fstat_args), (sy_call_t *)ibcs2_fstat, AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 28 = ibcs2_fstat */ - { 0, (sy_call_t *)ibcs2_pause, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 29 = ibcs2_pause */ - { AS(ibcs2_utime_args), (sy_call_t *)ibcs2_utime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 30 = ibcs2_utime */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 31 = ibcs2_stty */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 32 = ibcs2_gtty */ - { AS(ibcs2_access_args), (sy_call_t *)ibcs2_access, AUE_ACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 33 = ibcs2_access */ - { AS(ibcs2_nice_args), (sy_call_t *)ibcs2_nice, AUE_NICE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 34 = ibcs2_nice */ - { AS(ibcs2_statfs_args), (sy_call_t *)ibcs2_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 35 = ibcs2_statfs */ - { 0, (sy_call_t *)sys_sync, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 36 = sync */ - { AS(ibcs2_kill_args), (sy_call_t *)ibcs2_kill, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = ibcs2_kill */ - { AS(ibcs2_fstatfs_args), (sy_call_t *)ibcs2_fstatfs, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 38 = ibcs2_fstatfs */ - { AS(ibcs2_pgrpsys_args), (sy_call_t *)ibcs2_pgrpsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = ibcs2_pgrpsys */ - { AS(ibcs2_xenix_args), (sy_call_t *)ibcs2_xenix, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = ibcs2_xenix */ - { AS(dup_args), (sy_call_t *)sys_dup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */ - { 0, (sy_call_t *)sys_pipe, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = pipe */ - { AS(ibcs2_times_args), (sy_call_t *)ibcs2_times, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = ibcs2_times */ - { AS(profil_args), (sy_call_t *)sys_profil, AUE_PROFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = profil */ - { AS(ibcs2_plock_args), (sy_call_t *)ibcs2_plock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ibcs2_plock */ - { AS(ibcs2_setgid_args), (sy_call_t *)ibcs2_setgid, AUE_SETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 46 = ibcs2_setgid */ - { 0, (sy_call_t *)sys_getgid, AUE_GETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 47 = getgid */ - { AS(ibcs2_sigsys_args), (sy_call_t *)ibcs2_sigsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = ibcs2_sigsys */ - { AS(ibcs2_msgsys_args), (sy_call_t *)ibcs2_msgsys, AUE_MSGSYS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 49 = ibcs2_msgsys */ - { AS(ibcs2_sysi86_args), (sy_call_t *)ibcs2_sysi86, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = ibcs2_sysi86 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 51 = ibcs2_acct */ - { AS(ibcs2_shmsys_args), (sy_call_t *)ibcs2_shmsys, AUE_SHMSYS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 52 = ibcs2_shmsys */ - { AS(ibcs2_semsys_args), (sy_call_t *)ibcs2_semsys, AUE_SEMSYS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 53 = ibcs2_semsys */ - { AS(ibcs2_ioctl_args), (sy_call_t *)ibcs2_ioctl, AUE_IOCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 54 = ibcs2_ioctl */ - { AS(ibcs2_uadmin_args), (sy_call_t *)ibcs2_uadmin, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 55 = ibcs2_uadmin */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 56 = nosys */ - { AS(ibcs2_utssys_args), (sy_call_t *)ibcs2_utssys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 57 = ibcs2_utssys */ - { AS(fsync_args), (sy_call_t *)sys_fsync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 58 = fsync */ - { AS(ibcs2_execve_args), (sy_call_t *)ibcs2_execve, AUE_EXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 59 = ibcs2_execve */ - { AS(umask_args), (sy_call_t *)sys_umask, AUE_UMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 60 = umask */ - { AS(chroot_args), (sy_call_t *)sys_chroot, AUE_CHROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 61 = chroot */ - { AS(ibcs2_fcntl_args), (sy_call_t *)ibcs2_fcntl, AUE_FCNTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 62 = ibcs2_fcntl */ - { AS(ibcs2_ulimit_args), (sy_call_t *)ibcs2_ulimit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 63 = ibcs2_ulimit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 64 = reserved for unix/pc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 65 = reserved for unix/pc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 66 = reserved for unix/pc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 67 = reserved for unix/pc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 68 = reserved for unix/pc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 69 = reserved for unix/pc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 70 = obsolete rfs_advfs */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 71 = obsolete rfs_unadvfs */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 72 = obsolete rfs_rmount */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 73 = obsolete rfs_rumount */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 74 = obsolete rfs_rfstart */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 75 = obsolete rfs_sigret */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 76 = obsolete rfs_rdebug */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 77 = obsolete rfs_rfstop */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 78 = rfs_rfsys */ - { AS(ibcs2_rmdir_args), (sy_call_t *)ibcs2_rmdir, AUE_RMDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 79 = ibcs2_rmdir */ - { AS(ibcs2_mkdir_args), (sy_call_t *)ibcs2_mkdir, AUE_MKDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 80 = ibcs2_mkdir */ - { AS(ibcs2_getdents_args), (sy_call_t *)ibcs2_getdents, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 81 = ibcs2_getdents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 82 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 83 = nosys */ - { AS(ibcs2_sysfs_args), (sy_call_t *)ibcs2_sysfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 84 = ibcs2_sysfs */ - { AS(ibcs2_getmsg_args), (sy_call_t *)ibcs2_getmsg, AUE_GETMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 85 = ibcs2_getmsg */ - { AS(ibcs2_putmsg_args), (sy_call_t *)ibcs2_putmsg, AUE_PUTMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 86 = ibcs2_putmsg */ - { AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 87 = poll */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 88 = nosys */ - { AS(ibcs2_secure_args), (sy_call_t *)ibcs2_secure, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = ibcs2_secure */ - { AS(ibcs2_symlink_args), (sy_call_t *)ibcs2_symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 90 = ibcs2_symlink */ - { AS(ibcs2_lstat_args), (sy_call_t *)ibcs2_lstat, AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 91 = ibcs2_lstat */ - { AS(ibcs2_readlink_args), (sy_call_t *)ibcs2_readlink, AUE_READLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 92 = ibcs2_readlink */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 93 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 94 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 95 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 96 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 97 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 98 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 99 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 100 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 101 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 102 = nosys */ - { AS(sigreturn_args), (sy_call_t *)sys_sigreturn, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 103 = sigreturn */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 104 = nosys */ - { 0, (sy_call_t *)ibcs2_isc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 105 = ibcs2_isc */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 106 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 107 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 108 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 109 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 110 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 111 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 112 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 113 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 114 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 115 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 116 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 117 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 118 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 119 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 120 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 121 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 122 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 123 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 124 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 125 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 126 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 127 = nosys */ -}; diff --git a/sys/i386/ibcs2/ibcs2_sysi86.c b/sys/i386/ibcs2/ibcs2_sysi86.c deleted file mode 100644 index 7dae55ca2fa..00000000000 --- a/sys/i386/ibcs2/ibcs2_sysi86.c +++ /dev/null @@ -1,98 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1994 Søren Schmidt - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define IBCS2_FP_NO 0 /* no fp support */ -#define IBCS2_FP_SW 1 /* software emulator */ -#define IBCS2_FP_287 2 /* 80287 FPU */ -#define IBCS2_FP_387 3 /* 80387 FPU */ - -#define SI86_FPHW 40 -#define STIME 54 -#define SETNAME 56 -#define SI86_MEM 65 - -extern int hw_float; - -int -ibcs2_sysi86(struct thread *td, struct ibcs2_sysi86_args *args) -{ - switch (args->cmd) { - case SI86_FPHW: { /* Floating Point information */ - int val, error; - - if (hw_float) - val = IBCS2_FP_387; - else - val = IBCS2_FP_NO; - if ((error = copyout(&val, args->arg, sizeof(val))) != 0) - return error; - return 0; - } - - case STIME: /* set the system time given pointer to long */ - /* gettimeofday; time.tv_sec = *args->arg; settimeofday */ - return EINVAL; - - case SETNAME: { /* set hostname given string w/ len <= 7 chars */ - int name[2]; - - name[0] = CTL_KERN; - name[1] = KERN_HOSTNAME; - return (userland_sysctl(td, name, 2, 0, 0, 0, - args->arg, 7, 0, 0)); - } - - case SI86_MEM: /* size of physical memory */ - td->td_retval[0] = ctob(physmem); - return 0; - - default: -#ifdef DIAGNOSTIC - printf("IBCS2: 'sysi86' function %d(0x%x) " - "not implemented yet\n", args->cmd, args->cmd); -#endif - return EINVAL; - } -} diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c deleted file mode 100644 index c254a37cff9..00000000000 --- a/sys/i386/ibcs2/ibcs2_sysvec.c +++ /dev/null @@ -1,140 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Steven Wallace. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -MODULE_VERSION(ibcs2, 1); - -extern int bsd_to_ibcs2_errno[]; -extern struct sysent ibcs2_sysent[IBCS2_SYS_MAXSYSCALL]; -static int ibcs2_fixup(register_t **, struct image_params *); - -struct sysentvec ibcs2_svr3_sysvec = { - .sv_size = nitems(ibcs2_sysent), - .sv_table = ibcs2_sysent, - .sv_mask = 0xff, - .sv_sigsize = IBCS2_SIGTBLSZ, - .sv_sigtbl = bsd_to_ibcs2_sig, - .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_ibcs2_errno, - .sv_transtrap = NULL, - .sv_fixup = ibcs2_fixup, - .sv_sendsig = sendsig, - .sv_sigcode = sigcode, /* use generic trampoline */ - .sv_szsigcode = &szsigcode, - .sv_prepsyscall = NULL, - .sv_name = "IBCS2 COFF", - .sv_coredump = NULL, /* we don't have a COFF coredump function */ - .sv_imgact_try = NULL, - .sv_minsigstksz = IBCS2_MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, - .sv_minuser = VM_MIN_ADDRESS, - .sv_maxuser = VM_MAXUSER_ADDRESS, - .sv_usrstack = USRSTACK, - .sv_psstrings = PS_STRINGS, - .sv_stackprot = VM_PROT_ALL, - .sv_copyout_strings = exec_copyout_strings, - .sv_setregs = exec_setregs, - .sv_fixlimit = NULL, - .sv_maxssiz = NULL, - .sv_flags = SV_ABI_UNDEF | SV_IA32 | SV_ILP32, - .sv_set_syscall_retval = cpu_set_syscall_retval, - .sv_fetch_syscall_args = cpu_fetch_syscall_args, - .sv_syscallnames = NULL, - .sv_schedtail = NULL, - .sv_thread_detach = NULL, - .sv_trap = NULL, -}; - -static int -ibcs2_fixup(register_t **stack_base, struct image_params *imgp) -{ - - return (suword(--(*stack_base), imgp->args->argc)); -} - -/* - * Create an "ibcs2" module that does nothing but allow checking for - * the presence of the subsystem. - */ -static int -ibcs2_modevent(module_t mod, int type, void *unused) -{ - struct proc *p = NULL; - int rval = 0; - - switch(type) { - case MOD_LOAD: - break; - case MOD_UNLOAD: - /* if this was an ELF module we'd use elf_brand_inuse()... */ - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - if (p->p_sysent == &ibcs2_svr3_sysvec) { - rval = EBUSY; - break; - } - } - sx_sunlock(&allproc_lock); - break; - default: - rval = EOPNOTSUPP; - break; - } - return (rval); -} -static moduledata_t ibcs2_mod = { - "ibcs2", - ibcs2_modevent, - 0 -}; -DECLARE_MODULE_TIED(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); diff --git a/sys/i386/ibcs2/ibcs2_termios.h b/sys/i386/ibcs2/ibcs2_termios.h deleted file mode 100644 index 3f956eca430..00000000000 --- a/sys/i386/ibcs2/ibcs2_termios.h +++ /dev/null @@ -1,238 +0,0 @@ -/* $NetBSD: ibcs2_termios.h,v 1.3 1994/10/26 02:53:07 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_TERMIOS_H -#define _IBCS2_TERMIOS_H 1 - -#include - -#define IBCS2_NCC 8 -#define IBCS2_NCCS 13 - -typedef u_short ibcs2_tcflag_t; -typedef u_char ibcs2_cc_t; -typedef u_long ibcs2_speed_t; - -struct ibcs2_termio { - u_short c_iflag; - u_short c_oflag; - u_short c_cflag; - u_short c_lflag; - char c_line; - u_char c_cc[IBCS2_NCC]; -}; - -struct ibcs2_termios { - ibcs2_tcflag_t c_iflag; - ibcs2_tcflag_t c_oflag; - ibcs2_tcflag_t c_cflag; - ibcs2_tcflag_t c_lflag; - char c_line; - ibcs2_cc_t c_cc[IBCS2_NCCS]; - char c_ispeed; - char c_ospeed; -}; - -#define IBCS2_VINTR 0 -#define IBCS2_VQUIT 1 -#define IBCS2_VERASE 2 -#define IBCS2_VKILL 3 -#define IBCS2_VEOF 4 -#define IBCS2_VEOL 5 -#define IBCS2_VEOL2 6 -#define IBCS2_VMIN 4 -#define IBCS2_VTIME 5 -#define IBCS2_VSWTCH 7 -#define IBCS2_VSUSP 10 -#define IBCS2_VSTART 11 -#define IBCS2_VSTOP 12 - -#define IBCS2_CNUL 0 -#define IBCS2_CDEL 0377 -#define IBCS2_CESC '\\' -#define IBCS2_CINTR 0177 -#define IBCS2_CQUIT 034 -#define IBCS2_CERASE '#' -#define IBCS2_CKILL '@' -#define IBCS2_CSTART 021 -#define IBCS2_CSTOP 023 -#define IBCS2_CSWTCH 032 -#define IBCS2_CNSWTCH 0 -#define IBCS2_CSUSP 032 - -#define IBCS2_IGNBRK 0000001 -#define IBCS2_BRKINT 0000002 -#define IBCS2_IGNPAR 0000004 -#define IBCS2_PARMRK 0000010 -#define IBCS2_INPCK 0000020 -#define IBCS2_ISTRIP 0000040 -#define IBCS2_INLCR 0000100 -#define IBCS2_IGNCR 0000200 -#define IBCS2_ICRNL 0000400 -#define IBCS2_IUCLC 0001000 -#define IBCS2_IXON 0002000 -#define IBCS2_IXANY 0004000 -#define IBCS2_IXOFF 0010000 -#define IBCS2_IMAXBEL 0020000 -#define IBCS2_DOSMODE 0100000 - -#define IBCS2_OPOST 0000001 -#define IBCS2_OLCUC 0000002 -#define IBCS2_ONLCR 0000004 -#define IBCS2_OCRNL 0000010 -#define IBCS2_ONOCR 0000020 -#define IBCS2_ONLRET 0000040 -#define IBCS2_OFILL 0000100 -#define IBCS2_OFDEL 0000200 -#define IBCS2_NLDLY 0000400 -#define IBCS2_NL0 0000000 -#define IBCS2_NL1 0000400 -#define IBCS2_CRDLY 0003000 -#define IBCS2_CR0 0000000 -#define IBCS2_CR1 0001000 -#define IBCS2_CR2 0002000 -#define IBCS2_CR3 0003000 -#define IBCS2_TABDLY 0014000 -#define IBCS2_TAB0 0000000 -#define IBCS2_TAB1 0004000 -#define IBCS2_TAB2 0010000 -#define IBCS2_TAB3 0014000 -#define IBCS2_BSDLY 0020000 -#define IBCS2_BS0 0000000 -#define IBCS2_BS1 0020000 -#define IBCS2_VTDLY 0040000 -#define IBCS2_VT0 0000000 -#define IBCS2_VT1 0040000 -#define IBCS2_FFDLY 0100000 -#define IBCS2_FF0 0000000 -#define IBCS2_FF1 0100000 - -#define IBCS2_CBAUD 0000017 -#define IBCS2_CSIZE 0000060 -#define IBCS2_CS5 0000000 -#define IBCS2_CS6 0000020 -#define IBCS2_CS7 0000040 -#define IBCS2_CS8 0000060 -#define IBCS2_CSTOPB 0000100 -#define IBCS2_CREAD 0000200 -#define IBCS2_PARENB 0000400 -#define IBCS2_PARODD 0001000 -#define IBCS2_HUPCL 0002000 -#define IBCS2_CLOCAL 0004000 -#define IBCS2_RCV1EN 0010000 -#define IBCS2_XMT1EN 0020000 -#define IBCS2_LOBLK 0040000 -#define IBCS2_XCLUDE 0100000 - -#define IBCS2_ISIG 0000001 -#define IBCS2_ICANON 0000002 -#define IBCS2_XCASE 0000004 -#define IBCS2_ECHO 0000010 -#define IBCS2_ECHOE 0000020 -#define IBCS2_ECHOK 0000040 -#define IBCS2_ECHONL 0000100 -#define IBCS2_NOFLSH 0000200 -#define IBCS2_IEXTEN 0000400 -#define IBCS2_TOSTOP 0001000 - -#define IBCS2_XIOC (('i'<<24)|('X'<<16)) -#define IBCS2_XCGETA (IBCS2_XIOC|1) -#define IBCS2_XCSETA (IBCS2_XIOC|2) -#define IBCS2_XCSETAW (IBCS2_XIOC|3) -#define IBCS2_XCSETAF (IBCS2_XIOC|4) - -#define IBCS2_OXIOC ('x'<<8) -#define IBCS2_OXCGETA (IBCS2_OXIOC|1) -#define IBCS2_OXCSETA (IBCS2_OXIOC|2) -#define IBCS2_OXCSETAW (IBCS2_OXIOC|3) -#define IBCS2_OXCSETAF (IBCS2_OXIOC|4) - -#define IBCS2_TIOC ('T'<<8) -#define IBCS2_TCGETA (IBCS2_TIOC|1) -#define IBCS2_TCSETA (IBCS2_TIOC|2) -#define IBCS2_TCSETAW (IBCS2_TIOC|3) -#define IBCS2_TCSETAF (IBCS2_TIOC|4) -#define IBCS2_TCSBRK (IBCS2_TIOC|5) -#define IBCS2_TCXONC (IBCS2_TIOC|6) -#define IBCS2_TCFLSH (IBCS2_TIOC|7) - -#define IBCS2_TCGETSC (IBCS2_TIOC|34) -#define IBCS2_TCSETSC (IBCS2_TIOC|35) - -#define IBCS2_TIOCSWINSZ (IBCS2_TIOC|103) -#define IBCS2_TIOCGWINSZ (IBCS2_TIOC|104) -#define IBCS2_TIOCSPGRP (IBCS2_TIOC|118) -#define IBCS2_TIOCGPGRP (IBCS2_TIOC|119) - -#define IBCS2_TCSANOW IBCS2_XCSETA -#define IBCS2_TCSADRAIN IBCS2_XCSETAW -#define IBCS2_TCSAFLUSH IBCS2_XCSETAF -#define IBCS2_TCSADFLUSH IBCS2_XCSETAF - -#define IBCS2_TCIFLUSH 0 -#define IBCS2_TCOFLUSH 1 -#define IBCS2_TCIOFLUSH 2 - -#define IBCS2_TCOOFF 0 -#define IBCS2_TCOON 1 -#define IBCS2_TCIOFF 2 -#define IBCS2_TCION 3 - -#define IBCS2_B0 0 -#define IBCS2_B50 1 -#define IBCS2_B75 2 -#define IBCS2_B110 3 -#define IBCS2_B134 4 -#define IBCS2_B150 5 -#define IBCS2_B200 6 -#define IBCS2_B300 7 -#define IBCS2_B600 8 -#define IBCS2_B1200 9 -#define IBCS2_B1800 10 -#define IBCS2_B2400 11 -#define IBCS2_B4800 12 -#define IBCS2_B9600 13 -#define IBCS2_B19200 14 -#define IBCS2_B38400 15 - -struct ibcs2_winsize { - u_short ws_row; - u_short ws_col; - u_short ws_xpixel; - u_short ws_ypixel; -}; - -#endif /* _IBCS2_H_ */ - diff --git a/sys/i386/ibcs2/ibcs2_time.h b/sys/i386/ibcs2/ibcs2_time.h deleted file mode 100644 index 7ba81a3a1c3..00000000000 --- a/sys/i386/ibcs2/ibcs2_time.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: ibcs2_time.h,v 1.2 1994/10/26 02:53:08 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_TIME_H -#define _IBCS2_TIME_H - -#include - -struct ibcs2_tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; -}; - -#endif /* _IBCS2_TIME_H */ diff --git a/sys/i386/ibcs2/ibcs2_types.h b/sys/i386/ibcs2/ibcs2_types.h deleted file mode 100644 index e3e03267dab..00000000000 --- a/sys/i386/ibcs2/ibcs2_types.h +++ /dev/null @@ -1,57 +0,0 @@ -/* $NetBSD: ibcs2_types.h,v 1.5 1995/08/14 01:11:54 mycroft Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_TYPES_H -#define _IBCS2_TYPES_H - -typedef unsigned char ibcs2_uchar_t; -typedef unsigned long ibcs2_ulong_t; - -typedef char * ibcs2_caddr_t; -typedef long ibcs2_daddr_t; -typedef long ibcs2_off_t; -typedef long ibcs2_key_t; -typedef unsigned short ibcs2_uid_t; -typedef unsigned short ibcs2_gid_t; -typedef short ibcs2_nlink_t; -typedef short ibcs2_dev_t; -typedef unsigned short ibcs2_ino_t; -typedef unsigned int ibcs2_size_t; -typedef long ibcs2_time_t; -typedef long ibcs2_clock_t; -typedef unsigned short ibcs2_mode_t; -typedef short ibcs2_pid_t; - -#endif /* _IBCS2_TYPES_H */ diff --git a/sys/i386/ibcs2/ibcs2_unistd.h b/sys/i386/ibcs2/ibcs2_unistd.h deleted file mode 100644 index 68eb0313669..00000000000 --- a/sys/i386/ibcs2/ibcs2_unistd.h +++ /dev/null @@ -1,78 +0,0 @@ -/* $NetBSD: ibcs2_unistd.h,v 1.2 1994/10/26 02:53:11 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_UNISTD_H -#define _IBCS2_UNISTD_H - -#define IBCS2_R_OK 4 -#define IBCS2_W_OK 2 -#define IBCS2_X_OK 1 -#define IBCS2_F_OK 0 - -#define IBCS2_F_ULOCK 0 -#define IBCS2_F_LOCK 1 -#define IBCS2_F_TLOCK 2 -#define IBCS2_F_TEST 3 - -#define IBCS2_SEEK_SET 0 -#define IBCS2_SEEK_CUR 1 -#define IBCS2_SEEK_END 2 - -#define IBCS2_SC_ARG_MAX 0 -#define IBCS2_SC_CHILD_MAX 1 -#define IBCS2_SC_CLK_TCK 2 -#define IBCS2_SC_NGROUPS_MAX 3 -#define IBCS2_SC_OPEN_MAX 4 -#define IBCS2_SC_JOB_CONTROL 5 -#define IBCS2_SC_SAVED_IDS 6 -#define IBCS2_SC_VERSION 7 -#define IBCS2_SC_PASS_MAX 8 -#define IBCS2_SC_XOPEN_VERSION 9 - -#define IBCS2_PC_LINK_MAX 0 -#define IBCS2_PC_MAX_CANON 1 -#define IBCS2_PC_MAX_INPUT 2 -#define IBCS2_PC_NAME_MAX 3 -#define IBCS2_PC_PATH_MAX 4 -#define IBCS2_PC_PIPE_BUF 5 -#define IBCS2_PC_CHOWN_RESTRICTED 6 -#define IBCS2_PC_NO_TRUNC 7 -#define IBCS2_PC_VDISABLE 8 - -#define IBCS2_STDIN_FILENO 0 -#define IBCS2_STDOUT_FILENO 1 -#define IBCS2_STDERR_FILENO 2 - -#endif /* _IBCS2_UNISTD_H */ diff --git a/sys/i386/ibcs2/ibcs2_ustat.h b/sys/i386/ibcs2/ibcs2_ustat.h deleted file mode 100644 index ef853bf3bfa..00000000000 --- a/sys/i386/ibcs2/ibcs2_ustat.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $NetBSD: ibcs2_ustat.h,v 1.2 1994/10/26 02:53:13 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_USTAT_H -#define _IBCS2_USTAT_H 1 - -#include - -struct ibcs2_ustat { - long f_tfree; - ibcs2_ino_t f_tinode; - char f_fname[6]; - char f_fpack[6]; -}; -#define ibcs2_ustat_len (sizeof(struct ibcs2_ustat)) - -#endif /* _IBCS2_USTAT_H */ diff --git a/sys/i386/ibcs2/ibcs2_util.c b/sys/i386/ibcs2/ibcs2_util.c deleted file mode 100644 index 2a040183af8..00000000000 --- a/sys/i386/ibcs2/ibcs2_util.c +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1994 Christos Zoulas - * Copyright (c) 1995 Frank van der Linden - * Copyright (c) 1995 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * from: svr4_util.c,v 1.5 1995/01/22 23:44:50 christos Exp - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include - -#include - - -const char ibcs2_emul_path[] = "/compat/ibcs2"; - -/* - * Search an alternate path before passing pathname arguments on - * to system calls. Useful for keeping a separate 'emulation tree'. - * - * If cflag is set, we check if an attempt can be made to create - * the named file, i.e. we check if the directory it should - * be in exists. - */ -int -ibcs2_emul_find(struct thread *td, char *path, enum uio_seg pathseg, - char **pbuf, int cflag) -{ - - return (kern_alternate_path(td, ibcs2_emul_path, path, pathseg, pbuf, - cflag, AT_FDCWD)); -} diff --git a/sys/i386/ibcs2/ibcs2_util.h b/sys/i386/ibcs2/ibcs2_util.h deleted file mode 100644 index 226d923c439..00000000000 --- a/sys/i386/ibcs2/ibcs2_util.h +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1994 Christos Zoulas - * Copyright (c) 1995 Frank van der Linden - * Copyright (c) 1995 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp - * from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp - * - * $FreeBSD$ - */ - -/* - * This file is pretty much the same as Christos' svr4_util.h - * (for now). - */ - -#ifndef _IBCS2_UTIL_H_ -#define _IBCS2_UTIL_H_ - -#include -#include - -#ifdef DEBUG_IBCS2 -#define DPRINTF(a) printf a; -#else -#define DPRINTF(a) -#endif - -extern const char ibcs2_emul_path[]; - -int ibcs2_emul_find(struct thread *, char *, enum uio_seg, char **, int); - -#define CHECKALT(td, upath, pathp, i) \ - do { \ - int _error; \ - \ - _error = ibcs2_emul_find(td, upath, UIO_USERSPACE, pathp, i); \ - if (*(pathp) == NULL) \ - return (_error); \ - } while (0) - -#define CHECKALTEXIST(td, upath, pathp) CHECKALT(td, upath, pathp, 0) -#define CHECKALTCREAT(td, upath, pathp) CHECKALT(td, upath, pathp, 1) - -#ifdef SPX_HACK -int spx_open(struct thread *td); -#endif - -#endif /* !_IBCS2_UTIL_H_ */ diff --git a/sys/i386/ibcs2/ibcs2_utime.h b/sys/i386/ibcs2/ibcs2_utime.h deleted file mode 100644 index d2c06862a92..00000000000 --- a/sys/i386/ibcs2/ibcs2_utime.h +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1995 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _IBCS2_UTIME_H -#define _IBCS2_UTIME_H - -#include - -struct ibcs2_utimbuf { - ibcs2_time_t actime; - ibcs2_time_t modtime; -}; - -#endif /* _IBCS2_UTIME_H */ diff --git a/sys/i386/ibcs2/ibcs2_utsname.h b/sys/i386/ibcs2/ibcs2_utsname.h deleted file mode 100644 index fe9a6a04020..00000000000 --- a/sys/i386/ibcs2/ibcs2_utsname.h +++ /dev/null @@ -1,60 +0,0 @@ -/* $NetBSD: ibcs2_utsname.h,v 1.2 1994/10/26 02:53:14 cgd Exp $ */ -/* $FreeBSD$ */ - -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 1994 Scott Bartram - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Scott Bartram. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _IBCS2_UTSNAME_H -#define _IBCS2_UTSNAME_H - -#ifndef IBCS2_UNAME_SYSNAME -#define IBCS2_UNAME_SYSNAME ostype -#endif - -#ifndef IBCS2_UNAME_RELEASE -#define IBCS2_UNAME_RELEASE "3.2" -#endif - -#ifndef IBCS2_UNAME_VERSION -#define IBCS2_UNAME_VERSION "2.0" -#endif - -struct ibcs2_utsname { - char sysname[9]; - char nodename[9]; - char release[9]; - char version[9]; - char machine[9]; -}; -#define ibcs2_utsname_len (sizeof(struct ibcs2_utsname)) - -#endif /* _IBCS2_UTSNAME_H */ diff --git a/sys/i386/ibcs2/ibcs2_xenix.c b/sys/i386/ibcs2/ibcs2_xenix.c deleted file mode 100644 index 6e417386cb0..00000000000 --- a/sys/i386/ibcs2/ibcs2_xenix.c +++ /dev/null @@ -1,219 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1994 Sean Eric Fagan - * Copyright (c) 1994 Søren Schmidt - * Copyright (c) 1995 Steven Wallace - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - - -extern struct sysent xenix_sysent[]; - -int -ibcs2_xenix(struct thread *td, struct ibcs2_xenix_args *uap) -{ - struct trapframe *tf = td->td_frame; - struct sysent *callp; - u_int code; - int error; - - code = (tf->tf_eax & 0xff00) >> 8; - callp = &xenix_sysent[code]; - - if (code < IBCS2_XENIX_MAXSYSCALL) - error = ((*callp->sy_call)(td, (void *)uap)); - else - error = ENOSYS; - return (error); -} - -int -xenix_rdchk(td, uap) - struct thread *td; - struct xenix_rdchk_args *uap; -{ - int data, error; - - DPRINTF(("IBCS2: 'xenix rdchk'\n")); - - error = kern_ioctl(td, uap->fd, FIONREAD, (caddr_t)&data); - if (error) - return (error); - td->td_retval[0] = data ? 1 : 0; - return (0); -} - -int -xenix_chsize(td, uap) - struct thread *td; - struct xenix_chsize_args *uap; -{ - struct ftruncate_args sa; - - DPRINTF(("IBCS2: 'xenix chsize'\n")); - sa.fd = uap->fd; - sa.length = uap->size; - return sys_ftruncate(td, &sa); -} - - -int -xenix_ftime(td, uap) - struct thread *td; - struct xenix_ftime_args *uap; -{ - struct timeval tv; - struct ibcs2_timeb { - unsigned long time __packed; - unsigned short millitm; - short timezone; - short dstflag; - } itb; - - DPRINTF(("IBCS2: 'xenix ftime'\n")); - microtime(&tv); - itb.time = tv.tv_sec; - itb.millitm = (tv.tv_usec / 1000); - itb.timezone = tz_minuteswest; - itb.dstflag = tz_dsttime != DST_NONE; - - return copyout((caddr_t)&itb, (caddr_t)uap->tp, - sizeof(struct ibcs2_timeb)); -} - -int -xenix_nap(struct thread *td, struct xenix_nap_args *uap) -{ - long period; - - DPRINTF(("IBCS2: 'xenix nap %d ms'\n", uap->millisec)); - period = (long)uap->millisec / (1000/hz); - if (period) - pause("nap", period); - return 0; -} - -int -xenix_utsname(struct thread *td, struct xenix_utsname_args *uap) -{ - struct ibcs2_sco_utsname { - char sysname[9]; - char nodename[9]; - char release[16]; - char kernelid[20]; - char machine[9]; - char bustype[9]; - char sysserial[10]; - unsigned short sysorigin; - unsigned short sysoem; - char numusers[9]; - unsigned short numcpu; - } ibcs2_sco_uname; - - DPRINTF(("IBCS2: 'xenix sco_utsname'\n")); - bzero(&ibcs2_sco_uname, sizeof(struct ibcs2_sco_utsname)); - strncpy(ibcs2_sco_uname.sysname, ostype, - sizeof(ibcs2_sco_uname.sysname) - 1); - getcredhostname(td->td_ucred, ibcs2_sco_uname.nodename, - sizeof(ibcs2_sco_uname.nodename) - 1); - strncpy(ibcs2_sco_uname.release, osrelease, - sizeof(ibcs2_sco_uname.release) - 1); - strncpy(ibcs2_sco_uname.kernelid, version, - sizeof(ibcs2_sco_uname.kernelid) - 1); - strncpy(ibcs2_sco_uname.machine, machine, - sizeof(ibcs2_sco_uname.machine) - 1); - strncpy(ibcs2_sco_uname.bustype, "ISA/EISA", - sizeof(ibcs2_sco_uname.bustype) - 1); - strncpy(ibcs2_sco_uname.sysserial, "no charge", - sizeof(ibcs2_sco_uname.sysserial) - 1); - strncpy(ibcs2_sco_uname.numusers, "unlim", - sizeof(ibcs2_sco_uname.numusers) - 1); - ibcs2_sco_uname.sysorigin = 0xFFFF; - ibcs2_sco_uname.sysoem = 0xFFFF; - ibcs2_sco_uname.numcpu = 1; - return copyout((caddr_t)&ibcs2_sco_uname, - (caddr_t)(void *)(intptr_t)uap->addr, - sizeof(struct ibcs2_sco_utsname)); -} - -int -xenix_scoinfo(struct thread *td, struct xenix_scoinfo_args *uap) -{ - /* scoinfo (not documented) */ - td->td_retval[0] = 0; - return 0; -} - -int -xenix_eaccess(struct thread *td, struct xenix_eaccess_args *uap) -{ - char *path; - int error, bsd_flags; - - bsd_flags = 0; - if (uap->flags & IBCS2_R_OK) - bsd_flags |= R_OK; - if (uap->flags & IBCS2_W_OK) - bsd_flags |= W_OK; - if (uap->flags & IBCS2_X_OK) - bsd_flags |= X_OK; - - CHECKALTEXIST(td, uap->path, &path); - error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE, - AT_EACCESS, bsd_flags); - free(path, M_TEMP); - return (error); -} diff --git a/sys/i386/ibcs2/ibcs2_xenix.h b/sys/i386/ibcs2/ibcs2_xenix.h deleted file mode 100644 index 02177247696..00000000000 --- a/sys/i386/ibcs2/ibcs2_xenix.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * System call prototypes. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb - */ - -#ifndef _IBCS2_XENIX_H_ -#define _IBCS2_XENIX_H_ - -#include -#include -#include -#include -#include - -#include - -struct proc; - -struct thread; - -#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ - 0 : sizeof(register_t) - sizeof(t)) - -#if BYTE_ORDER == LITTLE_ENDIAN -#define PADL_(t) 0 -#define PADR_(t) PAD_(t) -#else -#define PADL_(t) PAD_(t) -#define PADR_(t) 0 -#endif - -struct xenix_rdchk_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; -}; -struct xenix_chsize_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char size_l_[PADL_(long)]; long size; char size_r_[PADR_(long)]; -}; -struct xenix_ftime_args { - char tp_l_[PADL_(struct timeb *)]; struct timeb * tp; char tp_r_[PADR_(struct timeb *)]; -}; -struct xenix_nap_args { - char millisec_l_[PADL_(int)]; int millisec; char millisec_r_[PADR_(int)]; -}; -struct xenix_scoinfo_args { - register_t dummy; -}; -struct xenix_eaccess_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct ibcs2_sigaction_args { - char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; - char act_l_[PADL_(struct ibcs2_sigaction *)]; struct ibcs2_sigaction * act; char act_r_[PADR_(struct ibcs2_sigaction *)]; - char oact_l_[PADL_(struct ibcs2_sigaction *)]; struct ibcs2_sigaction * oact; char oact_r_[PADR_(struct ibcs2_sigaction *)]; -}; -struct ibcs2_sigprocmask_args { - char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)]; - char set_l_[PADL_(ibcs2_sigset_t *)]; ibcs2_sigset_t * set; char set_r_[PADR_(ibcs2_sigset_t *)]; - char oset_l_[PADL_(ibcs2_sigset_t *)]; ibcs2_sigset_t * oset; char oset_r_[PADR_(ibcs2_sigset_t *)]; -}; -struct ibcs2_sigpending_args { - char mask_l_[PADL_(ibcs2_sigset_t *)]; ibcs2_sigset_t * mask; char mask_r_[PADR_(ibcs2_sigset_t *)]; -}; -struct ibcs2_sigsuspend_args { - char mask_l_[PADL_(ibcs2_sigset_t *)]; ibcs2_sigset_t * mask; char mask_r_[PADR_(ibcs2_sigset_t *)]; -}; -struct ibcs2_getgroups_args { - char gidsetsize_l_[PADL_(int)]; int gidsetsize; char gidsetsize_r_[PADR_(int)]; - char gidset_l_[PADL_(ibcs2_gid_t *)]; ibcs2_gid_t * gidset; char gidset_r_[PADR_(ibcs2_gid_t *)]; -}; -struct ibcs2_setgroups_args { - char gidsetsize_l_[PADL_(int)]; int gidsetsize; char gidsetsize_r_[PADR_(int)]; - char gidset_l_[PADL_(ibcs2_gid_t *)]; ibcs2_gid_t * gidset; char gidset_r_[PADR_(ibcs2_gid_t *)]; -}; -struct ibcs2_sysconf_args { - char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; -}; -struct ibcs2_pathconf_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; -}; -struct ibcs2_fpathconf_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; -}; -struct ibcs2_rename_args { - char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)]; - char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; -}; -struct xenix_utsname_args { - char addr_l_[PADL_(long)]; long addr; char addr_r_[PADR_(long)]; -}; -int xenix_rdchk(struct thread *, struct xenix_rdchk_args *); -int xenix_chsize(struct thread *, struct xenix_chsize_args *); -int xenix_ftime(struct thread *, struct xenix_ftime_args *); -int xenix_nap(struct thread *, struct xenix_nap_args *); -int xenix_scoinfo(struct thread *, struct xenix_scoinfo_args *); -int xenix_eaccess(struct thread *, struct xenix_eaccess_args *); -int ibcs2_sigaction(struct thread *, struct ibcs2_sigaction_args *); -int ibcs2_sigprocmask(struct thread *, struct ibcs2_sigprocmask_args *); -int ibcs2_sigpending(struct thread *, struct ibcs2_sigpending_args *); -int ibcs2_sigsuspend(struct thread *, struct ibcs2_sigsuspend_args *); -int ibcs2_getgroups(struct thread *, struct ibcs2_getgroups_args *); -int ibcs2_setgroups(struct thread *, struct ibcs2_setgroups_args *); -int ibcs2_sysconf(struct thread *, struct ibcs2_sysconf_args *); -int ibcs2_pathconf(struct thread *, struct ibcs2_pathconf_args *); -int ibcs2_fpathconf(struct thread *, struct ibcs2_fpathconf_args *); -int ibcs2_rename(struct thread *, struct ibcs2_rename_args *); -int xenix_utsname(struct thread *, struct xenix_utsname_args *); - -#ifdef COMPAT_43 - - -#endif /* COMPAT_43 */ - - -#ifdef COMPAT_FREEBSD4 - - -#endif /* COMPAT_FREEBSD4 */ - - -#ifdef COMPAT_FREEBSD6 - - -#endif /* COMPAT_FREEBSD6 */ - - -#ifdef COMPAT_FREEBSD7 - - -#endif /* COMPAT_FREEBSD7 */ - -#define IBCS2_XENIX_AUE_xenix_rdchk AUE_NULL -#define IBCS2_XENIX_AUE_xenix_chsize AUE_FTRUNCATE -#define IBCS2_XENIX_AUE_xenix_ftime AUE_NULL -#define IBCS2_XENIX_AUE_xenix_nap AUE_NULL -#define IBCS2_XENIX_AUE_xenix_scoinfo AUE_NULL -#define IBCS2_XENIX_AUE_xenix_eaccess AUE_EACCESS -#define IBCS2_XENIX_AUE_ibcs2_sigaction AUE_NULL -#define IBCS2_XENIX_AUE_ibcs2_sigprocmask AUE_NULL -#define IBCS2_XENIX_AUE_ibcs2_sigpending AUE_NULL -#define IBCS2_XENIX_AUE_ibcs2_sigsuspend AUE_NULL -#define IBCS2_XENIX_AUE_ibcs2_getgroups AUE_GETGROUPS -#define IBCS2_XENIX_AUE_ibcs2_setgroups AUE_SETGROUPS -#define IBCS2_XENIX_AUE_ibcs2_sysconf AUE_NULL -#define IBCS2_XENIX_AUE_ibcs2_pathconf AUE_PATHCONF -#define IBCS2_XENIX_AUE_ibcs2_fpathconf AUE_FPATHCONF -#define IBCS2_XENIX_AUE_ibcs2_rename AUE_RENAME -#define IBCS2_XENIX_AUE_xenix_utsname AUE_NULL - -#undef PAD_ -#undef PADL_ -#undef PADR_ - -#endif /* !_IBCS2_XENIX_H_ */ diff --git a/sys/i386/ibcs2/ibcs2_xenix_syscall.h b/sys/i386/ibcs2/ibcs2_xenix_syscall.h deleted file mode 100644 index e88ce214364..00000000000 --- a/sys/i386/ibcs2/ibcs2_xenix_syscall.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * System call numbers. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb - */ - -#define IBCS2_XENIX_xenix_rdchk 7 -#define IBCS2_XENIX_xenix_chsize 10 -#define IBCS2_XENIX_xenix_ftime 11 -#define IBCS2_XENIX_xenix_nap 12 -#define IBCS2_XENIX_xenix_scoinfo 21 -#define IBCS2_XENIX_select 36 -#define IBCS2_XENIX_xenix_eaccess 37 -#define IBCS2_XENIX_ibcs2_sigaction 39 -#define IBCS2_XENIX_ibcs2_sigprocmask 40 -#define IBCS2_XENIX_ibcs2_sigpending 41 -#define IBCS2_XENIX_ibcs2_sigsuspend 42 -#define IBCS2_XENIX_ibcs2_getgroups 43 -#define IBCS2_XENIX_ibcs2_setgroups 44 -#define IBCS2_XENIX_ibcs2_sysconf 45 -#define IBCS2_XENIX_ibcs2_pathconf 46 -#define IBCS2_XENIX_ibcs2_fpathconf 47 -#define IBCS2_XENIX_ibcs2_rename 48 -#define IBCS2_XENIX_xenix_utsname 50 -#define IBCS2_XENIX_getitimer 55 -#define IBCS2_XENIX_setitimer 56 -#define IBCS2_XENIX_MAXSYSCALL 57 diff --git a/sys/i386/ibcs2/ibcs2_xenix_sysent.c b/sys/i386/ibcs2/ibcs2_xenix_sysent.c deleted file mode 100644 index 30fddc7936e..00000000000 --- a/sys/i386/ibcs2/ibcs2_xenix_sysent.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * System call switch table. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb - */ - -#include -#include -#include -#include -#include -#include - -#define AS(name) (sizeof(struct name) / sizeof(register_t)) - -/* The casts are bogus but will do for now. */ -struct sysent xenix_sysent[] = { - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 1 = xenix_xlocking */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 2 = xenix_creatsem */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 3 = xenix_opensem */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 4 = xenix_sigsem */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 5 = xenix_waitsem */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 6 = xenix_nbwaitsem */ - { AS(xenix_rdchk_args), (sy_call_t *)xenix_rdchk, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = xenix_rdchk */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 8 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 9 = nosys */ - { AS(xenix_chsize_args), (sy_call_t *)xenix_chsize, AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 10 = xenix_chsize */ - { AS(xenix_ftime_args), (sy_call_t *)xenix_ftime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 11 = xenix_ftime */ - { AS(xenix_nap_args), (sy_call_t *)xenix_nap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 12 = xenix_nap */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 13 = xenix_sdget */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 14 = xenix_sdfree */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 15 = xenix_sdenter */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 16 = xenix_sdleave */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 17 = xenix_sdgetv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 18 = xenix_sdwaitv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 19 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 20 = nosys */ - { 0, (sy_call_t *)xenix_scoinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = xenix_scoinfo */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 22 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 23 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 24 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 25 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 26 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 27 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 28 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 29 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 30 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 31 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 32 = xenix_proctl */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 33 = xenix_execseg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 34 = xenix_unexecseg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 35 = nosys */ - { AS(select_args), (sy_call_t *)sys_select, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 36 = select */ - { AS(xenix_eaccess_args), (sy_call_t *)xenix_eaccess, AUE_EACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = xenix_eaccess */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 38 = xenix_paccess */ - { AS(ibcs2_sigaction_args), (sy_call_t *)ibcs2_sigaction, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = ibcs2_sigaction */ - { AS(ibcs2_sigprocmask_args), (sy_call_t *)ibcs2_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = ibcs2_sigprocmask */ - { AS(ibcs2_sigpending_args), (sy_call_t *)ibcs2_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = ibcs2_sigpending */ - { AS(ibcs2_sigsuspend_args), (sy_call_t *)ibcs2_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = ibcs2_sigsuspend */ - { AS(ibcs2_getgroups_args), (sy_call_t *)ibcs2_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = ibcs2_getgroups */ - { AS(ibcs2_setgroups_args), (sy_call_t *)ibcs2_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = ibcs2_setgroups */ - { AS(ibcs2_sysconf_args), (sy_call_t *)ibcs2_sysconf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ibcs2_sysconf */ - { AS(ibcs2_pathconf_args), (sy_call_t *)ibcs2_pathconf, AUE_PATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 46 = ibcs2_pathconf */ - { AS(ibcs2_fpathconf_args), (sy_call_t *)ibcs2_fpathconf, AUE_FPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 47 = ibcs2_fpathconf */ - { AS(ibcs2_rename_args), (sy_call_t *)ibcs2_rename, AUE_RENAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = ibcs2_rename */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 49 = nosys */ - { AS(xenix_utsname_args), (sy_call_t *)xenix_utsname, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = xenix_utsname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 51 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 52 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 53 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 54 = nosys */ - { AS(getitimer_args), (sy_call_t *)sys_getitimer, AUE_GETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 55 = getitimer */ - { AS(setitimer_args), (sy_call_t *)sys_setitimer, AUE_SETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 56 = setitimer */ -}; diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c deleted file mode 100644 index ef2d3af9e00..00000000000 --- a/sys/i386/ibcs2/imgact_coff.c +++ /dev/null @@ -1,495 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1994 Sean Eric Fagan - * Copyright (c) 1994 Søren Schmidt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -MODULE_DEPEND(coff, ibcs2, 1, 1, 1); - -extern struct sysentvec ibcs2_svr3_sysvec; - -static int coff_load_file(struct thread *td, char *name); -static int exec_coff_imgact(struct image_params *imgp); - -static int load_coff_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot); - -static int -load_coff_section(struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, - caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot) -{ - size_t map_len; - vm_offset_t map_offset; - vm_offset_t map_addr; - int error; - unsigned char *data_buf = NULL; - size_t copy_len; - - map_offset = trunc_page(offset); - map_addr = trunc_page((vm_offset_t)vmaddr); - - if (memsz > filsz) { - /* - * We have the stupid situation that - * the section is longer than it is on file, - * which means it has zero-filled areas, and - * we have to work for it. Stupid iBCS! - */ - map_len = trunc_page(offset + filsz) - trunc_page(map_offset); - } else { - /* - * The only stuff we care about is on disk, and we - * don't care if we map in more than is really there. - */ - map_len = round_page(offset + filsz) - trunc_page(map_offset); - } - - DPRINTF(("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08jx, 0x%x, 0x%x, " - "VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, 0x%x)\n", - __FILE__, __LINE__, (uintmax_t)map_addr, map_len, prot, - map_offset)); - - if ((error = vm_mmap(&vmspace->vm_map, - &map_addr, - map_len, - prot, - VM_PROT_ALL, - MAP_PRIVATE | MAP_FIXED, - OBJT_VNODE, - vp, - map_offset)) != 0) - return error; - - if (memsz == filsz) { - /* We're done! */ - return 0; - } - - /* - * Now we have screwball stuff, to accomodate stupid COFF. - * We have to map the remaining bit of the file into the kernel's - * memory map, allocate some anonymous memory, copy that last - * bit into it, and then we're done. *sigh* - * For clean-up reasons, we actally map in the file last. - */ - - copy_len = (offset + filsz) - trunc_page(offset + filsz); - map_addr = trunc_page((vm_offset_t)vmaddr + filsz); - map_len = round_page((vm_offset_t)vmaddr + memsz) - map_addr; - - DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08jx,0x%x, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", __FILE__, __LINE__, (uintmax_t)map_addr, map_len)); - - if (map_len != 0) { - error = vm_map_find(&vmspace->vm_map, NULL, 0, &map_addr, - map_len, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); - if (error) - return (vm_mmap_to_errno(error)); - } - - if ((error = vm_mmap(exec_map, - (vm_offset_t *) &data_buf, - PAGE_SIZE, - VM_PROT_READ, - VM_PROT_READ, - 0, - OBJT_VNODE, - vp, - trunc_page(offset + filsz))) != 0) - return error; - - error = copyout(data_buf, (caddr_t) map_addr, copy_len); - - kmap_free_wakeup(exec_map, (vm_offset_t)data_buf, PAGE_SIZE); - - return error; -} - -static int -coff_load_file(struct thread *td, char *name) -{ - struct proc *p = td->td_proc; - struct vmspace *vmspace = p->p_vmspace; - int error; - struct nameidata nd; - struct vnode *vp; - struct vattr attr; - struct filehdr *fhdr; - struct aouthdr *ahdr; - struct scnhdr *scns; - char *ptr = NULL; - int nscns; - unsigned long text_offset = 0, text_address = 0, text_size = 0; - unsigned long data_offset = 0, data_address = 0, data_size = 0; - unsigned long bss_size = 0; - int i, writecount; - - NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME, - UIO_SYSSPACE, name, td); - - error = namei(&nd); - if (error) - return error; - - vp = nd.ni_vp; - if (vp == NULL) - return ENOEXEC; - - error = VOP_GET_WRITECOUNT(vp, &writecount); - if (error != 0) - goto fail; - if (writecount != 0) { - error = ETXTBSY; - goto fail; - } - - if ((error = VOP_GETATTR(vp, &attr, td->td_ucred)) != 0) - goto fail; - - if ((vp->v_mount->mnt_flag & MNT_NOEXEC) - || ((attr.va_mode & 0111) == 0) - || (attr.va_type != VREG)) - goto fail; - - if (attr.va_size == 0) { - error = ENOEXEC; - goto fail; - } - - if ((error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td)) != 0) - goto fail; - - if ((error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL)) != 0) - goto fail; - - /* - * Lose the lock on the vnode. It's no longer needed, and must not - * exist for the pagefault paging to work below. - */ - VOP_UNLOCK(vp, 0); - - if ((error = vm_mmap(exec_map, - (vm_offset_t *) &ptr, - PAGE_SIZE, - VM_PROT_READ, - VM_PROT_READ, - 0, - OBJT_VNODE, - vp, - 0)) != 0) - goto unlocked_fail; - - fhdr = (struct filehdr *)ptr; - - if (fhdr->f_magic != I386_COFF) { - error = ENOEXEC; - goto dealloc_and_fail; - } - - nscns = fhdr->f_nscns; - - if ((nscns * sizeof(struct scnhdr)) > PAGE_SIZE) { - /* - * XXX -- just fail. I'm so lazy. - */ - error = ENOEXEC; - goto dealloc_and_fail; - } - - ahdr = (struct aouthdr*)(ptr + sizeof(struct filehdr)); - - scns = (struct scnhdr*)(ptr + sizeof(struct filehdr) - + sizeof(struct aouthdr)); - - for (i = 0; i < nscns; i++) { - if (scns[i].s_flags & STYP_NOLOAD) - continue; - else if (scns[i].s_flags & STYP_TEXT) { - text_address = scns[i].s_vaddr; - text_size = scns[i].s_size; - text_offset = scns[i].s_scnptr; - } - else if (scns[i].s_flags & STYP_DATA) { - data_address = scns[i].s_vaddr; - data_size = scns[i].s_size; - data_offset = scns[i].s_scnptr; - } else if (scns[i].s_flags & STYP_BSS) { - bss_size = scns[i].s_size; - } - } - - if ((error = load_coff_section(vmspace, vp, text_offset, - (caddr_t)(void *)(uintptr_t)text_address, - text_size, text_size, - VM_PROT_READ | VM_PROT_EXECUTE)) != 0) { - goto dealloc_and_fail; - } - if ((error = load_coff_section(vmspace, vp, data_offset, - (caddr_t)(void *)(uintptr_t)data_address, - data_size + bss_size, data_size, - VM_PROT_ALL)) != 0) { - goto dealloc_and_fail; - } - - error = 0; - - dealloc_and_fail: - kmap_free_wakeup(exec_map, (vm_offset_t)ptr, PAGE_SIZE); - fail: - VOP_UNLOCK(vp, 0); - unlocked_fail: - NDFREE(&nd, NDF_ONLY_PNBUF); - vrele(nd.ni_vp); - return error; -} - -static int -exec_coff_imgact(imgp) - struct image_params *imgp; -{ - const struct filehdr *fhdr = (const struct filehdr*)imgp->image_header; - const struct aouthdr *ahdr; - const struct scnhdr *scns; - int i; - struct vmspace *vmspace; - int nscns; - int error; - unsigned long text_offset = 0, text_address = 0, text_size = 0; - unsigned long data_offset = 0, data_address = 0, data_size = 0; - unsigned long bss_size = 0; - vm_offset_t hole; - - if (fhdr->f_magic != I386_COFF || - !(fhdr->f_flags & F_EXEC)) { - - DPRINTF(("%s(%d): return -1\n", __FILE__, __LINE__)); - return -1; - } - - nscns = fhdr->f_nscns; - if ((nscns * sizeof(struct scnhdr)) > PAGE_SIZE) { - /* - * For now, return an error -- need to be able to - * read in all of the section structures. - */ - - DPRINTF(("%s(%d): return -1\n", __FILE__, __LINE__)); - return -1; - } - - ahdr = (const struct aouthdr*) - ((const char*)(imgp->image_header) + sizeof(struct filehdr)); - imgp->entry_addr = ahdr->entry; - - scns = (const struct scnhdr*) - ((const char*)(imgp->image_header) + sizeof(struct filehdr) + - sizeof(struct aouthdr)); - - VOP_UNLOCK(imgp->vp, 0); - - error = exec_new_vmspace(imgp, &ibcs2_svr3_sysvec); - if (error) - goto fail; - vmspace = imgp->proc->p_vmspace; - - for (i = 0; i < nscns; i++) { - - DPRINTF(("i = %d, s_name = %s, s_vaddr = %08lx, " - "s_scnptr = %ld s_size = %lx\n", i, scns[i].s_name, - scns[i].s_vaddr, scns[i].s_scnptr, scns[i].s_size)); - if (scns[i].s_flags & STYP_NOLOAD) { - /* - * A section that is not loaded, for whatever - * reason. It takes precedance over other flag - * bits... - */ - continue; - } else if (scns[i].s_flags & STYP_TEXT) { - text_address = scns[i].s_vaddr; - text_size = scns[i].s_size; - text_offset = scns[i].s_scnptr; - } else if (scns[i].s_flags & STYP_DATA) { - /* .data section */ - data_address = scns[i].s_vaddr; - data_size = scns[i].s_size; - data_offset = scns[i].s_scnptr; - } else if (scns[i].s_flags & STYP_BSS) { - /* .bss section */ - bss_size = scns[i].s_size; - } else if (scns[i].s_flags & STYP_LIB) { - char *buf = NULL; - int foff = trunc_page(scns[i].s_scnptr); - int off = scns[i].s_scnptr - foff; - int len = round_page(scns[i].s_size + PAGE_SIZE); - int j; - - if ((error = vm_mmap(exec_map, - (vm_offset_t *) &buf, - len, - VM_PROT_READ, - VM_PROT_READ, - MAP_SHARED, - OBJT_VNODE, - imgp->vp, - foff)) != 0) { - error = ENOEXEC; - goto fail; - } - if(scns[i].s_size) { - char *libbuf; - int emul_path_len = strlen(ibcs2_emul_path); - - libbuf = malloc(MAXPATHLEN + emul_path_len, - M_TEMP, M_WAITOK); - strcpy(libbuf, ibcs2_emul_path); - - for (j = off; j < scns[i].s_size + off;) { - long stroff, nextoff; - char *libname; - - nextoff = 4 * *(long *)(buf + j); - stroff = 4 * *(long *)(buf + j + sizeof(long)); - - libname = buf + j + stroff; - j += nextoff; - - DPRINTF(("%s(%d): shared library %s\n", - __FILE__, __LINE__, libname)); - strlcpy(&libbuf[emul_path_len], libname, MAXPATHLEN); - error = coff_load_file( - FIRST_THREAD_IN_PROC(imgp->proc), libbuf); - if (error) - error = coff_load_file( - FIRST_THREAD_IN_PROC(imgp->proc), - libname); - if (error) { - printf( - "error %d loading coff shared library %s\n", - error, libname); - break; - } - } - free(libbuf, M_TEMP); - } - kmap_free_wakeup(exec_map, (vm_offset_t)buf, len); - if (error) - goto fail; - } - } - /* - * Map in .text now - */ - - DPRINTF(("%s(%d): load_coff_section(vmspace, " - "imgp->vp, %08lx, %08lx, 0x%lx, 0x%lx, 0x%x)\n", - __FILE__, __LINE__, text_offset, text_address, - text_size, text_size, VM_PROT_READ | VM_PROT_EXECUTE)); - if ((error = load_coff_section(vmspace, imgp->vp, - text_offset, - (caddr_t)(void *)(uintptr_t)text_address, - text_size, text_size, - VM_PROT_READ | VM_PROT_EXECUTE)) != 0) { - DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error)); - goto fail; - } - /* - * Map in .data and .bss now - */ - - - DPRINTF(("%s(%d): load_coff_section(vmspace, " - "imgp->vp, 0x%08lx, 0x%08lx, 0x%lx, 0x%lx, 0x%x)\n", - __FILE__, __LINE__, data_offset, data_address, - data_size + bss_size, data_size, VM_PROT_ALL)); - if ((error = load_coff_section(vmspace, imgp->vp, - data_offset, - (caddr_t)(void *)(uintptr_t)data_address, - data_size + bss_size, data_size, - VM_PROT_ALL)) != 0) { - - DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error)); - goto fail; - } - - imgp->interpreted = 0; - imgp->proc->p_sysent = &ibcs2_svr3_sysvec; - - vmspace->vm_tsize = round_page(text_size) >> PAGE_SHIFT; - vmspace->vm_dsize = round_page(data_size + bss_size) >> PAGE_SHIFT; - vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)text_address; - vmspace->vm_daddr = (caddr_t)(void *)(uintptr_t)data_address; - - hole = trunc_page((vm_offset_t)vmspace->vm_daddr + - ctob(vmspace->vm_dsize)); - - DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%jx, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", - __FILE__, __LINE__, (uintmax_t)hole)); - DPRINTF(("imgact: error = %d\n", error)); - - vm_map_find(&vmspace->vm_map, NULL, 0, - (vm_offset_t *)&hole, PAGE_SIZE, 0, VMFS_NO_SPACE, - VM_PROT_ALL, VM_PROT_ALL, 0); - DPRINTF(("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%p end = 0x%p\n", - ctob(vmspace->vm_dsize), vmspace->vm_daddr, - ctob(vmspace->vm_dsize) + vmspace->vm_daddr )); - DPRINTF(("%s(%d): returning %d!\n", __FILE__, __LINE__, error)); - -fail: - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); - - return (error); -} - -/* - * Tell kern_execve.c about it, with a little help from the linker. - */ -static struct execsw coff_execsw = { exec_coff_imgact, "coff" }; -EXEC_SET(coff, coff_execsw); diff --git a/sys/i386/ibcs2/syscalls.conf b/sys/i386/ibcs2/syscalls.conf deleted file mode 100644 index 77532c28570..00000000000 --- a/sys/i386/ibcs2/syscalls.conf +++ /dev/null @@ -1,11 +0,0 @@ -# syscalls.conf $FreeBSD$ -sysnames="/dev/null" -sysproto="ibcs2_proto.h" -sysproto_h=_IBCS2_SYSPROTO_H_ -syshdr="ibcs2_syscall.h" -sysmk="/dev/null" -syssw="ibcs2_sysent.c" -syscallprefix="IBCS2_SYS_" -switchname="ibcs2_sysent" -namesname="ibcs2_syscallnames" -systrace="/dev/null" diff --git a/sys/i386/ibcs2/syscalls.isc b/sys/i386/ibcs2/syscalls.isc deleted file mode 100644 index b6f87f984a7..00000000000 --- a/sys/i386/ibcs2/syscalls.isc +++ /dev/null @@ -1,38 +0,0 @@ - $FreeBSD$ - -#include -#include -#include -#include -#include -#include -#include - -0 AUE_NULL UNIMPL nosys -1 AUE_NULL UNIMPL isc_setostype -2 AUE_RENAME NOPROTO { int ibcs2_rename(char *from, char *to); } -3 AUE_NULL NOPROTO { int ibcs2_sigaction(int sig, \ - struct ibcs2_sigaction *act, \ - struct ibcs2_sigaction *oact); } -4 AUE_NULL NOPROTO { int ibcs2_sigprocmask(int how, \ - ibcs2_sigset_t *set, \ - ibcs2_sigset_t *oset); } -5 AUE_NULL NOPROTO { int ibcs2_sigpending(ibcs2_sigset_t *mask); } -6 AUE_GETGROUPS NOPROTO { int getgroups(u_int gidsetsize, \ - gid_t *gidset); } -7 AUE_SETGROUPS NOPROTO { int setgroups(u_int gidsetsize, \ - gid_t *gidset); } -8 AUE_PATHCONF NOPROTO { int ibcs2_pathconf(char *path, int name); } -9 AUE_FPATHCONF NOPROTO { int ibcs2_fpathconf(int fd, int name); } -10 AUE_NULL UNIMPL nosys -11 AUE_WAIT4 NOPROTO { int ibcs2_wait(int a1, int a2, int a3); } -12 AUE_SETSID NOPROTO { int setsid(void); } -13 AUE_GETPID NOPROTO { pid_t getpid(void); } -14 AUE_NULL UNIMPL isc_adduser -15 AUE_NULL UNIMPL isc_setuser -16 AUE_NULL NOPROTO { int ibcs2_sysconf(int name); } -17 AUE_NULL NOPROTO { int ibcs2_sigsuspend(ibcs2_sigset_t *mask); } -18 AUE_SYMLINK NOPROTO { int ibcs2_symlink(char *path, char *link); } -19 AUE_READLINK NOPROTO { int ibcs2_readlink(char *path, char *buf, \ - int count); } -20 AUE_NULL UNIMPL isc_getmajor diff --git a/sys/i386/ibcs2/syscalls.isc.conf b/sys/i386/ibcs2/syscalls.isc.conf deleted file mode 100644 index fd232c0cdf7..00000000000 --- a/sys/i386/ibcs2/syscalls.isc.conf +++ /dev/null @@ -1,12 +0,0 @@ -# syscalls.conf $FreeBSD$ -sysnames="/dev/null" -#sysproto="ibcs2_isc.h" -sysproto="/dev/null" -sysproto_h=_IBCS2_ISC_H_ -syshdr="ibcs2_isc_syscall.h" -sysmk="/dev/null" -syssw="ibcs2_isc_sysent.c" -syscallprefix="IBCS2_ISC_" -switchname="isc_sysent" -namesname="isc_syscallnames" -systrace="/dev/null" diff --git a/sys/i386/ibcs2/syscalls.master b/sys/i386/ibcs2/syscalls.master deleted file mode 100644 index a2c10916149..00000000000 --- a/sys/i386/ibcs2/syscalls.master +++ /dev/null @@ -1,205 +0,0 @@ - $FreeBSD$ - -; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 -; System call name/number master file (or rather, slave, from IBCS2). -; Processed to created ibcs2_sysent.c, ibcs2_syscalls.c and ibcs2_syscall.h. - -; Columns: number audit type nargs name alt{name,tag,rtyp}/comments -; number system call number, must be in order -; audit the audit event associated with the system call -; A value of AUE_NULL means no auditing, but it also means that -; there is no audit event for the call at this time. For the -; case where the event exists, but we don't want auditing, the -; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL, COMPAT -; name pseudo-prototype of syscall routine -; If one of the following alts is different, then all appear: -; altname name of system call if different -; alttag name of args struct tag if different from [o]`name'"_args" -; altrtyp return type if not int (bogus - syscalls always return int) -; for UNIMPL/OBSOL, name continues with comments - -; types: -; STD always included -; COMPAT included on COMPAT #ifdef -; OBSOL obsolete, not included in system, only specifies name -; UNIMPL not implemented, placeholder only - -#include -#include -#include -#include -#include -#include - -; #ifdef's, etc. may be included, and are copied to the output files. - -0 AUE_NULL NOPROTO { int nosys(void); } syscall nosys_args int -1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ - sys_exit_args void -2 AUE_FORK NOPROTO { int fork(void); } -3 AUE_NULL STD { int ibcs2_read(int fd, char *buf, \ - u_int nbytes); } -4 AUE_NULL NOPROTO { int write(int fd, char *buf, \ - u_int nbytes); } -5 AUE_OPEN_RWTC STD { int ibcs2_open(char *path, int flags, \ - int mode); } -6 AUE_CLOSE NOPROTO { int close(int fd); } -7 AUE_WAIT4 STD { int ibcs2_wait(int a1, int a2, int a3); } -8 AUE_CREAT STD { int ibcs2_creat(char *path, int mode); } -9 AUE_LINK NOPROTO { int link(char *path, char *link); } -10 AUE_UNLINK STD { int ibcs2_unlink(char *path); } -11 AUE_EXECVE STD { int ibcs2_execv(char *path, char **argp); } -12 AUE_CHDIR STD { int ibcs2_chdir(char *path); } -13 AUE_NULL STD { int ibcs2_time(ibcs2_time_t *tp); } -14 AUE_MKNOD STD { int ibcs2_mknod(char* path, int mode, \ - int dev); } -15 AUE_CHMOD STD { int ibcs2_chmod(char *path, int mode); } -16 AUE_CHOWN STD { int ibcs2_chown(char *path, int uid, \ - int gid); } -17 AUE_NULL NOPROTO { caddr_t break(caddr_t nsize); } -18 AUE_STAT STD { int ibcs2_stat(char* path, \ - struct ibcs2_stat *st); } -19 AUE_LSEEK STD { long ibcs2_lseek(int fd, long offset, \ - int whence); } -20 AUE_NULL NOPROTO { pid_t getpid(void); } -21 AUE_MOUNT STD { int ibcs2_mount(char *special, char *dir, \ - int flags, int fstype, char *data, \ - int len); } -22 AUE_UMOUNT STD { int ibcs2_umount(char *name); } -23 AUE_SETUID STD { int ibcs2_setuid(int uid); } -24 AUE_GETUID NOPROTO { uid_t getuid(void); } -25 AUE_SETTIMEOFDAY STD { int ibcs2_stime(long *timep); } -26 AUE_PTRACE NOPROTO { int ptrace(int req, pid_t pid, \ - caddr_t addr, int data); } -27 AUE_NULL STD { int ibcs2_alarm(unsigned sec); } -28 AUE_FSTAT STD { int ibcs2_fstat(int fd, \ - struct ibcs2_stat *st); } -29 AUE_NULL STD { int ibcs2_pause(void); } -30 AUE_NULL STD { int ibcs2_utime(char *path, \ - struct ibcs2_utimbuf *buf); } -31 AUE_NULL UNIMPL ibcs2_stty -32 AUE_NULL UNIMPL ibcs2_gtty -33 AUE_ACCESS STD { int ibcs2_access(char *path, int amode); } -34 AUE_NICE STD { int ibcs2_nice(int incr); } -35 AUE_STATFS STD { int ibcs2_statfs(char *path, \ - struct ibcs2_statfs *buf, int len, \ - int fstype); } -36 AUE_NULL NOPROTO { int sync(void); } -37 AUE_KILL STD { int ibcs2_kill(int pid, int signo); } -38 AUE_FSTATFS STD { int ibcs2_fstatfs(int fd, \ - struct ibcs2_statfs *buf, int len, \ - int fstype); } -39 AUE_NULL STD { int ibcs2_pgrpsys(int type, caddr_t dummy, \ - int pid, int pgid); } -40 AUE_NULL STD { int ibcs2_xenix(int a1, int a2, int a3, \ - int a4, int a5); } -41 AUE_NULL NOPROTO { int dup(u_int fd); } -42 AUE_PIPE NOPROTO { int pipe(void); } -43 AUE_NULL STD { int ibcs2_times(struct tms *tp); } -44 AUE_PROFILE NOPROTO { int profil(caddr_t samples, u_int size, \ - u_int offset, u_int scale); } -45 AUE_NULL STD { int ibcs2_plock(int cmd); } -46 AUE_SETGID STD { int ibcs2_setgid(int gid); } -47 AUE_GETGID NOPROTO { gid_t getgid(void); } -48 AUE_NULL STD { int ibcs2_sigsys(int sig, ibcs2_sig_t fp); } -49 AUE_MSGSYS STD { int ibcs2_msgsys(int which, int a2, \ - int a3, int a4, int a5, int a6); } -50 AUE_NULL STD { int ibcs2_sysi86(int cmd, int *arg); } -51 AUE_NULL UNIMPL ibcs2_acct -52 AUE_SHMSYS STD { int ibcs2_shmsys(int which, int a2, \ - int a3, int a4); } -53 AUE_SEMSYS STD { int ibcs2_semsys(int which, int a2, \ - int a3, int a4, int a5); } -54 AUE_IOCTL STD { int ibcs2_ioctl(int fd, int cmd, \ - caddr_t data); } -55 AUE_NULL STD { int ibcs2_uadmin(int cmd, int func, \ - caddr_t data); } -56 AUE_NULL UNIMPL nosys -57 AUE_NULL STD { int ibcs2_utssys(int a1, int a2, \ - int flag); } -58 AUE_FSYNC NOPROTO { int fsync(int fd); } -59 AUE_EXECVE STD { int ibcs2_execve(char *path, char **argp, \ - char **envp); } -60 AUE_UMASK NOPROTO { int umask(int newmask); } -61 AUE_CHROOT NOPROTO { int chroot(char *path); } -62 AUE_FCNTL STD { int ibcs2_fcntl(int fd, int cmd, \ - char *arg); } -63 AUE_NULL STD { long ibcs2_ulimit(int cmd, int newlimit); } -64 AUE_NULL UNIMPL reserved for unix/pc -65 AUE_NULL UNIMPL reserved for unix/pc -66 AUE_NULL UNIMPL reserved for unix/pc -67 AUE_NULL UNIMPL reserved for unix/pc -68 AUE_NULL UNIMPL reserved for unix/pc -69 AUE_NULL UNIMPL reserved for unix/pc -70 AUE_NULL OBSOL rfs_advfs -71 AUE_NULL OBSOL rfs_unadvfs -72 AUE_NULL OBSOL rfs_rmount -73 AUE_NULL OBSOL rfs_rumount -74 AUE_NULL OBSOL rfs_rfstart -75 AUE_NULL OBSOL rfs_sigret -76 AUE_NULL OBSOL rfs_rdebug -77 AUE_NULL OBSOL rfs_rfstop -78 AUE_NULL UNIMPL rfs_rfsys -79 AUE_RMDIR STD { int ibcs2_rmdir(char *path); } -80 AUE_MKDIR STD { int ibcs2_mkdir(char *path, int mode); } -81 AUE_GETDIRENTRIES STD { int ibcs2_getdents(int fd, char *buf, \ - int nbytes); } -82 AUE_NULL UNIMPL nosys -83 AUE_NULL UNIMPL nosys -84 AUE_NULL STD { int ibcs2_sysfs(int cmd, caddr_t d1, \ - char *buf); } -85 AUE_GETMSG STD { int ibcs2_getmsg(int fd, \ - struct ibcs2_stropts *ctl, \ - struct ibcs2_stropts *dat, int *flags); } -86 AUE_PUTMSG STD { int ibcs2_putmsg(int fd, \ - struct ibcs2_stropts *ctl, \ - struct ibcs2_stropts *dat, int flags); } -87 AUE_POLL NOPROTO { int poll(struct pollfd *fds, u_int nfds, \ - int timeout); } -88 AUE_NULL UNIMPL nosys -89 AUE_NULL STD { int ibcs2_secure(int cmd, int a1, int a2, \ - int a3, int a4, int a5); } -90 AUE_SYMLINK STD { int ibcs2_symlink(char *path, \ - char *link); } -91 AUE_LSTAT STD { int ibcs2_lstat(char *path, \ - struct ibcs2_stat *st); } -92 AUE_READLINK STD { int ibcs2_readlink(char *path, char *buf, \ - int count); } -93 AUE_NULL UNIMPL nosys -94 AUE_NULL UNIMPL nosys -95 AUE_NULL UNIMPL nosys -96 AUE_NULL UNIMPL nosys -97 AUE_NULL UNIMPL nosys -98 AUE_NULL UNIMPL nosys -99 AUE_NULL UNIMPL nosys -100 AUE_NULL UNIMPL nosys -101 AUE_NULL UNIMPL nosys -102 AUE_NULL UNIMPL nosys -103 AUE_NULL NOPROTO { int sigreturn( \ - struct sigcontext *sigcntxp); } -104 AUE_NULL UNIMPL nosys -105 AUE_NULL STD { int ibcs2_isc(void); } -106 AUE_NULL UNIMPL nosys -107 AUE_NULL UNIMPL nosys -108 AUE_NULL UNIMPL nosys -109 AUE_NULL UNIMPL nosys -110 AUE_NULL UNIMPL nosys -111 AUE_NULL UNIMPL nosys -112 AUE_NULL UNIMPL nosys -113 AUE_NULL UNIMPL nosys -114 AUE_NULL UNIMPL nosys -115 AUE_NULL UNIMPL nosys -116 AUE_NULL UNIMPL nosys -117 AUE_NULL UNIMPL nosys -118 AUE_NULL UNIMPL nosys -119 AUE_NULL UNIMPL nosys -120 AUE_NULL UNIMPL nosys -121 AUE_NULL UNIMPL nosys -122 AUE_NULL UNIMPL nosys -123 AUE_NULL UNIMPL nosys -124 AUE_NULL UNIMPL nosys -125 AUE_NULL UNIMPL nosys -126 AUE_NULL UNIMPL nosys -127 AUE_NULL UNIMPL nosys -; vim: syntax=off diff --git a/sys/i386/ibcs2/syscalls.xenix b/sys/i386/ibcs2/syscalls.xenix deleted file mode 100644 index bb43c189e7d..00000000000 --- a/sys/i386/ibcs2/syscalls.xenix +++ /dev/null @@ -1,77 +0,0 @@ - $FreeBSD$ - -#include -#include -#include -#include -#include -#include - -0 AUE_NULL UNIMPL nosys -1 AUE_NULL UNIMPL xenix_xlocking -2 AUE_NULL UNIMPL xenix_creatsem -3 AUE_NULL UNIMPL xenix_opensem -4 AUE_NULL UNIMPL xenix_sigsem -5 AUE_NULL UNIMPL xenix_waitsem -6 AUE_NULL UNIMPL xenix_nbwaitsem -7 AUE_NULL STD { int xenix_rdchk(int fd); } -8 AUE_NULL UNIMPL nosys -9 AUE_NULL UNIMPL nosys -10 AUE_FTRUNCATE STD { int xenix_chsize(int fd, long size); } -11 AUE_NULL STD { int xenix_ftime(struct timeb *tp); } -12 AUE_NULL STD { int xenix_nap(int millisec); } -13 AUE_NULL UNIMPL xenix_sdget -14 AUE_NULL UNIMPL xenix_sdfree -15 AUE_NULL UNIMPL xenix_sdenter -16 AUE_NULL UNIMPL xenix_sdleave -17 AUE_NULL UNIMPL xenix_sdgetv -18 AUE_NULL UNIMPL xenix_sdwaitv -19 AUE_NULL UNIMPL nosys -20 AUE_NULL UNIMPL nosys -21 AUE_NULL STD { int xenix_scoinfo(void); } -22 AUE_NULL UNIMPL nosys -23 AUE_NULL UNIMPL nosys -24 AUE_NULL UNIMPL nosys -25 AUE_NULL UNIMPL nosys -26 AUE_NULL UNIMPL nosys -27 AUE_NULL UNIMPL nosys -28 AUE_NULL UNIMPL nosys -29 AUE_NULL UNIMPL nosys -30 AUE_NULL UNIMPL nosys -31 AUE_NULL UNIMPL nosys -32 AUE_NULL UNIMPL xenix_proctl -33 AUE_NULL UNIMPL xenix_execseg -34 AUE_NULL UNIMPL xenix_unexecseg -35 AUE_NULL UNIMPL nosys -36 AUE_SELECT NOPROTO { int select(u_int nd, fd_set *in, \ - fd_set *ou, fd_set *ex, \ - struct timeval *tv); } -37 AUE_EACCESS STD { int xenix_eaccess(char *path, int flags); } -38 AUE_NULL UNIMPL xenix_paccess -39 AUE_NULL STD { int ibcs2_sigaction(int sig, \ - struct ibcs2_sigaction *act, \ - struct ibcs2_sigaction *oact); } -40 AUE_NULL STD { int ibcs2_sigprocmask(int how, \ - ibcs2_sigset_t *set, \ - ibcs2_sigset_t *oset); } -41 AUE_NULL STD { int ibcs2_sigpending(ibcs2_sigset_t *mask); } -42 AUE_NULL STD { int ibcs2_sigsuspend(ibcs2_sigset_t *mask); } -43 AUE_GETGROUPS STD { int ibcs2_getgroups(int gidsetsize, \ - ibcs2_gid_t *gidset); } -44 AUE_SETGROUPS STD { int ibcs2_setgroups(int gidsetsize, \ - ibcs2_gid_t *gidset); } -45 AUE_NULL STD { int ibcs2_sysconf(int name); } -46 AUE_PATHCONF STD { int ibcs2_pathconf(char *path, int name); } -47 AUE_FPATHCONF STD { int ibcs2_fpathconf(int fd, int name); } -48 AUE_RENAME STD { int ibcs2_rename(char *from, char *to); } -49 AUE_NULL UNIMPL nosys -50 AUE_NULL STD { int xenix_utsname(long addr); } -51 AUE_NULL UNIMPL nosys -52 AUE_NULL UNIMPL nosys -53 AUE_NULL UNIMPL nosys -54 AUE_NULL UNIMPL nosys -55 AUE_GETITIMER NOPROTO { int getitimer(u_int which, \ - struct itimerval *itv); } -56 AUE_SETITIMER NOPROTO { int setitimer(u_int which, \ - struct itimerval *itv, \ - struct itimerval *otv); } diff --git a/sys/i386/ibcs2/syscalls.xenix.conf b/sys/i386/ibcs2/syscalls.xenix.conf deleted file mode 100644 index 3f8616253e7..00000000000 --- a/sys/i386/ibcs2/syscalls.xenix.conf +++ /dev/null @@ -1,11 +0,0 @@ -# syscalls.conf $FreeBSD$ -sysnames="/dev/null" -sysproto="ibcs2_xenix.h" -sysproto_h=_IBCS2_XENIX_H_ -syshdr="ibcs2_xenix_syscall.h" -sysmk="/dev/null" -syssw="ibcs2_xenix_sysent.c" -syscallprefix="IBCS2_XENIX_" -switchname="xenix_sysent" -namesname="xenix_syscallnames" -systrace="/dev/null" diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index d379a6e8f84..f3c4dd15873 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -850,7 +850,6 @@ linux_get_machine(const char **dst) struct sysentvec linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, @@ -887,7 +886,6 @@ INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index fe893241a4e..35993f4d4cc 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -76,7 +76,6 @@ static int aout_fixup(register_t **stack_base, struct image_params *imgp); struct sysentvec aout_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, @@ -119,7 +118,6 @@ extern u_long ia32_maxssiz; struct sysentvec aout_sysvec = { .sv_size = FREEBSD32_SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 79a625b7900..5724dd91ca1 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -399,7 +399,6 @@ null_set_syscall_retval(struct thread *td __unused, int error __unused) struct sysentvec null_sysvec = { .sv_size = 0, .sv_table = NULL, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index 26b06df4e64..12baa15b96d 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -494,8 +494,8 @@ sed -e ' if (!flag("NOPROTO") && !flag("NODEF")) { if (funcname == "nosys" || funcname == "lkmnosys" || funcname == "sysarch" || funcname ~ /^freebsd/ || - funcname ~ /^linux/ || funcname ~ /^ibcs2/ || - funcname ~ /^xenix/ || funcname ~ /^cloudabi/) { + funcname ~ /^linux/ || funcname ~ /^xenix/ || + funcname ~ /^cloudabi/) { printf("%s\t%s(struct thread *, struct %s *)", rettype, funcname, argalias) > sysdcl } else { @@ -514,8 +514,8 @@ sed -e ' } else { if (funcname == "nosys" || funcname == "sysarch" || funcname == "lkmnosys" || funcname ~ /^freebsd/ || - funcname ~ /^linux/ || funcname ~ /^ibcs2/ || - funcname ~ /^xenix/ || funcname ~ /^cloudabi/) { + funcname ~ /^linux/ || funcname ~ /^xenix/ || + funcname ~ /^cloudabi/) { printf("%s, %s, NULL, 0, 0, %s, %s },", funcname, auditev, flags, thr_flag) > sysent column = column + length(funcname) + length(auditev) + length(flags) + 3 } else { diff --git a/sys/mips/mips/elf_machdep.c b/sys/mips/mips/elf_machdep.c index d5e92afa0d6..e8791f821a6 100644 --- a/sys/mips/mips/elf_machdep.c +++ b/sys/mips/mips/elf_machdep.c @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, @@ -111,7 +110,6 @@ elf64_dump_thread(struct thread *td __unused, void *dst __unused, struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/mips/mips/freebsd32_machdep.c b/sys/mips/mips/freebsd32_machdep.c index 73c5848029f..df79bfed3ef 100644 --- a/sys/mips/mips/freebsd32_machdep.c +++ b/sys/mips/mips/freebsd32_machdep.c @@ -77,7 +77,6 @@ extern const char *freebsd32_syscallnames[]; struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/mips/mips/trap.c b/sys/mips/mips/trap.c index 746208e521f..d89419cd4c5 100644 --- a/sys/mips/mips/trap.c +++ b/sys/mips/mips/trap.c @@ -442,8 +442,6 @@ cpu_fetch_syscall_args(struct thread *td) * XXX * Shouldn't this go before switching on the code? */ - if (se->sv_mask) - sa->code &= se->sv_mask; if (sa->code >= se->sv_size) sa->callp = &se->sv_table[0]; diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 726144753c8..de564a1866b 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -93,7 +93,6 @@ SUBDIR= \ ${_cloudabi32} \ ${_cloudabi64} \ ${_cmx} \ - ${_coff} \ ${_coretemp} \ ${_cp} \ ${_cpsw} \ @@ -154,7 +153,6 @@ SUBDIR= \ ${_hyperv} \ i2c \ ${_ibcore} \ - ${_ibcs2} \ ${_ichwd} \ ${_ida} \ if_bridge \ @@ -750,13 +748,11 @@ _apm= apm .if ${MK_SOURCELESS_UCODE} != "no" _ce= ce .endif -_coff= coff .if ${MK_SOURCELESS_UCODE} != "no" _cp= cp .endif _glxiic= glxiic _glxsb= glxsb -#_ibcs2= ibcs2 _mse= mse _ncr= ncr _ncv= ncv diff --git a/sys/modules/coff/Makefile b/sys/modules/coff/Makefile deleted file mode 100644 index 5325a962c91..00000000000 --- a/sys/modules/coff/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -.PATH: ${SRCTOP}/sys/i386/ibcs2 - -KMOD= ibcs2_coff -SRCS= imgact_coff.c vnode_if.h - -CFLAGS+= -DCOMPAT_IBCS2 - -.include diff --git a/sys/modules/ibcs2/Makefile b/sys/modules/ibcs2/Makefile deleted file mode 100644 index 3041dc27f08..00000000000 --- a/sys/modules/ibcs2/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# $FreeBSD$ - -.PATH: ${SRCTOP}/sys/i386/ibcs2 - -KMOD= ibcs2 -SRCS= ibcs2_errno.c ibcs2_ipc.c ibcs2_stat.c ibcs2_misc.c \ - ibcs2_fcntl.c ibcs2_signal.c ibcs2_sysent.c ibcs2_ioctl.c \ - ibcs2_socksys.c ibcs2_util.c ibcs2_xenix.c ibcs2_xenix_sysent.c \ - ibcs2_isc.c ibcs2_isc_sysent.c \ - ibcs2_msg.c ibcs2_other.c ibcs2_sysi86.c ibcs2_sysvec.c \ - vnode_if.h opt_spx_hack.h - -CFLAGS+= -DCOMPAT_IBCS2 - -.include diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c index 1a0d096d7f9..18ae37318fd 100644 --- a/sys/powerpc/powerpc/elf32_machdep.c +++ b/sys/powerpc/powerpc/elf32_machdep.c @@ -83,7 +83,6 @@ struct sysentvec elf32_freebsd_sysvec = { #else .sv_table = sysent, #endif - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c index 74a13064bd4..e6892c82daa 100644 --- a/sys/powerpc/powerpc/elf64_machdep.c +++ b/sys/powerpc/powerpc/elf64_machdep.c @@ -58,7 +58,6 @@ static void exec_setregs_funcdesc(struct thread *td, struct image_params *imgp, struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, @@ -97,7 +96,6 @@ INIT_SYSENTVEC(elf64_sysvec_v1, &elf64_freebsd_sysvec_v1); struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index 4105395ed6f..e7488d0df7f 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -859,8 +859,6 @@ cpu_set_syscall_retval(struct thread *td, int error) if (tf->fixreg[0] == SYS___syscall && (SV_PROC_FLAG(p, SV_ILP32))) { int code = tf->fixreg[FIRSTARG + 1]; - if (p->p_sysent->sv_mask) - code &= p->p_sysent->sv_mask; fixup = ( #if defined(COMPAT_FREEBSD6) && defined(SYS_freebsd6_lseek) code != SYS_freebsd6_lseek && diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c index cdb644f7a75..073ab561b18 100644 --- a/sys/powerpc/powerpc/trap.c +++ b/sys/powerpc/powerpc/trap.c @@ -609,8 +609,6 @@ cpu_fetch_syscall_args(struct thread *td) } } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else diff --git a/sys/riscv/riscv/elf_machdep.c b/sys/riscv/riscv/elf_machdep.c index f3f589b6f14..e9ca4ca0228 100644 --- a/sys/riscv/riscv/elf_machdep.c +++ b/sys/riscv/riscv/elf_machdep.c @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c index 57f5c558d28..bbd1391bbc5 100644 --- a/sys/riscv/riscv/trap.c +++ b/sys/riscv/riscv/trap.c @@ -111,8 +111,6 @@ cpu_fetch_syscall_args(struct thread *td) nap--; } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c index 0eaeff8f810..1fbd09fa945 100644 --- a/sys/sparc64/sparc64/elf_machdep.c +++ b/sys/sparc64/sparc64/elf_machdep.c @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); static struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_mask = 0, .sv_errsize = 0, .sv_errtbl = NULL, .sv_transtrap = NULL, diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c index 39ff59e9310..81c48b7699f 100644 --- a/sys/sparc64/sparc64/trap.c +++ b/sys/sparc64/sparc64/trap.c @@ -558,8 +558,6 @@ cpu_fetch_syscall_args(struct thread *td) regcnt--; } - if (p->p_sysent->sv_mask) - sa->code &= p->p_sysent->sv_mask; if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; else diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 3938a8ab0e9..434b69b2f4e 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -95,7 +95,6 @@ struct vnode; struct sysentvec { int sv_size; /* number of entries */ struct sysent *sv_table; /* pointer to sysent */ - u_int sv_mask; /* optional mask to index */ int sv_errsize; /* size of errno translation table */ const int *sv_errtbl; /* errno translation table */ int (*sv_transtrap)(int, int); diff --git a/usr.sbin/bsdconfig/startup/include/messages.subr b/usr.sbin/bsdconfig/startup/include/messages.subr index 484272646fc..66b8bf6c731 100644 --- a/usr.sbin/bsdconfig/startup/include/messages.subr +++ b/usr.sbin/bsdconfig/startup/include/messages.subr @@ -90,8 +90,6 @@ msg_rcvar_contains_invalid_chars="ERROR! rc.conf(5) variable name contains inval msg_rcvar_must_start_with="ERROR! rc.conf(5) variable name must start with\n a letter [a-zA-Z] or underscore [_]." msg_reset="Reset" msg_reset_desc="Reset to default view settings" -msg_sco="SCO" -msg_sco_desc="This host wants to be able to run IBCS2 binaries." msg_show_configured="Show Configured" msg_show_configured_desc="Calculate rc.conf(5) locations (slowest)" msg_show_default_value="Show Default/Value" diff --git a/usr.sbin/bsdconfig/startup/misc b/usr.sbin/bsdconfig/startup/misc index 1dff36ad6a6..24638bfe7e2 100755 --- a/usr.sbin/bsdconfig/startup/misc +++ b/usr.sbin/bsdconfig/startup/misc @@ -73,7 +73,6 @@ dialog_menu_main() if [ "$UNAME_P" = "i386" ]; then var_list="$var_list apm_enable - ibcs2_enable " # END-QUOTE fi @@ -94,7 +93,6 @@ dialog_menu_main() export msg_nis_server msg_nis_server_desc export msg_accounting msg_accounting_desc export msg_lpd msg_lpd_desc - export msg_sco msg_sco_desc :| awk \ -v uname_p="$UNAME_P" \ -v menu_tags="$DIALOG_MENU_TAGS" \ @@ -223,21 +221,6 @@ dialog_menu_main() mprint(tag, ENVIRON["msg_lpd_desc"]) if (ditem == char) defaultitem = tag - if ( uname_p == "i386" ) - { - # - # SCO: This host wants to be able to run IBCS2 - # binaries. - # - char = substr(menu_tags, i++, 1) - mark = ( ENVIRON["ibcs2_enable"] ~ \ - /^[Yy][Ee][Ss]$/ ? "X" : " " ) - subtag = ENVIRON["msg_sco"] - tag = sprintf(mtag_fmt, char, mark, subtag) - mprint(tag, ENVIRON["msg_sco_desc"]) - if (ditem == char) defaultitem = tag - } - printf "\"\n" if ( defaultitem ) @@ -343,9 +326,6 @@ while :; do ?" ["?"] $msg_lpd") f_eval_catch -dk err "$0" f_sysrc_set \ 'f_sysrc_set lpd_enable "%s"' "$reverse" ;; - ?" ["?"] $msg_sco") - f_eval_catch -dk err "$0" f_sysrc_set \ - 'f_sysrc_set ibcs2_enable "%s"' "$reverse" ;; # Multi-variable On/Off toggle bits ?" ["?"] $msg_nis_client") if f_eval_catch -dk err "$0" f_sysrc_set \