Main Page   File List  

kasm.h

00001 /***************************************************************************
00002                           kasm.h  -  description
00003                              -------------------
00004     begin                : Sat Dec 13 2003
00005     copyright            : (C) 2003 by Dynacube Team
00006     email                : [email protected]
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 /*
00018 File Contains asm generic level functions
00019 */
00020 
00021 #ifndef __ASM_H
00022 #define __ASM_H
00023 
00024         #include "ktypes.h"
00025                 
00026         #define lds(desc_sel) __asm__ __volatile__("movl %0, %%ds"::"r"(desc_sel));
00027         #define lss(desc_sel) __asm__ __volatile__("movl %0, %%ss"::"r"(desc_sel));
00028         #define les(desc_sel) __asm__ __volatile__("movl %0, %%es"::"r"(desc_sel));
00029         #define lfs(desc_sel) __asm__ __volatile__("movl %0, %%fs"::"r"(desc_sel));
00030         #define lgs(desc_sel) __asm__ __volatile__("movl %0, %%gs"::"r"(desc_sel));
00031 
00032         #define cli()   __asm__ __volatile__("cli");
00033         #define sti() __asm__ __volatile__("sti");
00034 
00035         #define setCR0(val) __asm__ __volatile__ ("movl %%eax, %%cr0"::"a"(val));
00036         #define getCR0(var) __asm__ __volatile__ ("movl %%cr0,%%eax":"=a"(var));
00037 
00038         #define setCR3(val) __asm__ __volatile__ ("movl %%eax, %%cr3"::"a"(val));
00039         #define getCR3(var) __asm__ __volatile__ ("movl %%cr3,%%eax":"=a"(var));
00040                 
00041   void lidt(IDT *);
00042   void lgdt(GDT *gdt);
00043   void sgdt(GDT *gdt);
00044   void kdump();
00045 #endif
00046 
00047 

Generated on Sun Jan 18 01:43:52 2004 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002
Hosted by www.Geocities.ws

1