[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
i386ex question
- Date: 30 Sep 1998 15:12:33 -0400
- From: ian at airs.com (Ian Lance Taylor)
- Subject: i386ex question
Date: Wed, 30 Sep 1998 13:51:00 -0500 (CDT)
From: <joel at OARcorp.com>
On 29 Sep 1998 ian at airs.com wrote:
> I'm not completely up on i386 details, but my impression is that the
> instruction you really want here is
> data32 addr32 lgdt gdtptr - start16
>
> An autoconf test to see whether this works is
>
> AC_TRY_COMPILE(,[asm(".code16; data32 addr32 lgdt 0; .code32");],
> AC_DEFINE(NEW_GAS))
What does this need to be wrapped in to insure that it is only used on
i386-rtems* targets?
Something along these lines would probably do the job. However, I
don't know the best way to communicate the result of the test to the
code in question.
In this patch I called AC_DEFINE; that will only work if an
appropriate entry is added to c/build-tools/src/config.h.in, and if
the assembler code includes that file.
Another, probably better, approach would be to call AC_SUBST, and then
to have the appropriate Makefile pass the information when it
assembles the file. I don't really grok the RTEMS Makefile setup.
Ian
Index: configure.in
===================================================================
RCS file: /zembu/cvsfiles/devo/rtems/configure.in,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 configure.in
--- configure.in 1998/09/29 22:16:50 1.1.1.3
+++ configure.in 1998/09/30 19:08:37
@@ -227,6 +227,24 @@
RTEMS_CANONICALIZE_TOOLS
+dnl check for i386 gas supporting 16 bit mode
+if test "${target_cpu}" = "i386"; then
+ AC_CACHE_CHECK([for 16 bit mode assembler support],
+ rtems_cv_prog_gas_code16,
+ [cat > conftest.s << EOF
+ .code16
+ data32 addr32 lgdt 0
+EOF
+ if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
+ rtems_cv_prog_gas_code16=yes
+ else
+ rtems_cv_prog_gas_code16=no
+ fi])
+ if test "$rtems_cv_prog_gas_code16" = "yes"; then
+ AC_DEFINE(RTEMS_PROG_GAS_CODE16)
+ fi
+fi
+
dnl check host cc
AC_PROG_CC