]> pd.if.org Git - pdclib/blobdiff - platform/gandr/functions/_PDCLIB/_PDCLIB_allocpages.c
Cosmetic comment fixes.
[pdclib] / platform / gandr / functions / _PDCLIB / _PDCLIB_allocpages.c
index bdcd525ca3ece71ab92d2e63829c357113eb58b2..c0d05ed0f7b3b59073c336cc6afa288f7190ff65 100644 (file)
@@ -1,27 +1,30 @@
-/* $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 "_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
-#include <_PDCLIB_test.h>
+#include "_PDCLIB_test.h"
 
 int main( void )
 {