google/gru: change kevin boot-time center logic voltage to 925mV
[coreboot.git] / src / console / hw-debug_sink.adb
blob5a165562dc91f5902dd565e5d97542fa4d448fcc
1 --
2 -- This file is part of the coreboot project.
3 --
4 -- Copyright (C) 2015 secunet Security Networks AG
5 --
6 -- This program is free software; you can redistribute it and/or modify
7 -- it under the terms of the GNU General Public License as published by
8 -- the Free Software Foundation; version 2 of the License.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
16 with Interfaces.C;
18 use type Interfaces.C.int;
20 package body HW.Debug_Sink is
22 Sink_Enabled : Boolean;
24 procedure console_tx_byte (chr : Interfaces.C.char);
25 pragma Import (C, console_tx_byte, "console_tx_byte");
27 procedure Put (Item : String) is
28 begin
29 if Sink_Enabled then
30 for Idx in Item'Range loop
31 console_tx_byte (Interfaces.C.To_C (Item (Idx)));
32 end loop;
33 end if;
34 end Put;
36 procedure Put_Char (Item : Character) is
37 begin
38 if Sink_Enabled then
39 console_tx_byte (Interfaces.C.To_C (Item));
40 end if;
41 end Put_Char;
43 procedure New_Line is
44 begin
45 Put_Char (Character'Val (16#0a#));
46 end New_Line;
48 ----------------------------------------------------------------------------
50 function console_log_level
51 (msg_level : Interfaces.C.int)
52 return Interfaces.C.int;
53 pragma Import (C, console_log_level, "console_log_level");
55 Msg_Level_BIOS_DEBUG : constant := 7;
57 begin
58 Sink_Enabled := console_log_level (Msg_Level_BIOS_DEBUG) /= 0;
59 end HW.Debug_Sink;