aboutsummaryrefslogtreecommitdiffstats
path: root/src/block.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-10-24 19:56:11 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-10-24 19:56:11 -0400
commitc604f2f6be0ad729c8e25958c946a8535ca391ee (patch)
tree561c46af38c11dbc55685f525202b7a9d0c12e09 /src/block.c
parenta5826b5ad482f44d293387dc7513e5e98802a54e (diff)
downloadseabios-c604f2f6be0ad729c8e25958c946a8535ca391ee.tar.gz
Improve debugging output from threads.
Show the "thread id" on each debug message sent from a thread. Also, cleanup translation dprintf() so it looks nicer withe thread output.
Diffstat (limited to 'src/block.c')
-rw-r--r--src/block.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/block.c b/src/block.c
index a62536ca..0a65ae69 100644
--- a/src/block.c
+++ b/src/block.c
@@ -86,15 +86,15 @@ setup_translation(struct drive_s *drive_g)
u16 cylinders = GET_GLOBAL(drive_g->pchs.cylinders);
u16 spt = GET_GLOBAL(drive_g->pchs.spt);
u64 sectors = GET_GLOBAL(drive_g->sectors);
+ const char *desc;
- dprintf(1, "ata%d-%d: PCHS=%u/%d/%d translation="
- , channel, slave, cylinders, heads, spt);
switch (translation) {
+ default:
case TRANSLATION_NONE:
- dprintf(1, "none");
+ desc = "none";
break;
case TRANSLATION_LBA:
- dprintf(1, "lba");
+ desc = "lba";
spt = 63;
if (sectors > 63*255*1024) {
heads = 255;
@@ -116,7 +116,7 @@ setup_translation(struct drive_s *drive_g)
cylinders = sect / heads;
break;
case TRANSLATION_RECHS:
- dprintf(1, "r-echs");
+ desc = "r-echs";
// Take care not to overflow
if (heads==16) {
if (cylinders>61439)
@@ -127,7 +127,7 @@ setup_translation(struct drive_s *drive_g)
// then go through the large bitshift process
case TRANSLATION_LARGE:
if (translation == TRANSLATION_LARGE)
- dprintf(1, "large");
+ desc = "large";
while (cylinders > 1024) {
cylinders >>= 1;
heads <<= 1;
@@ -141,7 +141,11 @@ setup_translation(struct drive_s *drive_g)
// clip to 1024 cylinders in lchs
if (cylinders > 1024)
cylinders = 1024;
- dprintf(1, " LCHS=%d/%d/%d\n", cylinders, heads, spt);
+ dprintf(1, "ata%d-%d: PCHS=%u/%d/%d translation=%s LCHS=%d/%d/%d\n"
+ , channel, slave
+ , drive_g->pchs.cylinders, drive_g->pchs.heads, drive_g->pchs.spt
+ , desc
+ , cylinders, heads, spt);
SET_GLOBAL(drive_g->lchs.heads, heads);
SET_GLOBAL(drive_g->lchs.cylinders, cylinders);