From 2112ef360ae7a7b85b9ae4a0cff131de69bcd888 Mon Sep 17 00:00:00 2001 From: Jean-Yves Lamoureux Date: Sun, 20 Dec 2009 15:41:41 +0000 Subject: [PATCH] * Added 64bits RDTSC support, as well as CPU frequency guess (more like a 8254a test, actually) --- build-kernel | 8 +- kernel/drivers/processor.c | 49 +++++ kernel/drivers/processor.h | 2 + kernel/drivers/timer.c | 55 +++-- kernel/kernel.c | 22 +- kernel/kernel.h | 2 + kernel/klibc.c | 430 ++++++++++++++++++++----------------- kernel/klibc.h | 3 +- 8 files changed, 336 insertions(+), 235 deletions(-) diff --git a/build-kernel b/build-kernel index efa5963..c716abb 100755 --- a/build-kernel +++ b/build-kernel @@ -9,10 +9,10 @@ set -e CFLAGS="-fno-builtin -O0 -I. -I.. -I../caca/ -Wall -D__KERNEL__ -fno-stack-protector -m32" LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000" -./configure --disable-slang --disable-ncurses --disable-win32 \ - --disable-conio --disable-x11 --disable-gl --disable-network \ - --enable-vga --disable-imlib2 --disable-doc \ - --host i386 +#./configure --disable-slang --disable-ncurses --disable-win32 \ +# --disable-conio --disable-x11 --disable-gl --disable-network \ +# --enable-vga --disable-imlib2 --disable-doc \ +# --host i386 # Compile cacademo, leave it as an object cd caca && make && cd .. diff --git a/kernel/drivers/processor.c b/kernel/drivers/processor.c index ce08165..a020356 100644 --- a/kernel/drivers/processor.c +++ b/kernel/drivers/processor.c @@ -16,6 +16,7 @@ #include "kernel.h" #include "klibc.h" +#include "drivers/timer.h" #include "processor.h" @@ -49,12 +50,60 @@ int processor_get_info(struct processor_info *processor_info) asm volatile ("cpuid":"=a" (a), "=d"(d):"0"(code):"ecx", "ebx"); processor_info->features = a; + processor_info->frequency = 0; + processor_info->frequency = processor_get_frequency(processor_info); + return 0; } +u32 processor_get_frequency(struct processor_info * processor_info) +{ + if (processor_info->frequency) + return processor_info->frequency; + u64 srdtsc64, erdtsc64; + u32 srdtsc_l, srdtsc_h; + u32 erdtsc_l, erdtsc_h; + + rdtsc(srdtsc_l, srdtsc_h); /* Get RDTSC */ + sleep(2); /* Sleep for 2 seconds */ + rdtsc(erdtsc_l, erdtsc_h); /* Get RDTSC again */ + + srdtsc64 = srdtsc_h; + srdtsc64 <<= 32; + srdtsc64 |= srdtsc_l; + erdtsc64 = erdtsc_h; + erdtsc64 <<= 32; + erdtsc64 |= erdtsc_l; + + + u32 diff = erdtsc64 - srdtsc64; /* Cycle count for 2 seconds */ + diff /= 2; /* Divide by 2 to get cycles per sec */ + return diff; +} + void processor_print_info(struct processor_info *processor_info) { printf("CPU%d\n", processor_info->id); printf("Vendor ID : %s\n", processor_info->vendor); + if (processor_info->frequency > 1000000000) + { + printf("Frequency : ~%dGhz (or something like that)\n", + processor_info->frequency / 1000000000); + } + else if (processor_info->frequency > 1000000) + { + printf("Frequency : ~%dMhz (or something like that)\n", + processor_info->frequency / 1000000); + } + else if (processor_info->frequency > 1000) + { + printf("Frequency : ~%dKhz (or something like that)\n", + processor_info->frequency / 1000); + } + else + { + printf("Frequency : ~%dhz (you must be running Bochs)\n", + processor_info->frequency); + } printf("Features : 0x%x\n", processor_info->features); } diff --git a/kernel/drivers/processor.h b/kernel/drivers/processor.h index c36e97b..0e3c4d0 100644 --- a/kernel/drivers/processor.h +++ b/kernel/drivers/processor.h @@ -92,8 +92,10 @@ struct processor_info int id; char vendor[13]; unsigned int features; + u32 frequency; }; int processor_get_info(struct processor_info *processor_info); +u32 processor_get_frequency(struct processor_info *processor_info); void processor_print_info(struct processor_info *processor_info); diff --git a/kernel/drivers/timer.c b/kernel/drivers/timer.c index 7c0bf44..9157882 100644 --- a/kernel/drivers/timer.c +++ b/kernel/drivers/timer.c @@ -1,4 +1,4 @@ -/* +/* * libcaca * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar @@ -22,27 +22,36 @@ u32 ticks = 0; void timer_phase(int hz) { - unsigned int divisor = 1193180 / hz; /* Calculate our divisor */ - /* - 0x43 is the Mode/Command register - - From - http://wiki.osdev.org/Programmable_Interval_Timer#Read_Back_Status_Byte - : Bits Usage 6 and 7 Select channel : 0 0 = Channel 0 0 1 = Channel 1 - 1 0 = Channel 2 1 1 = Read-back command (8254 only) 4 and 5 Access mode - : 0 0 = Latch count value command 0 1 = Access mode: lobyte only 1 0 = - Access mode: hibyte only 1 1 = Access mode: lobyte/hibyte 1 to 3 - Operating mode : 0 0 0 = Mode 0 (interrupt on terminal count) 0 0 1 = - Mode 1 (hardware re-triggerable one-shot) 0 1 0 = Mode 2 (rate - generator) 0 1 1 = Mode 3 (square wave generator) 1 0 0 = Mode 4 - (software triggered strobe) 1 0 1 = Mode 5 (hardware triggered strobe) - 1 1 0 = Mode 2 (rate generator, same as 010b) 1 1 1 = Mode 3 (square - wave generator, same as 011b) 0 BCD/Binary mode: 0 = 16-bit binary, 1 = - four-digit BCD - + unsigned int divisor = 1193180 / hz; /* Calculate our divisor */ + /* + 0x43 is the Mode/Command register + + From http://wiki.osdev.org/Programmable_Interval_Timer#Read_Back_Status_Byte : + Bits Usage + 6 and 7 Select channel : + 0 0 = Channel 0 + 0 1 = Channel 1 + 1 0 = Channel 2 + 1 1 = Read-back command (8254 only) + 4 and 5 Access mode : + 0 0 = Latch count value command + 0 1 = Access mode: lobyte only + 1 0 = Access mode: hibyte only + 1 1 = Access mode: lobyte/hibyte + 1 to 3 Operating mode : + 0 0 0 = Mode 0 (interrupt on terminal count) + 0 0 1 = Mode 1 (hardware re-triggerable one-shot) + 0 1 0 = Mode 2 (rate generator) + 0 1 1 = Mode 3 (square wave generator) + 1 0 0 = Mode 4 (software triggered strobe) + 1 0 1 = Mode 5 (hardware triggered strobe) + 1 1 0 = Mode 2 (rate generator, same as 010b) + 1 1 1 = Mode 3 (square wave generator, same as 011b) + 0 BCD/Binary mode: 0 = 16-bit binary, 1 = four-digit BCD + */ - unsigned short command = 0 b00110110; + unsigned short command = 0b00110110; outb(0x43, command); - outb(0x40, divisor & 0xFF); /* Set low byte of divisor */ - outb(0x40, divisor >> 8); /* Set high byte of divisor */ -} + outb(0x40, divisor & 0xFF); /* Set low byte of divisor */ + outb(0x40, divisor >> 8); /* Set high byte of divisor */ +} \ No newline at end of file diff --git a/kernel/kernel.c b/kernel/kernel.c index acbcc7e..52df1e6 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -36,6 +36,13 @@ int kmain(void) printf("_start at 0x%x\n", _start); printf("kmain() at 0x%x\n", kmain); + printf("Types : char[%d] int[%d] long[%d] unsigned long long[%d]\n", sizeof(char), sizeof(int), sizeof(long), sizeof(unsigned long long)); + + enable_interrupt(1); // Enable Keyboard Interrupt (IRQ1) + enable_interrupt(0); // Enable IRQ0 (timer) + enable_interrupt(13); + timer_phase(100); // Fire IRQ0 each 1/100s + processor_get_info(&processor_info); processor_print_info(&processor_info); @@ -43,21 +50,8 @@ int kmain(void) floppy_get_info(&floppy_info); floppy_print_info(&floppy_info); - enable_interrupt(1); // Enable Keyboard Interrupt (IRQ1) - enable_interrupt(0); // Enable IRQ0 (timer) - enable_interrupt(13); - timer_phase(100); // Fire IRQ0 each 1/100s - - - printf("Waiting 1s\n"); - sleep(1); - printf("Waiting 2s\n"); - sleep(2); - printf("Waiting 3s\n"); - sleep(3); - printf("Ok\n"); //caca_get_display_driver_list(); - + printf("Entering kernel infinite loop.\n"); while (1) { diff --git a/kernel/kernel.h b/kernel/kernel.h index 3c1a6f6..c9c6dc5 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -30,6 +30,8 @@ void enable_interrupt(char i); #define cli __asm__("cli"::) #define sti __asm__("sti"::) +#define rdtsc(low,high) \ +__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) /* The application's entry point */ diff --git a/kernel/klibc.c b/kernel/klibc.c index a060a6f..ad17987 100644 --- a/kernel/klibc.c +++ b/kernel/klibc.c @@ -1,4 +1,4 @@ -/* +/* * libcaca * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar @@ -35,46 +35,53 @@ void htoa(unsigned int value, char s[]); static int seed = 0x68743284; /* Our memory mapping */ -static uint32_t *freemem = (uint32_t*) 0x00200000; +static uint32_t *freemem = (uint32_t *) 0x00200000; int kX = 0; int kY = 0; void scroll(void) { - unsigned char* video, *tmp; - - for(video=(unsigned char*)0xB8000 ; video<(unsigned char*)0xB8FA0 ; video++){ - tmp = (unsigned char*) (video+1*160); - - if(tmp<(unsigned char*)0xB8FA0) + unsigned char *video, *tmp; + + for (video = (unsigned char *)0xB8000; video < (unsigned char *)0xB8FA0; + video++) + { + tmp = (unsigned char *)(video + 1 * 160); + + if (tmp < (unsigned char *)0xB8FA0) *video = *tmp; else *video = 0; - } - - kY-=1; - if(kY<0) - kY=0;} + } + + kY -= 1; + if (kY < 0) + kY = 0; +} void putcar(unsigned char c) { - unsigned char* video; - - if(c==10){ - kX=0; - kY++; - } - else{ - video = (unsigned char*) (0xB8000+2*kX+160*kY); - *video = c; - *(video+1) = 0x07; - - kX++; - if(kX>79){ - kX = 0; - kY++; - } - if(kY >= 24) { + unsigned char *video; + + if (c == 10) + { + kX = 0; + kY++; + } + else + { + video = (unsigned char *)(0xB8000 + 2 * kX + 160 * kY); + *video = c; + *(video + 1) = 0x07; + + kX++; + if (kX > 79) + { + kX = 0; + kY++; + } + if (kY >= 24) + { scroll(); } } @@ -83,8 +90,9 @@ void putcar(unsigned char c) void print(char *str) { char const *ptr = str; - while(*ptr) { - putcar(*ptr++); + while (*ptr) + { + putcar(*ptr++); } } @@ -93,19 +101,20 @@ void clearscreen(void) int x, y; kX = 0; kY = 0; - for(y = 0; y < 25; y++) - for(x = 0; x < 80; x++) { - putcar(' '); + for (y = 0; y < 25; y++) + for (x = 0; x < 80; x++) + { + putcar(' '); } kX = 0; - kY = 0; + kY = 0; } /* stdlib.h functions */ void *malloc(size_t size) { uint32_t *p = freemem; - if(!size) + if (!size) return NULL; size = (size + 0x7) / 4; *p = size; @@ -122,19 +131,19 @@ void *realloc(void *ptr, size_t size) { uint32_t oldsize; void *p; - - if(!size) + + if (!size) return NULL; - - if(!ptr) + + if (!ptr) oldsize = 0; else { - oldsize = ((uint32_t *)ptr)[-1]; - if(oldsize >= size) + oldsize = ((uint32_t *) ptr)[-1]; + if (oldsize >= size) return ptr; } - + p = malloc(size); memcpy(p, ptr, oldsize); return p; @@ -168,7 +177,7 @@ int rand(void) int abs(int j) { - if(j < 0) + if (j < 0) return -j; return j; } @@ -176,10 +185,10 @@ int abs(int j) void exit(int status) { /* FIXME: reboot? */ - while(1); + while (1); } -int atexit(void (*function)(void)) +int atexit(void (*function) (void)) { /* FIXME: register function */ return 0; @@ -189,10 +198,10 @@ int atexit(void (*function)(void)) void *memset(void *s, int c, size_t n) { uint8_t *ptr = s; - - while(n--) + + while (n--) *ptr++ = c; - + return s; } @@ -200,10 +209,10 @@ void *memcpy(void *dest, const void *src, size_t n) { uint8_t *destptr = dest; uint8_t const *srcptr = src; - - while(n--) + + while (n--) *destptr++ = *srcptr++; - + return dest; } @@ -217,42 +226,42 @@ void *memmove(void *dest, const void *src, size_t n) size_t strlen(const char *s) { int len = 0; - - while(*s++) + + while (*s++) len++; - + return len; } int strcmp(const char *s1, const char *s2) { - while(*s1 && *s1 == *s2) + while (*s1 && *s1 == *s2) { s1++; s2++; } - + return (int)*s1 - (int)*s2; } int strcasecmp(const char *s1, const char *s2) { - while(*s1 && *s2 && UPPER(*s1) == UPPER(*s2)) + while (*s1 && *s2 && UPPER(*s1) == UPPER(*s2)) { s1++; s2++; } - + return (int)UPPER(*s1) - (int)UPPER(*s2); } int memcmp(const void *_s1, const void *_s2, size_t n) { uint8_t const *s1 = _s1, *s2 = _s2; - - while(n--) + + while (n--) { - if(*s1 != *s2) + if (*s1 != *s2) return (int)*s1 - (int)*s2; s1++; s2++; @@ -264,20 +273,20 @@ char *strdup(const char *s) { char *new; unsigned int len = strlen(s); - + new = malloc(len + 1); memcpy(new, s, len + 1); - + return new; } char *strchr(const char *s, int c) { do - if(*s == c) - return (char *)(intptr_t)s; - while(*s++); - + if (*s == c) + return (char *)(intptr_t) s; + while (*s++); + return NULL; } @@ -295,24 +304,24 @@ FILE *fopen(const char *path, const char *mode) return NULL; } -int feof(FILE *stream) +int feof(FILE * stream) { /* FIXME */ return 0; } -char *fgets(char *s, int size, FILE *stream) +char *fgets(char *s, int size, FILE * stream) { /* FIXME */ return NULL; } -size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) +size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE * stream) { return 0; } -int fclose(FILE *fp) +int fclose(FILE * fp) { /* FIXME */ return 0; @@ -324,71 +333,89 @@ int printf(const char *fmt, ...) char tmp[100]; args_list args; args_start(args, fmt); - + char *s; int ptr = 0; int i = 0; - - for (; fmt[i]; ++i) { - if ((fmt[i]!='%') && (fmt[i]!='\\')) { + + for (; fmt[i]; ++i) + { + if ((fmt[i] != '%') && (fmt[i] != '\\')) + { str[ptr++] = fmt[i]; continue; - } else if (fmt[i] == '\\') { - switch (fmt[++i]) { - case 'a': str[ptr++] = '\a'; break; - case 'b': str[ptr++] = '\b'; break; - case 't': str[ptr++] = '\t'; break; - case 'n': str[ptr++] = '\n'; break; - case 'r': str[ptr++] = '\r'; break; - case '\\':str[ptr++] = '\\'; break; - } - continue; } - - switch (fmt[++i]) { - case 's': - s = (char *)args_next(args, char *); - while (*s) - str[ptr++] = *s++; + else if (fmt[i] == '\\') + { + switch (fmt[++i]) + { + case 'a': + str[ptr++] = '\a'; break; - case 'c': - str[ptr++] = (char)args_next(args, int); + case 'b': + str[ptr++] = '\b'; break; - case 'p': - case 'x': - htoa((unsigned long)args_next(args, unsigned long), tmp); - memcpy(&str[ptr], tmp, strlen(tmp)); - ptr+=strlen(tmp); + case 't': + str[ptr++] = '\t'; break; - case 'd': - itoa((unsigned long)args_next(args, unsigned long), tmp); - memcpy(&str[ptr], tmp, strlen(tmp)); - ptr+=strlen(tmp); + case 'n': + str[ptr++] = '\n'; break; - case '%': - str[ptr++] = '%'; + case 'r': + str[ptr++] = '\r'; break; - default: - str[ptr++] = fmt[i]; + case '\\': + str[ptr++] = '\\'; break; + } + continue; + } + + switch (fmt[++i]) + { + case 's': + s = (char *)args_next(args, char *); + while (*s) + str[ptr++] = *s++; + break; + case 'c': + str[ptr++] = (char)args_next(args, int); + break; + case 'p': + case 'x': + htoa((unsigned long)args_next(args, unsigned long), tmp); + memcpy(&str[ptr], tmp, strlen(tmp)); + ptr += strlen(tmp); + break; + case 'd': + itoa((unsigned long)args_next(args, unsigned long), tmp); + memcpy(&str[ptr], tmp, strlen(tmp)); + ptr += strlen(tmp); + break; + case '%': + str[ptr++] = '%'; + break; + default: + str[ptr++] = fmt[i]; + break; } } - + str[ptr] = '\0'; args_end(args); - + print(str); - + return 0; } -int fprintf(FILE *stream, const char *format, ...) +int fprintf(FILE * stream, const char *format, ...) { /* FIXME */ return 0; } -int fflush(FILE *stream) +int fflush(FILE * stream) { /* FIXME */ return 0; @@ -399,53 +426,71 @@ int sprintf(char *str, const char *fmt, ...) char tmp[100]; args_list args; args_start(args, fmt); - + char *s; int ptr = 0; int i = 0; - - for (; fmt[i]; ++i) { - if ((fmt[i]!='%') && (fmt[i]!='\\')) { + + for (; fmt[i]; ++i) + { + if ((fmt[i] != '%') && (fmt[i] != '\\')) + { str[ptr++] = fmt[i]; continue; - } else if (fmt[i] == '\\') { - switch (fmt[++i]) { - case 'a': str[ptr++] = '\a'; break; - case 'b': str[ptr++] = '\b'; break; - case 't': str[ptr++] = '\t'; break; - case 'n': str[ptr++] = '\n'; break; - case 'r': str[ptr++] = '\r'; break; - case '\\':str[ptr++] = '\\'; break; - } - continue; } - - switch (fmt[++i]) { - case 's': - s = (char *)args_next(args, char *); - while (*s) - str[ptr++] = *s++; + else if (fmt[i] == '\\') + { + switch (fmt[++i]) + { + case 'a': + str[ptr++] = '\a'; break; - case 'c': - str[ptr++] = (char)args_next(args, int); + case 'b': + str[ptr++] = '\b'; break; - case 'p': - case 'x': - htoa((unsigned long)args_next(args, unsigned long), tmp); - memcpy(&str[ptr], tmp, strlen(tmp)); - ptr+=strlen(tmp); + case 't': + str[ptr++] = '\t'; break; - case 'd': - itoa((unsigned long)args_next(args, unsigned long), tmp); - memcpy(&str[ptr], tmp, strlen(tmp)); - ptr+=strlen(tmp); + case 'n': + str[ptr++] = '\n'; break; - case '%': - str[ptr++] = '%'; + case 'r': + str[ptr++] = '\r'; break; - default: - str[ptr++] = fmt[i]; + case '\\': + str[ptr++] = '\\'; break; + } + continue; + } + + switch (fmt[++i]) + { + case 's': + s = (char *)args_next(args, char *); + while (*s) + str[ptr++] = *s++; + break; + case 'c': + str[ptr++] = (char)args_next(args, int); + break; + case 'p': + case 'x': + htoa((unsigned long)args_next(args, unsigned long), tmp); + memcpy(&str[ptr], tmp, strlen(tmp)); + ptr += strlen(tmp); + break; + case 'd': + itoa((unsigned long)args_next(args, unsigned long), tmp); + memcpy(&str[ptr], tmp, strlen(tmp)); + ptr += strlen(tmp); + break; + case '%': + str[ptr++] = '%'; + break; + default: + str[ptr++] = fmt[i]; + break; } } @@ -464,43 +509,39 @@ int sscanf(const char *str, const char *format, ...) /* unistd.h functions */ void usleep(unsigned long usec) { - u32 start = ticks; - signed int diff = 0; - - while(1) { + u32 start = ticks; + signed int diff = 0; + + while (1) + { diff = (signed int)(ticks - start); - if(diff >= (signed int)(usec/20)) break; + if (diff >= (signed int)(usec / 20)) + break; } } -void sleep(unsigned long sec) +void sleep(unsigned long sec) { - usleep(sec*1000); + usleep(sec * 1000); } -/* time.h functions */ - u64 rdtsc() { - u64 x; - __asm__ volatile ("rdtsc" : "=A" (x)); - return x; -} int gettimeofday(struct timeval *tv, struct timezone *tz) { static int usec = 0; static int sec = 0; - + /* FIXME */ usec += 10000; - if(usec > 1000000) + if (usec > 1000000) { sec++; usec -= 1000000; } - + tv->tv_sec = sec; tv->tv_usec = usec; - + return 0; } @@ -509,21 +550,21 @@ double cos(double x) { double ret = 0.0; #ifdef HAVE_FSIN_FCOS - asm volatile("fcos" : "=t" (ret) : "0" (x)); + asm volatile ("fcos":"=t" (ret):"0"(x)); #else double x2; double num = 1.0; double fact = 1.0; int i; - + x = x - ((double)(int)(x / (2 * M_PI))) * (2 * M_PI); x2 = x * x; - + /* cos(x) = 1/0! - x^2/2! + x^4/4! - x^6/6! ... */ - for(i = 0; i < 10; i++) + for (i = 0; i < 10; i++) { ret += num / fact; - num *= - x2; + num *= -x2; fact *= (2 * i + 1) * (2 * i + 2); } #endif @@ -534,22 +575,22 @@ double sin(double x) { double ret = 0.0; #ifdef HAVE_FSIN_FCOS - asm volatile("fsin" : "=t" (ret) : "0" (x)); + asm volatile ("fsin":"=t" (ret):"0"(x)); #else double x2; double num; double fact = 1.0; int i; - + x = x - ((double)(int)(x / (2 * M_PI))) * (2 * M_PI); x2 = x * x; num = x; - + /* sin(x) = x/1! - x^3/3! + x^5/5! - x^7/7! ... */ - for(i = 0; i < 10; i++) + for (i = 0; i < 10; i++) { ret += num / fact; - num *= - x2; + num *= -x2; fact *= (2 * i + 2) * (2 * i + 3); } #endif @@ -560,22 +601,23 @@ double sqrt(double x) { double ret = x; int i; - + /* This is Newton's method */ - for(i = 0; i < 10; i++) + for (i = 0; i < 10; i++) ret = (ret * ret + x) / (ret * 2.0); - + return ret; } -/* reverse: reverse string s in place */ +/* reverse: reverse string s in place */ void reverse(char s[]) { int i, j; char c; - - for (i = 0, j = strlen(s)-1; i 0); /* delete it */ + do + { /* generate digits in reverse order */ + s[i++] = n % 10 + '0'; /* get next digit */ + } + while ((n /= 10) > 0); /* delete it */ if (sign < 0) s[i++] = '-'; s[i] = '\0'; reverse(s); -} +} -void htoa(unsigned int value, char s[]) { +void htoa(unsigned int value, char s[]) +{ int i = 8; int ptr = 0; - while (i-- > 0) { - s[ptr++] = "0123456789abcdef"[(value>>(i*4))&0xf]; + while (i-- > 0) + { + s[ptr++] = "0123456789abcdef"[(value >> (i * 4)) & 0xf]; } s[ptr] = 0; } /* errno.h stuff */ -int errno = 0; \ No newline at end of file +int errno = 0; diff --git a/kernel/klibc.h b/kernel/klibc.h index 86c1386..3b0b6f2 100755 --- a/kernel/klibc.h +++ b/kernel/klibc.h @@ -41,7 +41,7 @@ typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; -typedef unsigned long int u64; +typedef unsigned long long u64; #ifndef size_t typedef unsigned int size_t; @@ -123,7 +123,6 @@ void sleep(unsigned long sec); int getpid(void); /* time.h functions */ -u64 rdtsc(void); int gettimeofday(struct timeval *tv, struct timezone *tz); int time(void *);