source: abuse/tags/pd/macabuse/imlib/include/emm.hpp

Last change on this file was 49, checked in by Sam Hocevar, 11 years ago
  • Imported original public domain release, for future reference.
File size: 1.0 KB
Line 
1#ifndef __EMM_H_
2#define __EMM_H_
3#include "system.h"
4#ifdef __DOS            // this stuff is DOS specific, don't include
5                        // on other systems
6#include "linked.hpp"
7
8class emblock : public linked_node
9{
10public :
11  unsigned beg,end;
12  int emhandle;
13  emblock *nextblk;
14} ;
15
16
17class expandedmm
18{
19public :
20  unsigned frame_ad;
21  long frmsz;
22  linked_list allocblks,freeblks;
23  expandedmm();
24
25  emblock *alloc(unsigned size);
26  void free(emblock *block);
27  void free_all();
28  long avail() { return frmsz; }
29  void set(emblock *block, char *dat);
30  void get(emblock *block, char *dat);
31  ~expandedmm() { free_all(); }
32} ;
33
34extern expandedmm epmem;
35extern int  emm_avail;
36int      EMM_detect();
37int      EMM_num_free_pages();
38int      EMM_version();
39int      EMM_num_active_handles();
40long     EMM_free_memory();
41int      EMM_alloc(int pages);  // remeber pages are 16K, 16384 bytes
42                // returns handle or -1
43int      EMM_free(int handle);   // returns true for success
44unsigned EMM_frame_address();
45void     EMM_map_page(int handle);
46
47#endif
48#endif
49
Note: See TracBrowser for help on using the repository browser.