Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode Implement thunk_malloc() and think_free()



details:   https://anonhg.NetBSD.org/src/rev/aca682c355d2
branches:  trunk
changeset: 768662:aca682c355d2
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed Aug 24 10:56:44 2011 +0000

description:
Implement thunk_malloc() and think_free()

diffstat:

 sys/arch/usermode/include/thunk.h  |   6 ++++--
 sys/arch/usermode/usermode/thunk.c |  16 ++++++++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diffs (59 lines):

diff -r 35cd0145538e -r aca682c355d2 sys/arch/usermode/include/thunk.h
--- a/sys/arch/usermode/include/thunk.h Wed Aug 24 07:51:31 2011 +0000
+++ b/sys/arch/usermode/include/thunk.h Wed Aug 24 10:56:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.h,v 1.15 2011/08/23 21:55:21 jmcneill Exp $ */
+/* $NetBSD: thunk.h,v 1.16 2011/08/24 10:56:45 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -83,9 +83,11 @@
 int    thunk_aio_error(const struct aiocb *);
 int    thunk_aio_return(struct aiocb *);
 
+void * thunk_malloc(size_t len);
+void   thunk_free(void *addr);
 void * thunk_sbrk(intptr_t len);
 void * thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
-int    thunk_munmap(void *Addr, size_t len);
+int    thunk_munmap(void *addr, size_t len);
 int    thunk_mprotect(void *addr, size_t len, int prot);
 
 #endif /* !_ARCH_USERMODE_INCLUDE_THUNK_H */
diff -r 35cd0145538e -r aca682c355d2 sys/arch/usermode/usermode/thunk.c
--- a/sys/arch/usermode/usermode/thunk.c        Wed Aug 24 07:51:31 2011 +0000
+++ b/sys/arch/usermode/usermode/thunk.c        Wed Aug 24 10:56:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.c,v 1.17 2011/08/23 21:55:21 jmcneill Exp $ */
+/* $NetBSD: thunk.c,v 1.18 2011/08/24 10:56:44 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: thunk.c,v 1.17 2011/08/23 21:55:21 jmcneill Exp $");
+__RCSID("$NetBSD: thunk.c,v 1.18 2011/08/24 10:56:44 reinoud Exp $");
 
 #include <sys/types.h>
 #include <sys/ansi.h>
@@ -289,6 +289,18 @@
 }
 
 void *
+thunk_malloc(size_t len)
+{
+       return malloc(len);
+}
+
+void
+thunk_free(void *addr)
+{
+       free(addr);
+}
+
+void *
 thunk_sbrk(intptr_t len)
 {
        return sbrk(len);



Home | Main Index | Thread Index | Old Index