linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] fix showing xmon help
@ 2007-07-18  9:26 Ishizaki Kou
  2007-07-18 15:51 ` Milton Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Ishizaki Kou @ 2007-07-18  9:26 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

In some configuration, xmon help string is larger than xmon_printf
buffer. We need not to use printf.  This patch adds xmon_puts and
change to use it to show help string.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
---

This patch depends on [PATCH 1/2].


Index: linux-powerpc-git/arch/powerpc/xmon/nonstdio.h
===================================================================
--- linux-powerpc-git.orig/arch/powerpc/xmon/nonstdio.h
+++ linux-powerpc-git/arch/powerpc/xmon/nonstdio.h
@@ -5,6 +5,7 @@
 
 extern int xmon_putchar(int c);
 extern int xmon_getchar(void);
+extern void xmon_puts(const char *);
 extern char *xmon_gets(char *, int);
 extern void xmon_printf(const char *, ...);
 extern void xmon_map_scc(void);
Index: linux-powerpc-git/arch/powerpc/xmon/xmon.c
===================================================================
--- linux-powerpc-git.orig/arch/powerpc/xmon/xmon.c
+++ linux-powerpc-git/arch/powerpc/xmon/xmon.c
@@ -833,7 +833,7 @@ cmds(struct pt_regs *excp)
 			mdelay(2000);
 			return cmd;
 		case '?':
-			printf(help_string);
+			xmon_puts(help_string);
 			break;
 		case 'b':
 			bpt_cmds();
Index: linux-powerpc-git/arch/powerpc/xmon/nonstdio.c
===================================================================
--- linux-powerpc-git.orig/arch/powerpc/xmon/nonstdio.c
+++ linux-powerpc-git/arch/powerpc/xmon/nonstdio.c
@@ -132,3 +132,8 @@ void xmon_printf(const char *format, ...
 	va_end(args);
 	xmon_write(xmon_outbuf, n);
 }
+
+void xmon_puts(const char *str)
+{
+	xmon_write(str, strlen(str));
+}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] fix showing xmon help
  2007-07-18  9:26 [PATCH 2/2] fix showing xmon help Ishizaki Kou
@ 2007-07-18 15:51 ` Milton Miller
  2007-07-18 16:12   ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Milton Miller @ 2007-07-18 15:51 UTC (permalink / raw)
  To: Ishizaki Kou; +Cc: ppcdev, Paul Mackerras

On Wed Jul 18 19:26:40 EST 2007, Ishizaki Kou wrote:
> In some configuration, xmon help string is larger than xmon_printf
> buffer. We need not to use printf.  This patch adds xmon_puts and
> change to use it to show help string.

[Since I'm requesting changes I'll suggest a new change log.]

In some configurations the xmon help string is larger than the 
xmon_printf buffer.  However, since its a fixed string we do not need 
printf to format it.  This patch adds xmon_puts and uses it to show the 
help string.


>                 case '?':
> -                       printf(help_string);
> +                       xmon_puts(help_string);
>                         break;
>

nonstdio.h #defines printf to xmon_printf.  Please add a similar line 
for puts, and use the define here.  (It will avoid an unnecessary 
difference with the user space version).

Thanks,
milton

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] fix showing xmon help
  2007-07-18 15:51 ` Milton Miller
@ 2007-07-18 16:12   ` Andreas Schwab
  2007-07-19  5:50     ` Milton Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2007-07-18 16:12 UTC (permalink / raw)
  To: Milton Miller; +Cc: ppcdev, Paul Mackerras

Milton Miller <miltonm@bga.com> writes:

>>                 case '?':
>> -                       printf(help_string);
>> +                       xmon_puts(help_string);
>>                         break;
>>
>
> nonstdio.h #defines printf to xmon_printf.  Please add a similar line 
> for puts, and use the define here.  (It will avoid an unnecessary 
> difference with the user space version).

User space puts add a newline, which this xmon_puts doesn't.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] fix showing xmon help
  2007-07-18 16:12   ` Andreas Schwab
