]> pd.if.org Git - pdclib/blobdiff - platform/gandr/functions/_PDCLIB/_PDCLIB_allocpages.c
Removed SVN keyword tags.
[pdclib] / platform / gandr / functions / _PDCLIB / _PDCLIB_allocpages.c
index bdcd525ca3ece71ab92d2e63829c357113eb58b2..02678ff4ec60eb424957b0ef077a8c7692db3159 100644 (file)
@@ -1,23 +1,26 @@
-/* $Id$ */
-
 /* _PDCLIB_allocpages( int const )
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
 */
 
-/* This is a stub implementation of _PDCLIB_allocpages
-*/
-
 #include <stdint.h>
 #include <stddef.h>
 #include <_PDCLIB_glue.h>
 #include <errno.h>
+#include <gd_bal.h>
 
 void * _PDCLIB_allocpages( size_t n )
 {
-    errno = ENOTSUP;
-    return NULL;
+    void *p = NULL;
+    int rv = gd_alloc_pages( gd_loader_data, &p, n );
+
+    if (rv) {
+        errno = rv;
+        return NULL;
+    } else {
+        return p;
+    }
 }
 
 #ifdef TEST