Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / util / romcc / tests / simple_test32.c
1 void main(void)
2 {
3         unsigned long addr, start, stop;
4         start = 0x00100000;
5         stop = 0x00180000;
6
7
8         for(addr = start; addr < stop ;) {
9                 unsigned char ch;
10                 const char *str = "\r";
11                 while((ch = *str++) != '\0') {
12                         while(__builtin_inb(0x3f))
13                                 ;
14                         __builtin_outb(ch, 0x3f8);
15
16                         while(__builtin_inb(0x3f))
17                                 ;
18                 }
19                 asm (
20                         "jmp 2f\n\t"
21                         "1:\n\t"
22                         "testl  $0xffff, %0\n\t"
23                         "jz     3f\n\t"
24                         "movnti %0, (%0)\n\t"
25                         "add $4, %0\n\t"
26                         "2:\n\t"
27                         "cmp %2, %0\n\t"
28                         "jl 1b\n\t"
29                         "3:\n\t"
30                         : "=b" (addr)              /* outputs */
31                         : "0" (addr), "r" (stop)   /* intputs */
32                         : /* clobbers */
33                         );
34         };
35 }