From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7273 invoked by alias); 1 Mar 2011 23:42:37 -0000 Received: (qmail 7264 invoked by uid 22791); 1 Mar 2011 23:42:36 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Mar 2011 23:42:29 +0000 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 9E62C1B407C; Tue, 1 Mar 2011 23:42:27 +0000 (UTC) From: Mike Frysinger To: Pedro Alves Subject: Re: [PATCH v5] sim: bfin: new port Date: Tue, 01 Mar 2011 23:42:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.37; KDE/4.6.0; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <201011152039.08285.vapier@gentoo.org> <201102221526.45398.vapier@gentoo.org> <201103012119.26255.pedro@codesourcery.com> In-Reply-To: <201103012119.26255.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1468315.rGK6xgmYzA"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201103011702.22120.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00068.txt.bz2 --nextPart1468315.rGK6xgmYzA Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-length: 4863 On Tuesday, March 01, 2011 16:19:25 Pedro Alves wrote: > On Tuesday 22 February 2011 20:26:44, Mike Frysinger wrote: > > --- /dev/null > > +++ b/sim/bfin/linux-fixed-code.h > > @@ -0,0 +1,23 @@ > > +/* DO NOT EDIT: Autogenerated. */ > > +/* Fixed code region of Linux userspace starting at 0x400. Last > > produced + from Linux-2.6.37 (not that the fixed code region changes > > often). */ +static const unsigned char bfin_linux_fixed_code[] =3D { > > +0x28, 0xe1, 0xad, 0x00, 0xa0, 0x00, 0x00, 0x20, >=20 > (...) >=20 > > +0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > > +}; >=20 > Now this kernel code in question was probably (haven't > checked) largely written by ADI, and as such ADI could > probably contribute a standalone version of its source > to the FSF under GPLv3, along with some script or makefile > that compiles it with a bfin-gcc and then generates > the blob array. Or you could write simple dumb > replacement implementations of the interface instead? this code was written purely by ADI employees (2 or 3 of them to be exact),= is=20 written in pure Blackfin assembly, and we've explicitly licensed this file= =20 under GPLv2 or later. so i dont think this is an issue. it is not used by= =20 the kernel at all ... the code is placed in a fixed location for userspace= =20 binaries to call and is defined as part of the Blackfin ABI. see below. -mike /* * This file contains sequences of code that will be copied to a * fixed location, defined in . The interrupt * handlers ensure that these sequences appear to be atomic when * executed from userspace. * These are aligned to 16 bytes, so that we have some space to replace * these sequences with something else (e.g. kernel traps if we ever do * BF561 SMP). * * Copyright 2007-2008 Analog Devices Inc. * * Licensed under the GPL-2 or later. */ #include #include #include #include __INIT ENTRY(_fixed_code_start) .align 16 ENTRY(_sigreturn_stub) P0 =3D __NR_rt_sigreturn; EXCPT 0; /* Speculative execution paranoia. */ 0: JUMP.S 0b; ENDPROC (_sigreturn_stub) .align 16 /* * Atomic swap, 8 bit. * Inputs: P0: memory address to use * R1: value to store * Output: R0: old contents of the memory address, zero extended. */ ENTRY(_atomic_xchg32) R0 =3D [P0]; [P0] =3D R1; rts; ENDPROC (_atomic_xchg32) .align 16 /* * Compare and swap, 32 bit. * Inputs: P0: memory address to use * R1: compare value * R2: new value to store * The new value is stored if the contents of the memory * address is equal to the compare value. * Output: R0: old contents of the memory address. */ ENTRY(_atomic_cas32) R0 =3D [P0]; CC =3D R0 =3D=3D R1; IF !CC JUMP 1f; [P0] =3D R2; 1: rts; ENDPROC (_atomic_cas32) .align 16 /* * Atomic add, 32 bit. * Inputs: P0: memory address to use * R0: value to add * Outputs: R0: new contents of the memory address. * R1: previous contents of the memory address. */ ENTRY(_atomic_add32) R1 =3D [P0]; R0 =3D R1 + R0; [P0] =3D R0; rts; ENDPROC (_atomic_add32) .align 16 /* * Atomic sub, 32 bit. * Inputs: P0: memory address to use * R0: value to subtract * Outputs: R0: new contents of the memory address. * R1: previous contents of the memory address. */ ENTRY(_atomic_sub32) R1 =3D [P0]; R0 =3D R1 - R0; [P0] =3D R0; rts; ENDPROC (_atomic_sub32) .align 16 /* * Atomic ior, 32 bit. * Inputs: P0: memory address to use * R0: value to ior * Outputs: R0: new contents of the memory address. * R1: previous contents of the memory address. */ ENTRY(_atomic_ior32) R1 =3D [P0]; R0 =3D R1 | R0; [P0] =3D R0; rts; ENDPROC (_atomic_ior32) .align 16 /* * Atomic and, 32 bit. * Inputs: P0: memory address to use * R0: value to and * Outputs: R0: new contents of the memory address. * R1: previous contents of the memory address. */ ENTRY(_atomic_and32) R1 =3D [P0]; R0 =3D R1 & R0; [P0] =3D R0; rts; ENDPROC (_atomic_and32) .align 16 /* * Atomic xor, 32 bit. * Inputs: P0: memory address to use * R0: value to xor * Outputs: R0: new contents of the memory address. * R1: previous contents of the memory address. */ ENTRY(_atomic_xor32) R1 =3D [P0]; R0 =3D R1 ^ R0; [P0] =3D R0; rts; ENDPROC (_atomic_xor32) .align 16 /* * safe_user_instruction * Four NOPS are enough to allow the pipeline to speculativily load * execute anything it wants. After that, things have gone bad, and * we are stuck - so panic. Since we might be in user space, we can't * call panic, so just cause a unhandled exception, this should cause * a dump of the trace buffer so we can tell were we are, and a reboot */ ENTRY(_safe_user_instruction) NOP; NOP; NOP; NOP; EXCPT 0x4; ENDPROC(_safe_user_instruction) ENTRY(_fixed_code_end) __FINIT --nextPart1468315.rGK6xgmYzA Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 836 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJNbWzuAAoJEEFjO5/oN/WBN9gQAKLiNkUO88itEV7XzLqegv0o FiVSbIEH5ULVwu6lTeCJMuTZgt1bYSv27Pk/9hYrvzUsY0PKAiX2GSmZ/f8BbjlB o87qO6GwN5EAuq012T6reKTbSVJaDaGCkbMHlDEJUkknFprj2+h8Vf2P0TJ3Xt/U GvwEoRlFDTOZ7QfxH+ooLPCpf3wUUqDGtqjCU+nZgktrjA1fAWh3hfibXneFZtek yBgtfb6k6ibLbdnDlus9OfE1tf/RhPV6iuCYJvxOTGhsShMCCAccHk4PLxE6T3bn n3e/gePp7DmnBrq0Oe1MRUn+BLuJavwQDKPH2koG2j+QEw76YeMzUJOtsm6hkUWT PK9E2fwsYa9ssnRl/vkPIDcz9g/iOgVKtKa4Y7dsIERKn/8SUv4UC5QXPsMlrYpZ sCykfkwxze7mtuND1A4TsZEdnnNn6IpelvKUG9vWK0QoxrixDQth4iFr9h4M2LFE hGX4v5pFKWKgdyP/J7s2Cghaq9K1feOXZ89b5SFHgfJh/P1NilOglAXB4/d2mV7q PAnaTjEk16DANPM2VGJ39ox+jxv54spfre8zzN4vTFhRqKJ4Szc4kD33Tn3DtHFt 6Zr2GZcEh67ASKyUfMhkRn2JbIWH+L+QZNNtN5IisNcobR+WCR3DN+8L49hjdfbD +9cYLzXaHLqgS2JoCiCT =8r1y -----END PGP SIGNATURE----- --nextPart1468315.rGK6xgmYzA--