Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Mar 2010 13:46:12 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Nathan Whitehorn <nwhitehorn@freebsd.org>
Cc:        freebsd-emulation@freebsd.org, freebsd-amd64@freebsd.org, freebsd-ia64@freebsd.org
Subject:   Re: Request for review/comments: 32-bit compat for non-x86 architectures
Message-ID:  <20100310114612.GX2489@deviant.kiev.zoral.com.ua>
In-Reply-To: <4B971CA3.9090301@freebsd.org>
References:  <4B971CA3.9090301@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Tue, Mar 09, 2010 at 10:14:27PM -0600, Nathan Whitehorn wrote:
> The patch at http://people.freebsd.org/~nwhitehorn/compat_freebsd32.diff 
> (pre-generated freebsd32 syscalls stuff is included, which will be done 
> in two steps on commit) provides groundwork for supporting 32-bit 
> compatibility for 64-bit MIPS and PowerPC systems. It has been tested on 
> amd64 and powerpc64, and compile-tested on ia64. There are two main 
> parts to the patch:
> 
> 1) COMPAT_IA32 is renamed COMPAT_FREEBSD32, in analogy to 
> COMPAT_LINUX32, etc. This requires updating kernel configurations, but 
> is less painful than filling machine-independent bits of the kernel with 
> #if defined(COMPAT_IA32) || defined(COMPAT_PPC32) || 
> defined(COMPAT_MIPS32) || ..., and is no less descriptive than the old name.
> 
> 2) Modifications to the freebsd32 compat layer to support big-endian 
> architectures.
> 
> I would appreciate any comments, bugs, or test results on ia64.
> -Nathan

This fragment
--- sys/kern/imgact_elf.c	(revision 204681)
+++ sys/kern/imgact_elf.c	(working copy)
@@ -75,7 +75,7 @@
 #include <machine/elf.h>
 #include <machine/md_var.h>
 
-#if defined(COMPAT_IA32) && __ELF_WORD_SIZE == 32
+#if (defined(__amd64__) || defined(__ia64__)) && __ELF_WORD_SIZE == 32
 #include <machine/fpu.h>
 #include <compat/ia32/ia32_reg.h>
 #endif
probably should be changed ? How are struct reg32 for !ia32 case is
brought into the imgact_elf ? Can it be unified for ia32 case ?
(Similar fragment is present in sys_process.c at least).

I do not understand how +#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
etc lines are generated.

You may want to change sysent->sv_flag SV_IA32 to SV_FREEBSD32, or add
SV_FREEBSD32. You might want to review SV_IA32 usage, if any.


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkuXhoQACgkQC3+MBN1Mb4g8yQCfYgOqrFsxa2YW+UfupKgdo1Bk
bjAAoMPjQW1oYngAdGp3KG2DxD7eu5JO
=7Uzw
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100310114612.GX2489>