misc.c (820e8feca06ff744f60e5036c3178dde40b91afc) | misc.c (04999550f93234bf05597a9b7d26e2bfe27ba883) |
---|---|
1/* 2 * misc.c 3 * 4 * This is a collection of several routines from gzip-1.0.3 5 * adapted for Linux. 6 * 7 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 8 * puts by Nick Holloway 1993, better puts by Martin Mares 1995 --- 84 unchanged lines hidden (view full) --- 93 * 94 */ 95 96/* 97 * gzip declarations 98 */ 99#define STATIC static 100 | 1/* 2 * misc.c 3 * 4 * This is a collection of several routines from gzip-1.0.3 5 * adapted for Linux. 6 * 7 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 8 * puts by Nick Holloway 1993, better puts by Martin Mares 1995 --- 84 unchanged lines hidden (view full) --- 93 * 94 */ 95 96/* 97 * gzip declarations 98 */ 99#define STATIC static 100 |
101#undef memset | |
102#undef memcpy | 101#undef memcpy |
102 103/* 104 * Use a normal definition of memset() from string.c. There are already 105 * included header files which expect a definition of memset() and by 106 * the time we define memset macro, it is too late. 107 */ 108#undef memset |
|
103#define memzero(s, n) memset((s), 0, (n)) 104 105 106static void error(char *m); 107 108/* 109 * This is set up by the setup-routine at boot-time 110 */ 111struct boot_params *real_mode; /* Pointer to real-mode data */ 112 | 109#define memzero(s, n) memset((s), 0, (n)) 110 111 112static void error(char *m); 113 114/* 115 * This is set up by the setup-routine at boot-time 116 */ 117struct boot_params *real_mode; /* Pointer to real-mode data */ 118 |
113void *memset(void *s, int c, size_t n); 114 | |
115memptr free_mem_ptr; 116memptr free_mem_end_ptr; 117 118static char *vidmem; 119static int vidport; 120static int lines, cols; 121 122#ifdef CONFIG_KERNEL_GZIP --- 88 unchanged lines hidden (view full) --- 211 212 pos = (x + cols * y) * 2; /* Update cursor position */ 213 outb(14, vidport); 214 outb(0xff & (pos >> 9), vidport+1); 215 outb(15, vidport); 216 outb(0xff & (pos >> 1), vidport+1); 217} 218 | 119memptr free_mem_ptr; 120memptr free_mem_end_ptr; 121 122static char *vidmem; 123static int vidport; 124static int lines, cols; 125 126#ifdef CONFIG_KERNEL_GZIP --- 88 unchanged lines hidden (view full) --- 215 216 pos = (x + cols * y) * 2; /* Update cursor position */ 217 outb(14, vidport); 218 outb(0xff & (pos >> 9), vidport+1); 219 outb(15, vidport); 220 outb(0xff & (pos >> 1), vidport+1); 221} 222 |
219void *memset(void *s, int c, size_t n) 220{ 221 int i; 222 char *ss = s; 223 224 for (i = 0; i < n; i++) 225 ss[i] = c; 226 return s; 227} 228 | |
229static void error(char *x) 230{ 231 error_putstr("\n\n"); 232 error_putstr(x); 233 error_putstr("\n\n -- System halted"); 234 235 while (1) 236 asm("hlt"); --- 178 unchanged lines hidden --- | 223static void error(char *x) 224{ 225 error_putstr("\n\n"); 226 error_putstr(x); 227 error_putstr("\n\n -- System halted"); 228 229 while (1) 230 asm("hlt"); --- 178 unchanged lines hidden --- |