Main Page | Directories | File List | Globals

tsc.c File Reference

#include <agnix/agnix.h>
#include <agnix/adi/adi.h>
#include <agnix/console.h>
#include <agnix/math64.h>
#include <asm/cpu_ops.h>
#include <agnix/ioport.h>

Include dependency graph for tsc.c:

Go to the source code of this file.

Defines

#define MOD_NAME   "\tTSC: "

Functions

int __init tsc_get_speed (void)
void __init cpu_tsc_init (void)

Variables

chip_s cpu_chip


Define Documentation

#define MOD_NAME   "\tTSC: "
 

Definition at line 21 of file tsc.c.


Function Documentation

void __init cpu_tsc_init void   ) 
 

Definition at line 46 of file tsc.c.

References cpu_capable(), MOD_NAME, and printk().

Referenced by cpu_init().

00047 {
00048     if (cpu_capable(X86_FEATURE_TSC)) {
00049         write_cr4(read_cr4() & (~CPU_CR4_TSD));
00050         
00051         if (read_cr4() & CPU_CR4_TSD) {
00052             printk(MOD_NAME "Tsc cannot be enabled\n");
00053         }
00054     }
00055 }

Here is the call graph for this function:

int __init tsc_get_speed void   ) 
 

Definition at line 25 of file tsc.c.

References sub_64_64().

Referenced by cpu_get_speed().

00026 {
00027     u32 tsc[2];
00028     u32 tsc_s[2];
00029     u32 tsc_e[2];
00030 
00031     outb(0xb0, 0x43);
00032     outb((i8254_RELOAD_COUNT) & 0xFF, 0x42);
00033     outb((i8254_RELOAD_COUNT >> 8) & 0xFF, 0x42);
00034 
00035     rdtsc(tsc_s[0], tsc_s[1]);
00036 
00037     while(!(inb(0x61) & 0x20));
00038     
00039     rdtsc(tsc_e[0], tsc_e[1]);
00040     
00041     sub_64_64(tsc, tsc_e, tsc_s);
00042 
00043     return (tsc[0]);    
00044 }

Here is the call graph for this function:


Variable Documentation

struct chip_s cpu_chip
 

Definition at line 29 of file cpu.c.

Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix