aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/mlock.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-09-17 13:48:12 +0000
committerlloyd <[email protected]>2009-09-17 13:48:12 +0000
commit7d51181d2841b29277da9a31752cae612d64b534 (patch)
treeb5554f4d2e41d1660f6ae1e996f5ff937637cc57 /src/utils/mlock.h
parent268c1b8902fccc4e942f6ccd5651dab826846a92 (diff)
Move memory locking function decls to mlock.h
Inline round_up and round_down
Diffstat (limited to 'src/utils/mlock.h')
-rw-r--r--src/utils/mlock.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/utils/mlock.h b/src/utils/mlock.h
new file mode 100644
index 000000000..0811e8190
--- /dev/null
+++ b/src/utils/mlock.h
@@ -0,0 +1,32 @@
+/*
+* Memory Locking Functions
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_MLOCK_H__
+#define BOTAN_MLOCK_H__
+
+#include <botan/types.h>
+
+namespace Botan {
+
+/**
+* Lock memory into RAM if possible
+* @param addr the start of the memory block
+* @param length the length of the memory block in bytes
+* @returns true if successful, false otherwise
+*/
+BOTAN_DLL bool lock_mem(void* addr, u32bit length);
+
+/**
+* Unlock memory locked with lock_mem()
+* @param addr the start of the memory block
+* @param length the length of the memory block in bytes
+*/
+BOTAN_DLL void unlock_mem(void* addr, u32bit length);
+
+}
+
+#endif