Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HgG6X-0004GF-Cp for qemu-devel@nongnu.org; Tue, 24 Apr 2007 04:10:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HgG6W-0004FR-2Z for qemu-devel@nongnu.org; Tue, 24 Apr 2007 04:10:28 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HgG6V-0004Ep-IQ for qemu-devel@nongnu.org; Tue, 24 Apr 2007 04:10:27 -0400 Received: from mx.globalone.ru ([194.84.254.251]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HgG0z-0000r9-R8 for qemu-devel@nongnu.org; Tue, 24 Apr 2007 04:04:46 -0400 Received: from mx.globalone.ru (localhost [127.0.0.1]) by mx.globalone.ru (8.13.1/8.13.1) with ESMTP id l3O84fDP005579 for ; Tue, 24 Apr 2007 12:04:42 +0400 Received: from smtp.globalone.ru (smtp.globalone.ru [172.16.38.5]) by mx.globalone.ru (8.13.1/8.13.1) with ESMTP id l3O84VCT005541 for ; Tue, 24 Apr 2007 12:04:31 +0400 Message-ID: <006301c78646$e9255880$e90d11ac@spb.in.rosprint.ru> From: "Alexander Voropay" Date: Tue, 24 Apr 2007 12:01:09 +0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_005F_01C78668.3ED621D0" Subject: [Qemu-devel] [PATCH] MIPS Malta/YAMON SP initialization Reply-To: Alexander Voropay , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. ------=_NextPart_000_005F_01C78668.3ED621D0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0060_01C78668.3ED621D0" ------=_NextPart_001_0060_01C78668.3ED621D0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Hi! This patch adds SP initialization fot the Malta YAMON pseudo-loader. It allows to run standalone (written in C) applications: http://www.nwpi.ru/~alec/mips/yamon_test_salone.tgz $ qemu-system-mipsel -nographic -M malta -kernel yamon_test.elf Could not configure '/dev/rtc' to have a 1024 Hz timer. This is not a = fatal error, but for better emulation accuracy either use a 2.6 host Linux = kernel or type 'echo 1024 > /proc/sys/dev/rtc/max-user-freq' as root. YAMON TEST argc =3D 00000002 argv =3D 80002000 argv[00000000] =3D "yamon_test.elf" argv[00000001] =3D "" envp =3D 80002008 envp->name =3D "memsize" envp->val =3D "134217728" envp->name =3D "modetty0" envp->val =3D "38400n8r" memsize =3D 08000000 -- -=3DAV=3D- ------=_NextPart_001_0060_01C78668.3ED621D0 Content-Type: text/html; charset="koi8-r" Content-Transfer-Encoding: quoted-printable
Hi!
 
 This patch adds SP initialization = fot the=20 Malta YAMON pseudo-loader.
 
 It allows to run standalone = (written in C)=20 applications:
 
http://www.n= wpi.ru/~alec/mips/yamon_test_salone.tgz
 
 
$ qemu-system-mipsel -nographic -M = malta -kernel=20 yamon_test.elf
Could not configure '/dev/rtc' to have a 1024 Hz = timer. This=20 is not a fatal
error, but for better emulation accuracy either use a = 2.6 host=20 Linux kernel or
type 'echo 1024 > /proc/sys/dev/rtc/max-user-freq' = as=20 root.
YAMON TEST
argc =3D 00000002
argv =3D = 80002000
argv[00000000] =3D=20 "yamon_test.elf"
argv[00000001] =3D ""
envp =3D = 80002008
envp->name =3D=20 "memsize"
envp->val =3D "134217728"
envp->name =3D=20 "modetty0"
envp->val =3D "38400n8r"
memsize =3D = 08000000
 
 
--
-=3DAV=3D-
------=_NextPart_001_0060_01C78668.3ED621D0-- ------=_NextPart_000_005F_01C78668.3ED621D0 Content-Type: application/octet-stream; name="malta-stack.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="malta-stack.patch" --- qemu-CVS/qemu/hw/mips_malta.c 2007-04-20 10:33:05.000000000 +0400 +++ qemu-20072004/hw/mips_malta.c 2007-04-24 11:17:13.170009616 +0400 @@ -39,6 +39,8 @@ #define ENVP_ADDR (int32_t)0x80002000 #define VIRT_TO_PHYS_ADDEND (-((int64_t)(int32_t)0x80000000)) =20 +#define SP_ADDR (int32_t)0x80002000 + #define ENVP_NB_ENTRIES 16 #define ENVP_ENTRY_SIZE 256 =20 @@ -591,6 +593,10 @@ #endif stl_raw(p++, 0xad280088); /* = sw t0, 0x0088(t1) */ =20 + /* initialize SP */ + stl_raw(p++, 0x3c1d0000 | (((SP_ADDR - 64) >> 16) & 0xffff)); /* = lui sp, high(ENVP_ADDR) */ + stl_raw(p++, 0x37bd0000 | ((SP_ADDR - 64) & 0xffff)); /* = ori sp, a0, low(ENVP_ADDR) */ + /* Jump to kernel code */ stl_raw(p++, 0x3c1f0000 | ((kernel_entry >> 16) & 0xffff)); /* = lui ra, high(kernel_entry) */ stl_raw(p++, 0x37ff0000 | (kernel_entry & 0xffff)); /* = ori ra, ra, low(kernel_entry) */ ------=_NextPart_000_005F_01C78668.3ED621D0--