mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
* doc/kernel.c (cmain): Use padding to properly display 64-bit
quantities. (printf): Add padding support. Reported by: Soeren D. Schulze.
This commit is contained in:
1 parent
1f40c472d8
commit
432c7554bf
2 files changed
+26
-3
No files matched your search
@@ -1,3 +1,10 @@
|
|||||||
|
2010-03-14 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* doc/kernel.c (cmain): Use padding to properly display 64-bit
|
||||||
|
quantities.
|
||||||
|
(printf): Add padding support.
|
||||||
|
Reported by: Soeren D. Schulze.
|
||||||
|
|
||||||
2010-02-09 Vladimir Serbinenko <phcoder@gmail.com>
|
2010-02-09 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* doc/multiboot.texi: Fix a typo.
|
* doc/multiboot.texi: Fix a typo.
|
||||||
|
|||||||
+19
-3
@@ -141,8 +141,8 @@ cmain (unsigned long magic, unsigned long addr)
|
|||||||
(unsigned long) mmap < mbi->mmap_addr + mbi->mmap_length;
|
(unsigned long) mmap < mbi->mmap_addr + mbi->mmap_length;
|
||||||
mmap = (multiboot_memory_map_t *) ((unsigned long) mmap
|
mmap = (multiboot_memory_map_t *) ((unsigned long) mmap
|
||||||
+ mmap->size + sizeof (mmap->size)))
|
+ mmap->size + sizeof (mmap->size)))
|
||||||
printf (" size = 0x%x, base_addr = 0x%x%x,"
|
printf (" size = 0x%x, base_addr = 0x%x%08x,"
|
||||||
" length = 0x%x%x, type = 0x%x\n",
|
" length = 0x%x%08x, type = 0x%x\n",
|
||||||
(unsigned) mmap->size,
|
(unsigned) mmap->size,
|
||||||
(unsigned) (mmap->addr >> 32),
|
(unsigned) (mmap->addr >> 32),
|
||||||
(unsigned) (mmap->addr & 0xffffffff),
|
(unsigned) (mmap->addr & 0xffffffff),
|
||||||
@@ -337,9 +337,22 @@ printf (const char *format, ...)
|
|||||||
putchar (c);
|
putchar (c);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *p;
|
char *p, *p2;
|
||||||
|
int pad0 = 0, pad = 0;
|
||||||
|
|
||||||
c = *format++;
|
c = *format++;
|
||||||
|
if (c == '0')
|
||||||
|
{
|
||||||
|
pad0 = 1;
|
||||||
|
c = *format++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c >= '0' && c <= '9')
|
||||||
|
{
|
||||||
|
pad = c - '0';
|
||||||
|
c = *format++;
|
||||||
|
}
|
||||||
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case 'd':
|
case 'd':
|
||||||
@@ -356,6 +369,9 @@ printf (const char *format, ...)
|
|||||||
p = "(null)";
|
p = "(null)";
|
||||||
|
|
||||||
string:
|
string:
|
||||||
|
for (p2 = p; *p2; p2++);
|
||||||
|
for (; p2 < p + pad; p2++)
|
||||||
|
putchar (pad0 ? '0' : ' ');
|
||||||
while (*p)
|
while (*p)
|
||||||
putchar (*p++);
|
putchar (*p++);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user