coreboot/src
Zheng Bao cf329ffac8 AMD hudson: Round the float pointing number to integer
Try
sh> printf %d 0x005500AA | LC_ALL=C awk '{printf("%c%c%c%c", \
    $1 % 256, $1/256 % 256, $1/65536 % 256, $1/16777216);}' | \
    od -Ax -t x
On Linux with gawk, we get
   000000 005500aa
   000004
On FreeBSD with nongnu-awk, we get
   000000 000055aa
   000002

In awk, all the numbers are floating point number. So division doesn't
round the result from 0.75 (3/4) to 0.
And, There is a fact that, for the FreeBSD awk,
sh> awk 'BEGIN {printf("%c", 0.75)}';
produces nothing, instead of 0.

Here we need to convert the floating point number to
integer by int(X), which is an awk built-in function, instead of GNU
extension.

Change-Id: I3470d5f13e7ea59a978d5575a54c0d56368dc78d
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1529
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-09-24 09:19:26 +02:00
..
arch/x86 buildsystem: Make CPU microcode updating more configurable 2012-09-05 03:40:47 +02:00
boot Implement stack overflow checking for the BSP 2012-07-24 23:29:12 +02:00
console Add a capability for mainboard-specific posting. 2012-08-04 19:31:20 +02:00
cpu C32 legacy code: change CONFIG_CPU_AMD_SOCKET_C32 to CONFIG_CPU_AMD_SOCKET_C32_NON_AGESA 2012-09-19 23:15:27 +02:00
devices AMD northbridges: factor out CPU allocation 2012-08-27 15:36:47 +02:00
drivers ioapic driver: typedef the ioapic_config struct (TRIVIAL) 2012-08-30 04:25:43 +02:00
ec Auto-declare chip_operations 2012-08-22 05:06:41 +02:00
include Fix tracing compilation on SMM enabled targets. 2012-09-13 10:11:44 +02:00
lib USBDEBUG: retry harder for slow devices 2012-07-30 20:54:24 +02:00
mainboard C32 legacy code: change CONFIG_CPU_AMD_SOCKET_C32 to CONFIG_CPU_AMD_SOCKET_C32_NON_AGESA 2012-09-19 23:15:27 +02:00
northbridge agesa fam15 northbridge: change lapic_id to accommodate two CPUs 2012-09-19 23:16:10 +02:00
southbridge AMD hudson: Round the float pointing number to integer 2012-09-24 09:19:26 +02:00
superio superio winbond w83627dhg: add a function which is used on tyan s8226 2012-09-07 20:04:01 +02:00
vendorcode AMD Hudson: Enable HD audio 2012-08-13 18:57:01 +02:00
Kconfig Fix mptable build troubles 2012-08-25 00:34:46 +02:00
Kconfig.deprecated_options Unify ID_SECTION_OFFSET and mark it deprecated 2012-01-18 11:21:39 +01:00