Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libtcg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton
libtcg
Commits
c86d2c23
Commit
c86d2c23
authored
14 years ago
by
Blue Swirl
Browse files
Options
Downloads
Patches
Plain Diff
pckbd: improve debugging
Signed-off-by:
Blue Swirl
<
blauwirbel@gmail.com
>
parent
956a3e6b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hw/pckbd.c
+15
-13
15 additions, 13 deletions
hw/pckbd.c
with
15 additions
and
13 deletions
hw/pckbd.c
+
15
−
13
View file @
c86d2c23
...
...
@@ -29,6 +29,12 @@
/* debug PC keyboard */
//#define DEBUG_KBD
#ifdef DEBUG_KBD
#define DPRINTF(fmt, ...) \
do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0)
#else
#define DPRINTF(fmt, ...)
#endif
/* Keyboard Controller Commands */
#define KBD_CCMD_READ_MODE 0x20
/* Read mode bits */
...
...
@@ -191,9 +197,7 @@ static uint32_t kbd_read_status(void *opaque, uint32_t addr)
KBDState
*
s
=
opaque
;
int
val
;
val
=
s
->
status
;
#if defined(DEBUG_KBD)
printf
(
"kbd: read status=0x%02x
\n
"
,
val
);
#endif
DPRINTF
(
"kbd: read status=0x%02x
\n
"
,
val
);
return
val
;
}
...
...
@@ -209,6 +213,7 @@ static void ioport92_write(void *opaque, uint32_t addr, uint32_t val)
{
KBDState
*
s
=
opaque
;
DPRINTF
(
"kbd: write outport=0x%02x
\n
"
,
val
);
s
->
outport
=
val
;
if
(
s
->
a20_out
)
{
qemu_set_irq
(
*
s
->
a20_out
,
(
val
>>
1
)
&
1
);
...
...
@@ -221,17 +226,18 @@ static void ioport92_write(void *opaque, uint32_t addr, uint32_t val)
static
uint32_t
ioport92_read
(
void
*
opaque
,
uint32_t
addr
)
{
KBDState
*
s
=
opaque
;
uint32_t
ret
;
return
s
->
outport
;
ret
=
s
->
outport
;
DPRINTF
(
"kbd: read outport=0x%02x
\n
"
,
ret
);
return
ret
;
}
static
void
kbd_write_command
(
void
*
opaque
,
uint32_t
addr
,
uint32_t
val
)
{
KBDState
*
s
=
opaque
;
#ifdef DEBUG_KBD
printf
(
"kbd: write cmd=0x%02x
\n
"
,
val
);
#endif
DPRINTF
(
"kbd: write cmd=0x%02x
\n
"
,
val
);
switch
(
val
)
{
case
KBD_CCMD_READ_MODE
:
kbd_queue
(
s
,
s
->
mode
,
0
);
...
...
@@ -307,9 +313,7 @@ static uint32_t kbd_read_data(void *opaque, uint32_t addr)
else
val
=
ps2_read_data
(
s
->
kbd
);
#if defined(DEBUG_KBD)
printf
(
"kbd: read data=0x%02x
\n
"
,
val
);
#endif
DPRINTF
(
"kbd: read data=0x%02x
\n
"
,
val
);
return
val
;
}
...
...
@@ -317,9 +321,7 @@ static void kbd_write_data(void *opaque, uint32_t addr, uint32_t val)
{
KBDState
*
s
=
opaque
;
#ifdef DEBUG_KBD
printf
(
"kbd: write data=0x%02x
\n
"
,
val
);
#endif
DPRINTF
(
"kbd: write data=0x%02x
\n
"
,
val
);
switch
(
s
->
write_cmd
)
{
case
0
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment