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
0f55ea72
Commit
0f55ea72
authored
Jun 10, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pSeries HVC console: Add SYSRQ and handle errors better from Dave Engebretsen
parent
74b9b6e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
arch/ppc64/kernel/pSeries_lpar.c
arch/ppc64/kernel/pSeries_lpar.c
+7
-2
drivers/char/hvc_console.c
drivers/char/hvc_console.c
+16
-1
No files found.
arch/ppc64/kernel/pSeries_lpar.c
View file @
0f55ea72
...
...
@@ -355,8 +355,13 @@ static int udbg_getc_pollLP(void)
/* get some more chars. */
inbuflen
=
0
;
rc
=
plpar_get_term_char
(
vtermno
,
&
inbuflen
,
buf
);
if
(
inbuflen
==
0
&&
rc
==
H_Success
)
return
-
1
;
if
(
rc
!=
H_Success
)
inbuflen
=
0
;
/* otherwise inbuflen is garbage */
}
if
(
inbuflen
<=
0
||
inbuflen
>
16
)
{
/* Catch error case as well as other oddities (corruption) */
inbuflen
=
0
;
return
-
1
;
}
ch
=
buf
[
0
];
for
(
i
=
1
;
i
<
inbuflen
;
i
++
)
/* shuffle them down. */
...
...
drivers/char/hvc_console.c
View file @
0f55ea72
...
...
@@ -22,6 +22,7 @@
#include <linux/console.h>
#include <linux/major.h>
#include <linux/kernel.h>
#include <linux/sysrq.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/sched.h>
...
...
@@ -46,6 +47,9 @@ static struct tty_struct *hvc_table[MAX_NR_HVC_CONSOLES];
static
struct
termios
*
hvc_termios
[
MAX_NR_HVC_CONSOLES
];
static
struct
termios
*
hvc_termios_locked
[
MAX_NR_HVC_CONSOLES
];
static
int
hvc_offset
;
#ifdef CONFIG_MAGIC_SYSRQ
static
int
sysrq_pressed
;
#endif
#define N_OUTBUF 16
...
...
@@ -194,8 +198,19 @@ static void hvc_poll(int index)
n
=
hvc_get_chars
(
index
+
hvc_offset
,
buf
,
sizeof
(
buf
));
if
(
n
<=
0
)
break
;
for
(
i
=
0
;
i
<
n
;
++
i
)
for
(
i
=
0
;
i
<
n
;
++
i
)
{
#ifdef CONFIG_MAGIC_SYSRQ
/* Handle the SysRq Hack */
if
(
buf
[
i
]
==
'\x0f'
)
{
/* ^O -- should support a sequence */
sysrq_pressed
=
1
;
continue
;
}
else
if
(
sysrq_pressed
)
{
handle_sysrq
(
buf
[
i
],
NULL
,
NULL
,
tty
);
sysrq_pressed
=
0
;
continue
;
}
#endif
tty_insert_flip_char
(
tty
,
buf
[
i
],
0
);
}
}
if
(
tty
->
flip
.
count
)
tty_schedule_flip
(
tty
);
...
...
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