This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] add alloc_pages/free_pages support


Below is a patch to add support for the new
alloc_hugepages()/free_hugepages() system call.  I hope I got all the
details right.  If not, ring...

Thanks,

	--david

2002-10-02  David Mosberger  <davidm@hpl.hp.com>

	* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Mention
	sys/hugepage.h.

	* sysdeps/unix/sysv/linux/syscalls.list: Make alloc_hugepages and
	free_hugepages weak symbols.

	* sysdeps/unix/sysv/linux/Versions: Mention alloc_hugepages and
	free_hugepages.

2002-10-01  Rohit Seth <rohit.seth@intel.com>,
	    David Mosberger <davidm@hpl.hp.com>

	* sysdeps/unix/sysv/linux/syscalls.list: Add alloc_hugepages and
	free_hugepages.
	* sysdeps/unix/sysv/linux/sys/hugepage.h: New file.

Index: sysdeps/unix/sysv/linux/Makefile
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/Makefile,v
retrieving revision 1.121
diff -u -r1.121 Makefile
--- sysdeps/unix/sysv/linux/sysdeps/unix/sysv/linux/Makefile	15 Sep 2002 02:30:28 -0000	1.121
+++ sysdeps/unix/sysv/linux/sysdeps/unix/sysv/linux/Makefile	3 Oct 2002 07:01:33 -0000
@@ -20,7 +20,7 @@
 		  sys/kd.h sys/soundcard.h sys/vt.h \
 		  sys/quota.h sys/fsuid.h \
 		  scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
-		  sys/ultrasound.h sys/raw.h sys/personality.h
+		  sys/ultrasound.h sys/raw.h sys/personality.h sys/hugepage.h
 
 install-others += $(inst_includedir)/bits/syscall.h
 
Index: sysdeps/unix/sysv/linux/Versions
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/Versions,v
retrieving revision 1.18
diff -u -r1.18 Versions
--- sysdeps/unix/sysv/linux/sysdeps/unix/sysv/linux/Versions	30 Aug 2002 01:30:55 -0000	1.18
+++ sysdeps/unix/sysv/linux/sysdeps/unix/sysv/linux/Versions	3 Oct 2002 07:01:33 -0000
@@ -102,6 +102,9 @@
     # r*
     readahead;
 
+    alloc_hugepages;
+    free_hugepages;
+
     #errlist-compat	126
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
Index: sysdeps/unix/sysv/linux/syscalls.list
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/syscalls.list,v
retrieving revision 1.94
diff -u -r1.94 syscalls.list
--- sysdeps/unix/sysv/linux/sysdeps/unix/sysv/linux/syscalls.list	15 Aug 2002 08:25:16 -0000	1.94
+++ sysdeps/unix/sysv/linux/sysdeps/unix/sysv/linux/syscalls.list	3 Oct 2002 07:01:33 -0000
@@ -80,3 +80,5 @@
 lremovexattr	EXTRA	lremovexattr	i:ss	lremovexattr
 fremovexattr	EXTRA	fremovexattr	i:is	fremovexattr
 
+alloc_hugepages EXTRA	alloc_hugepages	b:ianii __alloc_hugepages	alloc_hugepages
+free_hugepages  EXTRA	free_hugepages	i:a 	__free_hugepages	free_hugepages
Index: sysdeps/unix/sysv/linux/sys/hugepage.h
===================================================================
RCS file: sysdeps/unix/sysv/linux/sys/hugepage.h
diff -N sysdeps/unix/sysv/linux/sys/hugepage.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sysdeps/unix/sysv/linux/sys/sysdeps/unix/sysv/linux/sys/hugepage.h	3 Oct 2002 07:01:33 -0000
@@ -0,0 +1,8 @@
+#ifndef _SYS_HUGEPAGE_H
+#define _SYS_HUGEPAGE_H 1
+
+extern void *alloc_hugepages (int key, void *addr, size_t len, int prot,
+			      int flag);
+extern int free_hugepages (void *addr);
+
+#endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]