From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25637 invoked by alias); 23 Jan 2006 02:01:43 -0000 Received: (qmail 25623 invoked by uid 22791); 23 Jan 2006 02:01:42 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 23 Jan 2006 02:01:41 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F0r1S-0000cg-Vb; Sun, 22 Jan 2006 21:01:35 -0500 Date: Mon, 23 Jan 2006 02:01:00 -0000 From: Daniel Jacobowitz To: Shaun Jackman , Richard Earnshaw Cc: gdb-patches@sources.redhat.com Subject: Re: sim/arm RedBoot meminfo syscall [PATCH] Message-ID: <20060123020134.GL27224@nevyn.them.org> Mail-Followup-To: Shaun Jackman , Richard Earnshaw , gdb-patches@sources.redhat.com References: <7f45d9390512141040m6d43725ag@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f45d9390512141040m6d43725ag@mail.gmail.com> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00314.txt.bz2 On Wed, Dec 14, 2005 at 11:40:28AM -0700, Shaun Jackman wrote: > This patch implements the RedBoot meminfo syscall. In addition, rather > than ignoring unhandled syscalls, it sets errno to ENOSYS and returns > -1. This makes it possible to run "Hello, world!" compiled using > newlib and a RedBoot libgloss. > > Cheers, > Shaun > > 2005-12-14 Shaun Jackman > > * sim/arm/armos.c (ARMul_OSHandleSWI): Handle the RedBoot system > call meminfo. Return ENOSYS for unhandled RedBoot syscalls. This looks totally plausible to me but I don't know much about it; Richard, any opinion on it before I approve it? > > Index: armos.c > =================================================================== > RCS file: /cvs/src/src/sim/arm/armos.c,v > retrieving revision 1.23 > diff -u -r1.23 armos.c > --- armos.c 17 Nov 2005 04:23:03 -0000 1.23 > +++ armos.c 14 Dec 2005 18:36:19 -0000 > @@ -859,9 +859,26 @@ > case 18: /* Time. */ > sim_callback->printf_filtered > (sim_callback, > - "sim: unhandled RedBoot syscall '%d' encountered - ignoring\n", > + "sim: unhandled RedBoot syscall `%d' encountered - " > + "returning ENOSYS\n", > state->Reg[0]); > - return FALSE; > + state->Reg[0] = -1; > + OSptr->ErrorNo = cb_host_to_target_errno > + (sim_callback, ENOSYS); > + break; > + case 1001: /* Meminfo. */ > + { > + ARMword totmem = state->Reg[1], > + topmem = state->Reg[2]; > + ARMword stack = state->MemSize > 0 > + ? state->MemSize : ADDRUSERSTACK; > + if (totmem != 0) > + ARMul_WriteWord (state, totmem, stack); > + if (topmem != 0) > + ARMul_WriteWord (state, topmem, stack); > + state->Reg[0] = 0; > + break; > + } > > default: > sim_callback->printf_filtered > -- Daniel Jacobowitz CodeSourcery