@ 2007-07-19  5:50     ` Milton Miller
  2007-07-20  8:15       ` Ishizaki Kou
  0 siblings, 1 reply; 6+ messages in thread
From: Milton Miller @ 2007-07-19  5:50 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: ppcdev, Paul Mackerras


On Jul 18, 2007, at 11:12 AM, Andreas Schwab wrote:

> Milton Miller <miltonm@bga.com> writes:
>
>>>                 case '?':
>>> -                       printf(help_string);
>>> +                       xmon_puts(help_string);
>>>                         break;
>>>
>>
>> nonstdio.h #defines printf to xmon_printf.  Please add a similar line
>> for puts, and use the define here.  (It will avoid an unnecessary
>> difference with the user space version).
>
> User space puts add a newline, which this xmon_puts doesn't.
>
> Andreas.

Good point.  This should be xmon_fputs #defined to fputs.

milton

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] fix showing xmon help
  2007-07-19  5:50     ` Milton Miller
@ 2007-07-20  8:15       ` Ishizaki Kou
  2007-07-23  6:49         ` Milton Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Ishizaki Kou @ 2007-07-20  8:15 UTC (permalink / raw)
  To: miltonm; +Cc: paulus, linuxppc-dev

Milton Miller <miltonm@bga.com> wrote:
> On Jul 18, 2007, at 11:12 AM, Andreas Schwab wrote:
> 
> > Milton Miller <miltonm@bga.com> writes:
> >
> >>>                 case '?':
> >>> -                       printf(help_string);
> >>> +                       xmon_puts(help_string);
> >>>                         break;
> >>>
> >>
> >> nonstdio.h #defines printf to xmon_printf.  Please add a similar
line
> >> for puts, and use the define here.  (It will avoid an unnecessary
> >> difference with the user space version).
> >
> > User space puts add a newline, which this xmon_puts doesn't.
> >
> > Andreas.
> 
> Good point.  This should be xmon_fputs #defined to fputs.
> 
> milton

Should we change like below?

define fputs:
 #define fputs(str,stream)  xmon_fputs(str) /* stream is ignored. */

show the help string:
 fputs(help_string, stdout);

Best regards,
Kou Ishizaki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] fix showing xmon help
  2007-07-20  8:15       ` Ishizaki Kou
@ 2007-07-23  6:49         ` Milton Miller
  0 siblings, 0 replies; 6+ messages in thread
From: Milton Miller @ 2007-07-23  6:49 UTC (permalink / raw)
  To: Ishizaki Kou; +Cc: linuxppc-dev, paulus


On Jul 20, 2007, at 3:15 AM, Ishizaki Kou wrote:

> Milton Miller <miltonm@bga.com> wrote:
>> On Jul 18, 2007, at 11:12 AM, Andreas Schwab wrote:
>>
>>> Milton Miller <miltonm@bga.com> writes:
>>>
>>>>>                 case '?':
>>>>> -                       printf(help_string);
>>>>> +                       xmon_puts(help_string);
>>>>>                         break;
>>>>>
>>>>
>>>> nonstdio.h #defines printf to xmon_printf.  Please add a similar
>>>> line
>>>> for puts, and use the define here.  (It will avoid an unnecessary
>>>> difference with the user space version).
>>>
>>> User space puts add a newline, which this xmon_puts doesn't.
>>>
>>> Andreas.
>>
>> Good point.  This should be xmon_fputs #defined to fputs.
>>
>> milton
>
> Should we change like below?
>
> define fputs:
>  #define fputs(str,stream)  xmon_fputs(str) /* stream is ignored. */
>
> show the help string:
>  fputs(help_string, stdout);
>

Sounds good to me.  It's consistent with using printf.


milton

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-07-23  6:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18  9:26 [PATCH 2/2] fix showing xmon help Ishizaki Kou
2007-07-18 15:51 ` Milton Miller
2007-07-18 16:12   ` Andreas Schwab
2007-07-19  5:50     ` Milton Miller
2007-07-20  8:15       ` Ishizaki Kou
2007-07-23  6:49         ` Milton Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).