• Main Page
  • Classes
  • Files
  • File List
  • File Members

memmap.h

Go to the documentation of this file.
00001 //
00002 // begin license header
00003 //  
00004 // This file is part of Terk and TerkOS.
00005 //
00006 // All Terk and TerkOS source code is provided under the terms of the 
00007 // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).  
00008 // Those wishing to use Terk and TerkOS source code, software and/or
00009 // technologies under different licensing terms should contact us at 
00010 // [email protected]. Such licensing terms are available for
00011 // all portions of the Terk and TerkOS codebase presented here.
00012 //
00013 // end license header
00014 //
00015 
00016 #ifndef _MEMMAP_H
00017 #define _MEMMAP_H
00018 
00025 class CMemMap
00026 {
00027 public:
00033   CMemMap(unsigned int base, unsigned int size);
00034   ~CMemMap();
00035         
00039   unsigned long GetMap()
00040   {
00041     return (unsigned long)m_map;
00042   }
00043 
00049   inline volatile unsigned int *Uint(unsigned int offset=0) 
00050   {
00051     return (volatile unsigned int *)(m_map + offset);
00052   }
00053 
00059   inline volatile unsigned short *Ushort(unsigned int offset=0) 
00060   {
00061     return (volatile unsigned short *)(m_map + offset);
00062   }
00063 
00069   inline volatile unsigned char *Uchar(unsigned int offset=0) 
00070   {
00071     return (volatile unsigned char *)(m_map + offset);
00072   }
00073 private:
00074   int m_fd;
00075   unsigned char *m_map;
00076 };
00077 
00078 #endif

Generated on Mon Oct 3 2011 15:36:31 for libqwerk by  doxygen 1.7.1