10 alloc loc0=ar.pfs,1,2,3,0 /* in, local, out, rotating */
12 mov r14=ip /* Get the address of _start, I'm in the first bundle */
13 movl r15=@gprel(_start)
15 sub gp=r14,r15 /* gp = _start - @gprel(_start), current value of gp */
19 add out2=@gprel(params),gp
20 br.call.sptk.few rp=convert_params
24 add r15=@gprel(entry), gp
34 .size _start, . - _start
41 #define UART_BASE 0x00000000f8030000
42 #define UART_BAUD 9600
61 #define UART_PHYS_BASE (0x8000000000000000|UART_BASE)
62 #define UART_DIV (115200/UART_BAUD)
63 #define UART_DIV_LO (UART_DIV&0xFF)
64 #define UART_DIV_HI ((UART_DIV >> 8)&0xFF)
66 #if ((115200%UART_BAUD) != 0)
67 #error Bad uart baud rate
70 /* NOTE: As these are debugging functions, they do not consume any
71 * space on the register stack, and instead rely entirely on
72 * scratch registers for the registers they use.
75 /* set the UART_BASE */
76 movl r31=UART_PHYS_BASE
79 /* disable interrupts */
91 /* Set Baud Rate Divisor to UART_BAUD */
117 /* set the UART_PHYS_BASE */
118 movl r31=UART_PHYS_BASE
121 /* Wait until the UART can hold another byte */
124 9: ld1.acq.nta r29=[r30]
129 (p63) br.cond.sptk.few 9b
131 /* Transmit the byte */
134 st1.rel.nta [r30]=r32
137 /* Wait until the UART is empty to be certain the byte is flushed */
140 9: ld1.acq.nta r29=[r30]
145 (p63) br.cond.sptk.few 9b
151 cmp.ltu p62,p63=9,r32
153 (p63) add r32=48,r32 /* digits*/
154 (p62) add r32=55,r32 /* letters */
155 br.cond.sptk.few __uart_tx_byte
158 /* set the UART_bASE */
159 movl r31=UART_PHYS_BASE
166 br.call.sptk.few rp=__uart_tx_hex_char
169 br.call.sptk.few rp=__uart_tx_hex_char
172 br.call.sptk.few rp=__uart_tx_hex_char
175 br.call.sptk.few rp=__uart_tx_hex_char
178 br.call.sptk.few rp=__uart_tx_hex_char
181 br.call.sptk.few rp=__uart_tx_hex_char
184 br.call.sptk.few rp=__uart_tx_hex_char
187 br.call.sptk.few rp=__uart_tx_hex_char
190 br.call.sptk.few rp=__uart_tx_hex_char
193 br.call.sptk.few rp=__uart_tx_hex_char
196 br.call.sptk.few rp=__uart_tx_hex_char
199 br.call.sptk.few rp=__uart_tx_hex_char
202 br.call.sptk.few rp=__uart_tx_hex_char
205 br.call.sptk.few rp=__uart_tx_hex_char
208 br.call.sptk.few rp=__uart_tx_hex_char
211 br.call.sptk.few rp=__uart_tx_hex_char
219 .section ".trailer", "a"
220 /* Constants set at build time, these are at the very end of my image */
233 .asciz "BOOT_IMAGE=head.S console=ttyS0 ip=dhcp root=/dev/nfs"
234 .org cmdline + 1024, 0