aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/xmon
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2012-10-09 00:20:32 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-14 20:59:46 -0500
commit33b5cd686649f56d40fa258a0881f6acdbd70134 (patch)
tree135a390386192ec1e6f49c88c86c4de83b85c5fd /arch/powerpc/xmon
parent88c6d62641514686e0b1b0e33d9faf1e39ec7e58 (diff)
powerpc/xmon: Merge start.c into nonstdio.c
The routines in start.c are only ever called from nonstdio.c, so if we move them in there they can become static which is nice. I suspect the idea behind the separation was that start.c could be replaced in order to build xmon in userland. If anyone still cares about doing that we could handle that with an ifdef or two. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/xmon')
-rw-r--r--arch/powerpc/xmon/Makefile2
-rw-r--r--arch/powerpc/xmon/nonstdio.c14
-rw-r--r--arch/powerpc/xmon/nonstdio.h2
-rw-r--r--arch/powerpc/xmon/start.c23
4 files changed, 15 insertions, 26 deletions
diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile
index c168c54e3c40..b49fdbd15808 100644
--- a/arch/powerpc/xmon/Makefile
+++ b/arch/powerpc/xmon/Makefile
@@ -6,7 +6,7 @@ GCOV_PROFILE := n
6 6
7ccflags-$(CONFIG_PPC64) := -mno-minimal-toc 7ccflags-$(CONFIG_PPC64) := -mno-minimal-toc
8 8
9obj-y += xmon.o start.o nonstdio.o 9obj-y += xmon.o nonstdio.o
10 10
11ifdef CONFIG_XMON_DISASSEMBLY 11ifdef CONFIG_XMON_DISASSEMBLY
12obj-y += ppc-dis.o ppc-opc.o 12obj-y += ppc-dis.o ppc-opc.o
diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c
index 2209485e6564..942d0f6b1874 100644
--- a/arch/powerpc/xmon/nonstdio.c
+++ b/arch/powerpc/xmon/nonstdio.c
@@ -7,9 +7,23 @@
7 * 2 of the License, or (at your option) any later version. 7 * 2 of the License, or (at your option) any later version.
8 */ 8 */
9#include <linux/string.h> 9#include <linux/string.h>
10#include <asm/udbg.h>
10#include <asm/time.h> 11#include <asm/time.h>
11#include "nonstdio.h" 12#include "nonstdio.h"
12 13
14
15static int xmon_write(const void *ptr, int nb)
16{
17 return udbg_write(ptr, nb);
18}
19
20static int xmon_readchar(void)
21{
22 if (udbg_getc)
23 return udbg_getc();
24 return -1;
25}
26
13int xmon_putchar(int c) 27int xmon_putchar(int c)
14{ 28{
15 char ch = c; 29 char ch = c;
diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h
index 321284f4281d..18a51ded4ffd 100644
--- a/arch/powerpc/xmon/nonstdio.h
+++ b/arch/powerpc/xmon/nonstdio.h
@@ -7,5 +7,3 @@ extern int xmon_putchar(int c);
7extern void xmon_puts(const char *); 7extern void xmon_puts(const char *);
8extern char *xmon_gets(char *, int); 8extern char *xmon_gets(char *, int);
9extern void xmon_printf(const char *, ...); 9extern void xmon_printf(const char *, ...);
10extern int xmon_write(const void *ptr, int nb);
11extern int xmon_readchar(void);
diff --git a/arch/powerpc/xmon/start.c b/arch/powerpc/xmon/start.c
deleted file mode 100644
index 7769cb5e2090..000000000000
--- a/arch/powerpc/xmon/start.c
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <asm/machdep.h>
10#include <asm/udbg.h>
11#include "nonstdio.h"
12
13int xmon_write(const void *ptr, int nb)
14{
15 return udbg_write(ptr, nb);
16}
17
18int xmon_readchar(void)
19{
20 if (udbg_getc)
21 return udbg_getc();
22 return -1;
23}