device/pci_ids: Add Panther Lake Intel Touch Controller PCI IDs
[coreboot2.git] / src / console / hw-debug_sink.adb
blob6a2889de8f925999f7c2f1638fa455d31c164ed8
1 -- SPDX-License-Identifier: GPL-2.0-only
3 with Interfaces.C;
4 with CB.Config;
6 use CB;
7 use type Interfaces.C.int;
9 package body HW.Debug_Sink is
11 function console_log_level
12 (msg_level : Interfaces.C.int)
13 return Interfaces.C.int;
14 pragma Import (C, console_log_level, "console_log_level");
16 Msg_Level_BIOS_DEBUG : constant := 7;
18 CONSOLE_LOG_FAST : constant := 1;
19 CONSOLE_LOG_ALL : constant := 2;
21 procedure cbmemc_tx_byte (chr : Interfaces.C.char);
22 pragma Import (C, cbmemc_tx_byte, "cbmemc_tx_byte");
24 procedure console_tx_byte (chr : Interfaces.C.char);
25 pragma Import (C, console_tx_byte, "console_tx_byte");
27 procedure Put (Item : String)
29 console_log : constant Interfaces.C.int :=
30 console_log_level (Msg_Level_BIOS_DEBUG);
31 begin
32 if console_log = CONSOLE_LOG_FAST then
33 if Config.CONSOLE_CBMEM then
34 for Idx in Item'Range loop
35 cbmemc_tx_byte (Interfaces.C.To_C (Item (Idx)));
36 end loop;
37 end if;
38 elsif console_log = CONSOLE_LOG_ALL then
39 for Idx in Item'Range loop
40 console_tx_byte (Interfaces.C.To_C (Item (Idx)));
41 end loop;
42 end if;
43 end Put;
45 procedure Put_Char (Item : Character)
47 console_log : constant Interfaces.C.int :=
48 console_log_level (Msg_Level_BIOS_DEBUG);
49 begin
50 if console_log = CONSOLE_LOG_FAST then
51 if Config.CONSOLE_CBMEM then
52 cbmemc_tx_byte (Interfaces.C.To_C (Item));
53 end if;
54 elsif console_log = CONSOLE_LOG_ALL then
55 console_tx_byte (Interfaces.C.To_C (Item));
56 end if;
57 end Put_Char;
59 procedure New_Line is
60 begin
61 Put_Char (Character'Val (16#0a#));
62 end New_Line;
64 end HW.Debug_Sink;