Index: plex86/aclocal.m4 diff -u /dev/null plex86/aclocal.m4:1.1 --- /dev/null Thu May 17 13:20:31 2001 +++ plex86/aclocal.m4 Tue Apr 17 20:33:21 2001 @@ -0,0 +1,44 @@ +dnl $Id: aclocal.m4,v 1.1 2001/04/17 11:33:21 tanimura Exp $ +dnl +dnl AC_DECL_TYPE(HEADER-FILE, TYPE [, IF-TYPE-DEFINED [, IF-TYPE-NOT-DEFINED]]) +dnl +dnl Checks whether HEADER-FILE defines TYPE. If true, do IF-TYPE-DEFINED. +dnl Otherwise, do IF-TYPE-NOT-DEFINED. +dnl +AC_DEFUN(AC_DECL_TYPE, [ +AC_REQUIRE([AC_PROG_CPP]) +ac_decl_type_var=`echo $2 | sed 'y%./+- %__p__%'` +ac_decl_type_result=no +for incf in $1; do +ac_decl_type_header_var=`echo $incf'_'$2 | sed 'y%./+- %__p__%'` +AC_MSG_CHECKING([whether $incf defines type $2]) +AC_CACHE_VAL(ac_cv_decl_type_header_$ac_decl_type_header_var, +AC_EGREP_CPP(dnl +changequote(<<,>>)dnl +<<(^|[[^a-zA-Z_0-9]])$2[[^a-zA-Z_0-9]]>>dnl +changequote([,]), [#include <$incf> +], +eval "ac_cv_decl_type_header_$ac_decl_type_header_var=yes" +ac_decl_type_header_def='HAVE_'`echo $ac_decl_type_header_var | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +AC_DEFINE_UNQUOTED($ac_decl_type_header_def,1), +eval "ac_cv_decl_type_header_$ac_decl_type_header_var=no")) +eval "ac_decl_type_header_result=\${ac_cv_decl_type_header_$ac_decl_type_header_var}" +AC_MSG_RESULT($ac_decl_type_header_result) +if test $ac_decl_type_result = no -a $ac_decl_type_header_result != no; then +ac_decl_type_result=$incf +fi +done +AC_MSG_CHECKING([which header file defines type $2]) +AC_CACHE_VAL(ac_cv_decl_type_$ac_decl_type_var, +eval "ac_cv_decl_type_$ac_decl_type_var=\${ac_decl_type_result}") +AC_MSG_RESULT($ac_decl_type_result) +if test $ac_decl_type_result != no; then +ac_decl_type_def='HAVE_'`echo $ac_decl_type_var | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +AC_DEFINE_UNQUOTED($ac_decl_type_def,$ac_decl_type_result) +$3 +eval +else +$4 +eval +fi +])dnl Index: plex86/config.h.in diff -u plex86/config.h.in:1.1.1.1 plex86/config.h.in:1.2 --- plex86/config.h.in:1.1.1.1 Mon Apr 16 09:42:30 2001 +++ plex86/config.h.in Tue Apr 17 20:33:21 2001 @@ -139,3 +139,5 @@ #define SUPPORT_INSTRUMENTATION 0 #define USE_LOADER 0 + +#define OFF_T off_t Index: plex86/configure diff -u plex86/configure:1.1.1.1 plex86/configure:1.2 --- plex86/configure:1.1.1.1 Mon Apr 16 09:42:42 2001 +++ plex86/configure Tue Apr 17 20:33:21 2001 @@ -917,66 +917,8 @@ fi fi -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:922: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:951: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:980: checking how to run the C preprocessor" >&5 +echo "configure:922: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -991,13 +933,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1008,13 +950,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1025,13 +967,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1055,6 +997,64 @@ fi echo "$ac_t""$CPP" 1>&6 +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:1002: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1031: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # If we find X, set shell vars x_includes and x_libraries to the # paths, otherwise set no_x=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. @@ -2125,15 +2125,180 @@ EOF +ac_safe=`echo "sys/types.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for sys/types.h""... $ac_c" 1>&6 +echo "configure:2131: checking for sys/types.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + + +ac_decl_type_var=`echo loff_t | sed 'y%./+- %__p__%'` +ac_decl_type_result=no +for incf in sys/types.h; do +ac_decl_type_header_var=`echo $incf'_'loff_t | sed 'y%./+- %__p__%'` +echo $ac_n "checking whether $incf defines type loff_t""... $ac_c" 1>&6 +echo "configure:2169: checking whether $incf defines type loff_t" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_type_header_$ac_decl_type_header_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])loff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + eval "ac_cv_decl_type_header_$ac_decl_type_header_var=yes" +ac_decl_type_header_def='HAVE_'`echo $ac_decl_type_header_var | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +cat >> confdefs.h <&6 +if test $ac_decl_type_result = no -a $ac_decl_type_header_result != no; then +ac_decl_type_result=$incf +fi +done +echo $ac_n "checking which header file defines type loff_t""... $ac_c" 1>&6 +echo "configure:2203: checking which header file defines type loff_t" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_type_$ac_decl_type_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + eval "ac_cv_decl_type_$ac_decl_type_var=\${ac_decl_type_result}" +fi + +echo "$ac_t""$ac_decl_type_result" 1>&6 +if test $ac_decl_type_result != no; then +ac_decl_type_def='HAVE_'`echo $ac_decl_type_var | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:2230: checking whether $incf defines type off_t" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_type_header_$ac_decl_type_header_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + eval "ac_cv_decl_type_header_$ac_decl_type_header_var=yes" +ac_decl_type_header_def='HAVE_'`echo $ac_decl_type_header_var | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +cat >> confdefs.h <&6 +if test $ac_decl_type_result = no -a $ac_decl_type_header_result != no; then +ac_decl_type_result=$incf +fi +done +echo $ac_n "checking which header file defines type off_t""... $ac_c" 1>&6 +echo "configure:2264: checking which header file defines type off_t" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_type_$ac_decl_type_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + eval "ac_cv_decl_type_$ac_decl_type_var=\${ac_decl_type_result}" +fi + +echo "$ac_t""$ac_decl_type_result" 1>&6 +if test $ac_decl_type_result != no; then +ac_decl_type_def='HAVE_'`echo $ac_decl_type_var | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +cat >> confdefs.h <> confdefs.h <> confdefs.h <&6 -echo "configure:2132: checking for $ac_func" >&5 +echo "configure:2297: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2184,7 +2349,7 @@ done echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2188: checking for dlopen in -ldl" >&5 +echo "configure:2353: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2192,7 +2357,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2272,7 +2437,7 @@ echo $ac_n "checking for CDROM support""... $ac_c" 1>&6 -echo "configure:2276: checking for CDROM support" >&5 +echo "configure:2441: checking for CDROM support" >&5 # Check whether --enable-cdrom or --disable-cdrom was given. if test "${enable_cdrom+set}" = set; then enableval="$enable_cdrom" @@ -2314,7 +2479,7 @@ echo $ac_n "checking for instrumentation support""... $ac_c" 1>&6 -echo "configure:2318: checking for instrumentation support" >&5 +echo "configure:2483: checking for instrumentation support" >&5 # Check whether --enable-instrumentation or --disable-instrumentation was given. if test "${enable_instrumentation+set}" = set; then enableval="$enable_instrumentation" @@ -2681,6 +2846,7 @@ dt-testbed/proto3/codegen/Makefile dt-testbed/proto3/debug/Makefile docs/Makefile +docs/xml/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Index: plex86/configure.in diff -u plex86/configure.in:1.1.1.1 plex86/configure.in:1.2 --- plex86/configure.in:1.1.1.1 Mon Apr 16 09:42:44 2001 +++ plex86/configure.in Tue Apr 17 20:33:21 2001 @@ -9,6 +9,7 @@ AC_PROG_CC AC_PROG_CXX +AC_PROG_CPP AC_PROG_MAKE_SET AC_PROG_RANLIB @@ -20,6 +21,12 @@ AC_CHECK_SIZEOF(unsigned int, 0) AC_CHECK_SIZEOF(unsigned long, 0) AC_CHECK_SIZEOF(unsigned long long, 0) +AC_CHECK_HEADER(sys/types.h) +AC_DECL_TYPE(sys/types.h,loff_t, + AC_DEFINE_UNQUOTED(OFF_T,loff_t), + [AC_DECL_TYPE(sys/types.h,off_t, + AC_DEFINE_UNQUOTED(OFF_T,off_t), + AC_DEFINE_UNQUOTED(OFF_T,unsigned long))]) AC_CHECK_FUNCS(select, AC_DEFINE(HAVE_SELECT)) AC_CHECK_LIB(dl, dlopen, LIBDL='-ldl', @@ -302,4 +309,5 @@ dt-testbed/proto3/codegen/Makefile dt-testbed/proto3/debug/Makefile docs/Makefile +docs/xml/Makefile ]) Index: plex86/docs/xml/Makefile diff -u plex86/docs/xml/Makefile:1.1.1.1 plex86/docs/xml/Makefile:1.2 --- plex86/docs/xml/Makefile:1.1.1.1 Mon Apr 16 09:44:03 2001 +++ plex86/docs/xml/Makefile Tue Apr 17 20:33:22 2001 @@ -1,16 +1,17 @@ +# Generated automatically from Makefile.in by configure. .PHONY: all html clean ps all: html html: - make -C PUG html - make -C PIG html + $(MAKE) -C PUG html + $(MAKE) -C PIG html ps: - make -C PUG ps - make -C PIG ps + $(MAKE) -C PUG ps + $(MAKE) -C PIG ps clean: - make -C PUG clean - make -C PIG clean + $(MAKE) -C PUG clean + $(MAKE) -C PIG clean /bin/rm -f *~ Index: plex86/docs/xml/Makefile.in diff -u /dev/null plex86/docs/xml/Makefile.in:1.1 --- /dev/null Thu May 17 13:20:31 2001 +++ plex86/docs/xml/Makefile.in Tue Apr 17 20:33:22 2001 @@ -0,0 +1,16 @@ +.PHONY: all html clean ps + +all: html + +html: + $(MAKE) -C PUG html + $(MAKE) -C PIG html + +ps: + $(MAKE) -C PUG ps + $(MAKE) -C PIG ps + +clean: + $(MAKE) -C PUG clean + $(MAKE) -C PIG clean + /bin/rm -f *~ Index: plex86/docs/xml/PIG/Makefile.in diff -u /dev/null plex86/docs/xml/PIG/Makefile.in:1.1 --- /dev/null Thu May 17 13:20:32 2001 +++ plex86/docs/xml/PIG/Makefile.in Tue Apr 17 20:33:22 2001 @@ -0,0 +1,23 @@ +.PHONY: all html clean ps + +DOC2HTML = @DOC2HTML@ +DOC2PS = @DOC2PS@ + +all: html + +html: + /bin/rm -rf ../../output/html/PIG + mkdir -p ../../output/html/PIG + ${DOC2HTML} -l /usr/share/doc/openjade-1.3/pubtext/xml.dcl \ + -c /etc/sgml/catalog \ + -o ../../output/html/PIG book_PIG.xml + /bin/cp -f *.gif ../../output/html/PIG + +ps: + ${DOC2PS} -l /usr/share/doc/openjade-1.3/pubtext/xml.dcl \ + -c /etc/sgml/catalog \ + book_PIG.xml + /bin/mv -f book_PIG.ps ../../output/ps/ + +clean: + /bin/rm -f *.tex *.aux *.dvi *.log *.out *.pdf *.ps *~ Index: plex86/docs/xml/PUG/Makefile.in diff -u /dev/null plex86/docs/xml/PUG/Makefile.in:1.1 --- /dev/null Thu May 17 13:20:32 2001 +++ plex86/docs/xml/PUG/Makefile.in Tue Apr 17 20:33:22 2001 @@ -0,0 +1,19 @@ +.PHONY: all html clean ps + +all: html + +html: + /bin/rm -rf ../../output/html/PUG + mkdir ../../output/html/PUG + docbook2html -l /usr/share/doc/openjade-1.3/pubtext/xml.dcl \ + -c /etc/sgml/catalog \ + -o ../../output/html/PUG book_PUG.xml + +ps: + docbook2ps -l /usr/share/doc/openjade-1.3/pubtext/xml.dcl \ + -c /etc/sgml/catalog \ + book_PUG.xml + /bin/mv -f book_PUG.ps ../../output/ps/ + +clean: + /bin/rm -f *.tex *.aux *.dvi *.log *.out *.pdf *.ps *~ Index: plex86/kernel/Makefile.in diff -u plex86/kernel/Makefile.in:1.1.1.1 plex86/kernel/Makefile.in:1.3 --- plex86/kernel/Makefile.in:1.1.1.1 Mon Apr 16 09:45:43 2001 +++ plex86/kernel/Makefile.in Thu May 17 13:20:20 2001 @@ -104,6 +104,7 @@ [ -r opt_posix.h ] || touch opt_posix.h freebsd-machine: + /bin/rm -f machine ln -sf @FREEBSD_SRC@/i386/include machine freebsd-clean: Index: plex86/kernel/host-freebsd.c diff -u plex86/kernel/host-freebsd.c:1.1.1.1 plex86/kernel/host-freebsd.c:1.3 --- plex86/kernel/host-freebsd.c:1.1.1.1 Mon Apr 16 09:45:47 2001 +++ plex86/kernel/host-freebsd.c Thu May 17 13:20:20 2001 @@ -45,6 +45,7 @@ #include #include +#include #undef timer_t #undef write_eflags @@ -80,7 +81,11 @@ /* dump */ nodump, /* psize */ nopsize, /* flags */ 0, +#if __FreeBSD_version >= 500011 + /* kqflt */ NULL +#else /* bmaj */ -1 +#endif /* __FreeBSD_version >= 500011 */ }; /* For use with make_dev/destroy_dev */ @@ -358,7 +363,7 @@ php = &plex86_hashtbl[PLEX86_VMHASH(p)]; #if DIAGNOSTIC - for (vhp = php->lh_first; vhp != NULL; vhp = vhp->vm_entry.le_next) { + LIST_FOREACH(vhp, php, vm_entry) { if (vhp->vm_pid == p->p_pid) panic("plex86: vm already registered, pid %u\n", p->p_pid); @@ -377,7 +382,7 @@ struct plex86_vmentry *vhp; php = &plex86_hashtbl[PLEX86_VMHASH(p)]; - for (vhp = php->lh_first; vhp != NULL; vhp = vhp->vm_entry.le_next) { + LIST_FOREACH(vhp, php, vm_entry) { if (vhp->vm_pid == p->p_pid) { LIST_REMOVE(vhp, vm_entry); free(vhp->vm_vm, M_PLEX86); @@ -390,15 +395,13 @@ static void unregister_all(struct proc * p) { - int i; struct plex86_hashhead *php; struct plex86_vmentry *vhp; php = &plex86_hashtbl[PLEX86_VMHASH(p)]; if (php == NULL) return; - for (vhp = php->lh_first; vhp != NULL; - vhp = vhp->vm_entry.le_next) { + LIST_FOREACH(vhp, php, vm_entry) { #ifdef FREEBSD_PLEX86_DEBUG printf("plex86: unregister vm %p, pid %u\n", vhp->vm_vm, vhp->vm_pid); @@ -406,8 +409,12 @@ LIST_REMOVE(vhp, vm_entry); if (vhp->vm_vm != NULL) free(vhp->vm_vm, M_PLEX86); - if (vhp != NULL) + if (vhp != NULL) { free(vhp, M_PLEX86); + vhp = LIST_FIRST(php); + if (vhp == NULL) + break; + } } } @@ -418,7 +425,7 @@ struct plex86_vmentry *vhp; php = &plex86_hashtbl[PLEX86_VMHASH(p)]; - for (vhp = php->lh_first; vhp != NULL; vhp = vhp->vm_entry.le_next) { + LIST_FOREACH(vhp, php, vm_entry) { if (vhp->vm_pid == p->p_pid) return vhp->vm_vm; } @@ -451,7 +458,7 @@ return (0); } for (i = 0; i < n_pages; i++) { - page[i] = kvtop((vm_offset_t) start_addr) / PAGE_SIZE; + page[i] = kvtop((void *) start_addr) / PAGE_SIZE; start_addr += PAGE_SIZE; } @@ -465,11 +472,19 @@ if (want_resched) { #endif yield(curproc, NULL); /* XXX */ +#if __FreeBSD__ > 500013 + mtx_lock_spin(&sched_lock); +#endif /* __FreeBSD__ > 500013 */ need_resched(); /* XXX */ +#if __FreeBSD__ > 500013 + mtx_unlock_spin(&sched_lock); +#endif /* __FreeBSD__ > 500013 */ #if defined(want_resched) } #endif +#if notdef printf("resched done\n"); +#endif /* notdef */ return (CURSIG(curproc) == 0); } @@ -571,7 +586,7 @@ printf("plex86: can't find linker_file 'plex86'\n"); return (ENXIO); } - monitor_pages.start_addr = lf->address; + monitor_pages.start_addr = (Bit32u)lf->address; if ((monitor_pages.n_pages = retrieve_phy_pages(monitor_pages.page, PLEX86_MAX_MONITOR_PAGES, Index: plex86/kernel/mon-fault.c diff -u plex86/kernel/mon-fault.c:1.1.1.1 plex86/kernel/mon-fault.c:1.2 --- plex86/kernel/mon-fault.c:1.1.1.1 Mon Apr 16 09:46:03 2001 +++ plex86/kernel/mon-fault.c Thu May 17 13:20:20 2001 @@ -225,8 +225,12 @@ * Simply restore state from the monitor stack. */ "__ret_to_monitor: \n" +#if defined(__FreeBSD__) +" addl $8, %esp \n" /* Ignore %gs and %fs */ +#else " popl %gs \n" /* Restore monitor segments */ -" popl %fs \n" +" popl %fs \n" /* Restore monitor segments */ +#endif /* __FreeBSD__ */ " popl %ds \n" " popl %es \n" " popal \n" /* Restore monitor general registers */ @@ -838,13 +842,35 @@ } } + + void handle_mon_fault( guest_context_t context ) { nexus_t *nexus = (nexus_t *) (((Bit32u) &context) & 0xfffff000); vm_t *vm = (vm_t *) nexus->vm; + gdt_info_t gdtrval; + Bit32u ldtrval; + seg_desc_t *sdtable; + Bit32u sdlimit; /* Fault occurred inside monitor code; abort. */ vm->abort_code = 1; - monpanic_nomess(vm); + if (context.vector == 13) { + monprint(vm, "General protection fault in monitor"); + monprint(vm, ((context.error & 0x00000001) == 0) ? "Internal" : "External"); + monprint(vm, ((context.error & 0x00000002) != 0) ? "IDT" : (((context.error & 0x00000004) == 0) ? "GDT" : "LDT")); + monprint(vm, "Selector index 0x%x", context.error >> 3); + + if ((context.error & 0x00000002) == 0) { + asm volatile ("sgdt %0" : "=m"(gdtrval)); + sdtable = (seg_desc_t *)gdtrval.base; + sdlimit = gdtrval.limit; + monprint(vm, "GDT base\t%x", gdtrval.base); + monprint(vm, "GDT limit\t%x", gdtrval.limit); + asm volatile ("sldt %0" : "=m"(ldtrval)); + monprint(vm, "LDT selector\t%x", ldtrval); + } + } + monpanic(vm, "Fault in monitor code, vector %u, error %x, cs:eip %x:%x ds %x es %x fs %x gs %x\n", context.vector, context.error, context.cs, context.eip, context.ds, context.es, context.fs, context.gs); } Index: plex86/kernel/include/descriptor2.h diff -u plex86/kernel/include/descriptor2.h:1.1.1.1 plex86/kernel/include/descriptor2.h:1.2 --- plex86/kernel/include/descriptor2.h:1.1.1.1 Mon Apr 16 09:47:40 2001 +++ plex86/kernel/include/descriptor2.h Thu May 17 13:20:20 2001 @@ -41,6 +41,21 @@ Bit32u base; } __attribute__ ((packed)) gdt_info_t; +typedef struct +{ + unsigned sd_lolimit:16 ; /* segment extent (lsb) */ + unsigned sd_lobase:24 __attribute__ ((packed)); + /* segment base address (lsb) */ + unsigned sd_type:5 ; /* segment type */ + unsigned sd_dpl:2 ; /* segment descriptor priority level */ + unsigned sd_p:1 ; /* segment descriptor present */ + unsigned sd_hilimit:4 ; /* segment extent (msb) */ + unsigned sd_xx:2 ; /* unused */ + unsigned sd_def32:1 ; /* default 32 vs 16 bit size */ + unsigned sd_gran:1 ; /* limit granularity (byte/page units)*/ + unsigned sd_hibase:8 ; /* segment base address (msb) */ +} __attribute__ ((packed)) seg_desc_t; + #define SET_INT_GATE(d, S,O,P,DPL, D) {\ Index: plex86/user/plugins/bochs/iodev/harddrv.cc diff -u plex86/user/plugins/bochs/iodev/harddrv.cc:1.1.1.1 plex86/user/plugins/bochs/iodev/harddrv.cc:1.2 --- plex86/user/plugins/bochs/iodev/harddrv.cc:1.1.1.1 Mon Apr 16 09:49:27 2001 +++ plex86/user/plugins/bochs/iodev/harddrv.cc Tue Apr 17 20:33:22 2001 @@ -313,14 +313,14 @@ } else { /* read next one into controller buffer */ unsigned long logical_sector; - loff_t ret; + OFF_T ret; BX_SELECTED_CONTROLLER.status.drq = 1; BX_SELECTED_CONTROLLER.status.seek_complete = 1; logical_sector = calculate_logical_address(); - ret = BX_SELECTED_HD.hard_drive->lseek((loff_t)logical_sector * 512, SEEK_SET); + ret = BX_SELECTED_HD.hard_drive->lseek((OFF_T)logical_sector * 512, SEEK_SET); if (ret == -1) bx_panic("disk: could lseek() hard drive image file\n"); @@ -668,11 +668,11 @@ /* if buffer completely writtten */ if (BX_SELECTED_CONTROLLER.buffer_index >= 512) { unsigned long logical_sector; - loff_t ret; + OFF_T ret; logical_sector = calculate_logical_address(); - ret = BX_SELECTED_HD.hard_drive->lseek((loff_t)logical_sector * 512, SEEK_SET); + ret = BX_SELECTED_HD.hard_drive->lseek((OFF_T)logical_sector * 512, SEEK_SET); if (ret == -1) bx_panic("disk: could lseek() hard drive image file\n"); @@ -1293,7 +1293,7 @@ logical_sector = calculate_logical_address(); - ret = BX_SELECTED_HD.hard_drive->lseek((loff_t)logical_sector * 512, SEEK_SET); + ret = BX_SELECTED_HD.hard_drive->lseek((OFF_T)logical_sector * 512, SEEK_SET); if (ret == -1) { bx_panic("disk: could not lseek() hard drive image file\n"); @@ -2307,7 +2307,7 @@ } } -loff_t default_image_t::lseek (loff_t offset, int whence) +OFF_T default_image_t::lseek (OFF_T offset, int whence) { return pluginWCLSeek(fd, offset, whence); } Index: plex86/user/plugins/bochs/iodev/harddrv.h diff -u plex86/user/plugins/bochs/iodev/harddrv.h:1.1.1.1 plex86/user/plugins/bochs/iodev/harddrv.h:1.2 --- plex86/user/plugins/bochs/iodev/harddrv.h:1.1.1.1 Mon Apr 16 09:49:28 2001 +++ plex86/user/plugins/bochs/iodev/harddrv.h Tue Apr 17 20:33:22 2001 @@ -45,7 +45,7 @@ // Position ourselves. Return the resulting offset from the // beginning of the file. - virtual loff_t lseek (loff_t offset, int whence) = 0; + virtual OFF_T lseek (OFF_T offset, int whence) = 0; // Read count bytes to the buffer buf. Return the number of // bytes read (count). @@ -71,7 +71,7 @@ // Position ourselves. Return the resulting offset from the // beginning of the file. - loff_t lseek (loff_t offset, int whence); + OFF_T lseek (OFF_T offset, int whence); // Read count bytes to the buffer buf. Return the number of // bytes read (count). Index: plex86/user/plugins/write-cache/write-cache.cc diff -u plex86/user/plugins/write-cache/write-cache.cc:1.1.1.1 plex86/user/plugins/write-cache/write-cache.cc:1.2 --- plex86/user/plugins/write-cache/write-cache.cc:1.1.1.1 Mon Apr 16 09:50:36 2001 +++ plex86/user/plugins/write-cache/write-cache.cc Tue Apr 17 20:33:23 2001 @@ -167,7 +167,7 @@ void WriteCache::DoSeek() { - loff_t result; + OFF_T result; #if 1 if (!mustseek)