-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgeneral.h
42 lines (34 loc) · 924 Bytes
/
general.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef GENERAL_H_INCLUDED
#define GENERAL_H_INCLUDED
#include <stdio.h>
#include <windows.h>
#include "internal.h"
#include "disk_image.h"
#include "cache.h"
#include "bitmap.h"
#define ALIGN_UP(addr, n) (((addr) + (n) - 1)/(n)*(n))
#define ALIGN_DOWN(addr, n) ((addr)/(n)*(n))
#define COUNTOF(arr) (sizeof(arr)/sizeof((arr)[0]))
typedef struct _MINIX_FS
{
DISK_IMG *pImg;
unsigned uOffset, cbLen;
struct super_block Super;
MX_BITMAP InodeMap;
MX_BITMAP ZoneMap;
CRITICAL_SECTION Lock;
MX_BLOCK_CACHE Cache;
} MINIX_FS;
MINIX_FS *MxfsOpen(DISK_IMG *pImg, unsigned uOffset, unsigned uLen);
void MxfsClose(MINIX_FS *pFileSys);
FORCEINLINE void *MxfsAlloc(unsigned uSize)
{
return HeapAlloc(GetProcessHeap(), 0, uSize);
}
FORCEINLINE void MxfsFree(void *pMem)
{
if(pMem)
HeapFree(GetProcessHeap(), 0, pMem);
}
#define MINIX_VOLUME_ID 0x5F7AC349
#endif // GENERAL_H_INCLUDED