[U-Boot-Users] IDE LBA48 support and vsprintf 64bit support

VanBaren, Gerald (AGRE) Gerald.VanBaren at smiths-aerospace.com
Fri Feb 27 18:14:16 CET 2004



> -----Original Message-----
> From: u-boot-users-admin at lists.sourceforge.net
> [mailto:u-boot-users-admin at lists.sourceforge.net]On Behalf Of Rune
> Torgersen
> Sent: Friday, February 27, 2004 11:57 AM
> To: wd at denx.de
> Cc: u-boot-users at lists.sourceforge.net
> Subject: RE: [U-Boot-Users] IDE LBA48 support and vsprintf
> 64bit support
>
>
>
> > Ummm... actually I don't like to increase the  memory 
> > footprint  for all  systems for a feature which nearly nobody
> > ever needs. I think it should be possible to print the large
> > capacities without  using  such data formats (I guess you
> > don't need 64 bit precision).
>
> I guess I can add some #ifdefs around my code (especially the 64bit
> printing stuff)
> Hex isn't a problem, and decimal is not a problem as long as
> the disk is
> less than 548GB
>
> For the IDE stuff itself, without 64 bit the IDE can handle
> drives up to
> 548GB (max sector numbers possible in 32 bit). What if I have a config
> option to use 64-bit sector numbers, and default to using 32-bit?
>
> (I needed this since our board does have a 250GB disk attached, and I
> wanted to see the real capacity when booting)

For disks, you can scale the value by 1e9 and then print in decimal.  I'm pretty sure this is what you would be doing anyway, no?

The 64 bit format:
  printf("Disk size %Ld\n", size);
becomes:
  printf("Disk size %dGB\n", (unsigned int)(size / (1000000000)));
or:
  printf("Disk size %dMB\n", (unsigned int)(size / (1000000)));

(I'm intentionally scaling disk drive GBs/MBs, not computer geek GBs/MBs)

Am I missing something?  How many 64 bit numbers are you trying to print?  If it is just a couple in unique circumstances, scale & print.

gvb


******************************************
The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege.  If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager.  Please do not copy it for any purpose, or disclose its contents to any other person.  The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.  The recipient should check this e-mail and any attachments for the presence of viruses.  The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
******************************************




More information about the U-Boot mailing list