Documentation: Fix sphinx configuration
[coreboot.git] / src / console / hw-debug_sink.adb
blobf30b73f4cecb80039db2459c94b6e99a409a6579
1 -- SPDX-License-Identifier: GPL-2.0-only
3 with Interfaces.C;
5 use type Interfaces.C.int;
7 package body HW.Debug_Sink is
9 function console_log_level
10 (msg_level : Interfaces.C.int)
11 return Interfaces.C.int;
12 pragma Import (C, console_log_level, "console_log_level");
14 Msg_Level_BIOS_DEBUG : constant := 7;
16 procedure console_tx_byte (chr : Interfaces.C.char);
17 pragma Import (C, console_tx_byte, "console_tx_byte");
19 procedure Put (Item : String) is
20 begin
21 if console_log_level (Msg_Level_BIOS_DEBUG) /= 0 then
22 for Idx in Item'Range loop
23 console_tx_byte (Interfaces.C.To_C (Item (Idx)));
24 end loop;
25 end if;
26 end Put;
28 procedure Put_Char (Item : Character) is
29 begin
30 if console_log_level (Msg_Level_BIOS_DEBUG) /= 0 then
31 console_tx_byte (Interfaces.C.To_C (Item));
32 end if;
33 end Put_Char;
35 procedure New_Line is
36 begin
37 Put_Char (Character'Val (16#0a#));
38 end New_Line;
40 end HW.Debug_Sink;