while others dislike them being extra commits, let's clean them up once and for all for the existing code. If it's ugly, let it only be ugly once :-) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5507 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
		
			
				
	
	
		
			36 lines
		
	
	
		
			611 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			611 B
		
	
	
	
		
			C
		
	
	
	
	
	
void main(void)
 | 
						|
{
 | 
						|
	unsigned long addr, start, stop;
 | 
						|
	start = 0x00100000;
 | 
						|
	stop = 0x00180000;
 | 
						|
 | 
						|
 | 
						|
	for(addr = start; addr < stop ;) {
 | 
						|
		unsigned char ch;
 | 
						|
		const char *str = "\r";
 | 
						|
		while((ch = *str++) != '\0') {
 | 
						|
			while(__builtin_inb(0x3f))
 | 
						|
				;
 | 
						|
			__builtin_outb(ch, 0x3f8);
 | 
						|
 | 
						|
			while(__builtin_inb(0x3f))
 | 
						|
				;
 | 
						|
		}
 | 
						|
		asm (
 | 
						|
			"jmp 2f\n\t"
 | 
						|
			"1:\n\t"
 | 
						|
			"testl  $0xffff, %0\n\t"
 | 
						|
			"jz	3f\n\t"
 | 
						|
			"movnti %0, (%0)\n\t"
 | 
						|
			"add $4, %0\n\t"
 | 
						|
			"2:\n\t"
 | 
						|
			"cmp %2, %0\n\t"
 | 
						|
			"jl 1b\n\t"
 | 
						|
			"3:\n\t"
 | 
						|
			: "=b" (addr)		   /* outputs */
 | 
						|
			: "0" (addr), "r" (stop)   /* intputs */
 | 
						|
			: /* clobbers */
 | 
						|
			);
 | 
						|
	};
 | 
						|
}
 |