File: i386.c

package info (click to toggle)
coreboot 24.12%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 210,640 kB
  • sloc: ansic: 1,640,478; sh: 15,676; python: 10,743; perl: 10,186; asm: 8,483; makefile: 5,097; cpp: 4,724; pascal: 2,327; ada: 1,928; yacc: 1,264; lex: 731; sed: 75; lisp: 5; ruby: 5; awk: 4
file content (47 lines) | stat: -rw-r--r-- 920 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 *
 * Copyright (C) 2018 Google Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <libpayload-config.h>
#include <libpayload.h>
#include "linuxcheck.h"

void buts(char *s)
{
	int i;
	for (i = 0; i < strlen(s); i++)
		outb(s[i], 0x3f8);
}

void hex4(u8 c)
{
	static char *hex = "0123456789abcdef";
	outb(hex[c & 0xf], 0x3f8);
}

void hex8(u8 c)
{
	hex4(c >> 4);
	hex4(c);
}

void hex16(u16 c)
{
	hex8((u8)(c >> 8));
	hex8((u8)c);
}
void hex32(u32 c)
{
	hex16((u16)(c >> 16));
	hex16((u16)c);
}