Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
cafe8464
Commit
cafe8464
authored
Aug 11, 2002
by
Pete Zaitcev
Committed by
David S. Miller
Aug 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPARC: Fix prom_printf and prom console behavior.
parent
15c5cc6e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
46 deletions
+57
-46
arch/sparc/kernel/setup.c
arch/sparc/kernel/setup.c
+1
-1
arch/sparc/prom/printf.c
arch/sparc/prom/printf.c
+25
-17
arch/sparc64/kernel/setup.c
arch/sparc64/kernel/setup.c
+1
-1
arch/sparc64/prom/printf.c
arch/sparc64/prom/printf.c
+24
-23
include/asm-sparc/oplib.h
include/asm-sparc/oplib.h
+3
-2
include/asm-sparc64/oplib.h
include/asm-sparc64/oplib.h
+3
-2
No files found.
arch/sparc/kernel/setup.c
View file @
cafe8464
...
...
@@ -130,7 +130,7 @@ void kernel_enter_debugger(void)
static
void
prom_console_write
(
struct
console
*
con
,
const
char
*
s
,
unsigned
n
)
{
prom_
printf
(
"%s"
,
s
);
prom_
write
(
s
,
n
);
}
static
struct
console
prom_debug_console
=
{
...
...
arch/sparc/prom/printf.c
View file @
cafe8464
/*
$Id: printf.c,v 1.7 2000/02/08 20:24:23 davem Exp $
/*
* printf.c: Internal prom library printf facility.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
/* This routine is internal to the prom library, no one else should know
* about or use it! It's simple and smelly anyway....
* Copyright (c) 2002 Pete Zaitcev (zaitcev@yahoo.com)
*
* We used to warn all over the code: DO NOT USE prom_printf(),
* and yet people do. Anton's banking code was outputing banks
* with prom_printf for most of the 2.4 lifetime. Since an effective
* stick is not available, we deployed a carrot: an early printk
* through PROM by means of -p boot option. This ought to fix it.
* USE printk; if you need, deploy -p.
*/
#include <linux/kernel.h>
...
...
@@ -15,24 +19,28 @@
static
char
ppbuf
[
1024
];
void
prom_write
(
const
char
*
buf
,
unsigned
int
n
)
{
char
ch
;
while
(
n
!=
0
)
{
--
n
;
if
((
ch
=
*
buf
++
)
==
'\n'
)
prom_putchar
(
'\r'
);
prom_putchar
(
ch
);
}
}
void
prom_printf
(
char
*
fmt
,
...)
{
va_list
args
;
char
ch
,
*
bptr
;
int
i
;
va_start
(
args
,
fmt
);
i
=
vsprintf
(
ppbuf
,
fmt
,
args
);
bptr
=
ppbuf
;
while
((
ch
=
*
(
bptr
++
))
!=
0
)
{
if
(
ch
==
'\n'
)
prom_putchar
(
'\r'
);
prom_putchar
(
ch
);
}
i
=
vsnprintf
(
ppbuf
,
sizeof
(
ppbuf
),
fmt
,
args
);
va_end
(
args
);
return
;
prom_write
(
ppbuf
,
i
);
}
arch/sparc64/kernel/setup.c
View file @
cafe8464
...
...
@@ -73,7 +73,7 @@ asmlinkage void sys_sync(void); /* it's really int */
static
void
prom_console_write
(
struct
console
*
con
,
const
char
*
s
,
unsigned
n
)
{
prom_
printf
(
"%s"
,
s
);
prom_
write
(
s
,
n
);
}
static
struct
console
prom_console
=
{
...
...
arch/sparc64/prom/printf.c
View file @
cafe8464
/*
$Id: printf.c,v 1.3 1997/03/18 18:00:00 jj Exp $
/*
* printf.c: Internal prom library printf facility.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
*/
/* This routine is internal to the prom library, no one else should know
* about or use it! It's simple and smelly anyway....
* Copyright (c) 2002 Pete Zaitcev (zaitcev@yahoo.com)
*
* We used to warn all over the code: DO NOT USE prom_printf(),
* and yet people do. Anton's banking code was outputing banks
* with prom_printf for most of the 2.4 lifetime. Since an effective
* stick is not available, we deployed a carrot: an early printk
* through PROM by means of -p boot option. This ought to fix it.
* USE printk; if you need, deploy -p.
*/
#include <linux/kernel.h>
...
...
@@ -16,31 +20,28 @@
static
char
ppbuf
[
1024
];
extern
void
prom_puts
(
char
*
,
int
);
void
prom_write
(
const
char
*
buf
,
unsigned
int
n
)
{
char
ch
;
while
(
n
!=
0
)
{
--
n
;
if
((
ch
=
*
buf
++
)
==
'\n'
)
prom_putchar
(
'\r'
);
prom_putchar
(
ch
);
}
}
void
prom_printf
(
char
*
fmt
,
...)
{
va_list
args
;
char
ch
,
*
bptr
,
*
last
;
int
i
;
va_start
(
args
,
fmt
);
i
=
vsprintf
(
ppbuf
,
fmt
,
args
);
bptr
=
ppbuf
;
last
=
ppbuf
;
while
((
ch
=
*
(
bptr
++
))
!=
0
)
{
if
(
ch
==
'\n'
)
{
if
(
last
<
bptr
-
1
)
prom_puts
(
last
,
bptr
-
1
-
last
);
prom_putchar
(
'\r'
);
last
=
bptr
-
1
;
}
}
if
(
last
<
bptr
-
1
)
prom_puts
(
last
,
bptr
-
1
-
last
);
i
=
vsnprintf
(
ppbuf
,
sizeof
(
ppbuf
),
fmt
,
args
);
va_end
(
args
);
return
;
prom_write
(
ppbuf
,
i
);
}
include/asm-sparc/oplib.h
View file @
cafe8464
...
...
@@ -153,8 +153,9 @@ extern char prom_getchar(void);
/* Blocking put character to console. */
extern
void
prom_putchar
(
char
character
);
/* Prom's internal printf routine, don't use in kernel/boot code. */
void
prom_printf
(
char
*
fmt
,
...);
/* Prom's internal routines, don't use in kernel/boot code. */
extern
void
prom_printf
(
char
*
fmt
,
...);
extern
void
prom_write
(
const
char
*
buf
,
unsigned
int
len
);
/* Query for input device type */
...
...
include/asm-sparc64/oplib.h
View file @
cafe8464
...
...
@@ -153,8 +153,9 @@ extern char prom_getchar(void);
/* Blocking put character to console. */
extern
void
prom_putchar
(
char
character
);
/* Prom's internal printf routine, don't use in kernel/boot code. */
void
prom_printf
(
char
*
fmt
,
...);
/* Prom's internal routines, don't use in kernel/boot code. */
extern
void
prom_printf
(
char
*
fmt
,
...);
extern
void
prom_write
(
const
char
*
buf
,
unsigned
int
len
);
/* Query for input device type */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment