Jérémy Compostella has uploaded this change for review. ( https://review.coreboot.org/c/libhwbase/+/69854 )
Change subject: hw-debug: Ensure global variable default are zeros and in .bss ......................................................................
hw-debug: Ensure global variable default are zeros and in .bss
Having global variables prevents the inclusion of the library in coreboot romstage.
Signed-off-by: Jeremy Compostella jeremy.compostella@intel.com Change-Id: Ib23699f3f3446219c34c60ccd9987346e17769f2 --- M debug/hw-debug.adb 1 file changed, 20 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/libhwbase refs/changes/54/69854/1
diff --git a/debug/hw-debug.adb b/debug/hw-debug.adb index e28eb17..d116860 100644 --- a/debug/hw-debug.adb +++ b/debug/hw-debug.adb @@ -23,8 +23,10 @@ SPARK_Mode => Off is
- Start_Of_Line : Boolean := True; - Register_Write_Delay_Nanoseconds : Word64 := 0; + Not_Start_Of_Line : Boolean; + pragma Linker_Section (Not_Start_Of_Line, ".bss"); + Register_Write_Delay_Nanoseconds : Word64; + pragma Linker_Section (Register_Write_Delay_Nanoseconds, ".bss");
type Base_Range is new Positive range 2 .. 16; type Width_Range is new Natural range 0 .. 64; @@ -43,8 +45,8 @@ is Now_US : Int64; begin - if Start_Of_Line then - Start_Of_Line := False; + if not Not_Start_Of_Line then + Not_Start_Of_Line := True; Now_US := Time.Now_US; Debug_Sink.Put_Char ('['); Do_Put_Int64 ((Now_US / 1_000_000) mod 1_000_000); @@ -71,7 +73,7 @@ procedure New_Line is begin HW.Debug_Sink.New_Line; - Start_Of_Line := True; + Not_Start_Of_Line := False; end New_Line;
----------------------------------------------------------------------------