Blame view

kernel/linux-rt-4.4.41/arch/mips/boot/compressed/dbg.c 648 Bytes
5113f6f70   김현기   kernel add
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
  /*
   * MIPS-specific debug support for pre-boot environment
   *
   * NOTE: putc() is board specific, if your board have a 16550 compatible uart,
   * please select SYS_SUPPORTS_ZBOOT_UART16550 for your machine. othewise, you
   * need to implement your own putc().
   */
  #include <linux/compiler.h>
  #include <linux/types.h>
  
  void __weak putc(char c)
  {
  }
  
  void puts(const char *s)
  {
  	char c;
  	while ((c = *s++) != '\0') {
  		putc(c);
  		if (c == '
  ')
  			putc('\r');
  	}
  }
  
  void puthex(unsigned long long val)
  {
  
  	unsigned char buf[10];
  	int i;
  	for (i = 7; i >= 0; i--) {
  		buf[i] = "0123456789ABCDEF"[val & 0x0F];
  		val >>= 4;
  	}
  	buf[8] = '\0';
  	puts(buf);
  }