/*
    SupportAsm.h, Copyright  (c) by Lukas Ruf, lr@lpr.ch,
    Swiss Federal Institute of Technology,
    Computer Engineering and Networks Laboratory.
 
    TOPSY -- A Teachable Operating System.
             Implementation of a tiny and simple
             micro kernel for teaching purposes.
 
    For further information, please visit http://www.tik.ee.ethz.ch/~topsy
 
    This software is provided under the terms of the GNU General Public Licence.
 
    A full copy of the GNU GPL is provided in the file COPYING found in the 
    development root of Topsy.
*/
/*
	
	File:                  $Source: /home/ruf/cvs_Topsy/cvs/Topsy/Topsy/ia32/SupportAsm.h,v $
 	Author(s):             Lukas Ruf, lr@lpr.ch
 	Affiliation:           ETH Zuerich, TIK
 	Version:               $Revision: 2922 $
 	Creation Date:         
 	Last Date of Change:   $Date: 2007-03-19 17:48:52 +0100 (Mon, 19 Mär 2007) $      by: $Author: baderma $
*/

#ifndef __SUPPORTASM_H__
#define __SUPPORTASM_H__


#define cli   \
  asm ("cli")
#define sti   \
  asm ("sti")

void  __reboot();
void  __reset_TLB();
void  __wait();
void  __beep();
unsigned long int __getClockCount();
void __enableClockCountForUser();
void __disableClockCountForUser();

void  __outb(unsigned char pbyte, unsigned short pport);
void  __outw(unsigned short pword, unsigned short pport);
void  __outl(unsigned int pdword, unsigned short pport);
unsigned char __inb(unsigned short pport);
unsigned short __inw(unsigned short pport);
unsigned int __inl(unsigned short pport);

unsigned char __readb(unsigned short selector, unsigned int offset);
unsigned short __readw(unsigned short selector, unsigned int offset);
unsigned int __readl(unsigned short selector, unsigned int offset);
void __writeb(unsigned short selector, unsigned int offset, unsigned char value);
void __writew(unsigned short selector, unsigned int offset, unsigned short value);
void __writel(unsigned short selector, unsigned int offset, unsigned int value);

/* mutex.S */
unsigned char __mutex(void *p32mutex, unsigned long pmutexNr);
unsigned char __demutex(void *p32mutex, unsigned long pmutexNr);

/* start.S */
unsigned long   __getTextSize();
unsigned long   __getDataSize();

#endif



