2 * (c) 2008-2009 Technische Universität Dresden
3 * This file is part of TUD:OS and distributed under the terms of the
4 * GNU Lesser General Public License 2.1.
5 * Please see the COPYING-LGPL-2.1 file for details.
7 #include <l4/util/spin.h>
9 static void spin_gen(void*addr,int x,int y){
14 c=(c=='|')?'/':(c=='/')?'-':(c=='-')?'\\':(c=='\\')?'|':'-';
18 /****************************************************************************
20 * l4_spin() - spinning wheel at the hercules screen, position is from *
21 * upper left. Each call turns the wheel. *
22 * l4_spin_vga() - the same for vga. *
24 ****************************************************************************/
25 void l4_spin(int x,int y){
26 spin_gen((void*)0xb0000, x, y);
28 void l4_spin_vga(int x, int y){
29 spin_gen((void*)0xb8000, x, y);
32 static void spin_n_text_gen(void*addr, int x,int y, int len, const char*s){
36 p=addr+(x+len+80*y)*2;
38 c=(c=='|')?'/':(c=='/')?'-':(c=='-')?'\\':(c=='\\')?'|':'.';
51 /****************************************************************************
53 * l4_spin_n_text() - like spin(), but prints a text before the wheel. *
54 * You must specify the length of the text (without *
55 * the 0 at the end). The text is printed if no *
56 * wheel-element is found at the wheel position. *
57 * See macro l4_spin_text() for constant text. *
58 * l4_spin_n_text_vga() - same for vga. *
60 ****************************************************************************/
61 void l4_spin_n_text(int x,int y, int len, const char*s){
62 spin_n_text_gen((void*)0xb0000, x, y, len, s);
64 void l4_spin_n_text_vga(int x,int y, int len, const char*s){
65 spin_n_text_gen((void*)0xb8000, x, y, len, s);