Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Remove needless linux_gfp.c.
details: https://anonhg.NetBSD.org/src/rev/b92b94e16b0b
branches: trunk
changeset: 330666:b92b94e16b0b
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Jul 17 13:52:22 2014 +0000
description:
Remove needless linux_gfp.c.
Trying to make do with Linux's page allocation interface is pretty
much always wrong: either we let uvm allocate pages in uvm objects
for us, or we use bus_dma.
diffstat:
sys/external/bsd/drm2/linux/files.drmkms_linux | 3 +-
sys/external/bsd/drm2/linux/linux_gfp.c | 76 --------------------------
sys/modules/drmkms_linux/Makefile | 3 +-
3 files changed, 2 insertions(+), 80 deletions(-)
diffs (114 lines):
diff -r 75812f8a7dee -r b92b94e16b0b sys/external/bsd/drm2/linux/files.drmkms_linux
--- a/sys/external/bsd/drm2/linux/files.drmkms_linux Thu Jul 17 13:47:19 2014 +0000
+++ b/sys/external/bsd/drm2/linux/files.drmkms_linux Thu Jul 17 13:52:22 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.drmkms_linux,v 1.6 2014/07/16 20:56:25 riastradh Exp $
+# $NetBSD: files.drmkms_linux,v 1.7 2014/07/17 13:52:22 riastradh Exp $
define drmkms_linux: i2cexec, i2c_bitbang
@@ -6,7 +6,6 @@
makeoptions drmkms_linux CPPFLAGS+="-I$S/external/bsd/common/include"
file external/bsd/drm2/linux/linux_dmi.c drmkms_linux
-file external/bsd/drm2/linux/linux_gfp.c drmkms_linux
file external/bsd/drm2/linux/linux_kmap.c drmkms_linux
file external/bsd/drm2/linux/linux_i2c.c drmkms_linux
file external/bsd/drm2/linux/linux_idr.c drmkms_linux
diff -r 75812f8a7dee -r b92b94e16b0b sys/external/bsd/drm2/linux/linux_gfp.c
--- a/sys/external/bsd/drm2/linux/linux_gfp.c Thu Jul 17 13:47:19 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/* $NetBSD: linux_gfp.c,v 1.2 2014/03/18 18:20:43 riastradh Exp $ */
-
-/*-
- * Copyright (c) 2013 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Taylor R. Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_gfp.c,v 1.2 2014/03/18 18:20:43 riastradh Exp $");
-
-#include <sys/types.h>
-#include <sys/queue.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <linux/gfp.h>
-#include <linux/kernel.h>
-#include <linux/mm_types.h>
-
-struct page *
-alloc_page(gfp_t gfp)
-{
- paddr_t low = 0;
- paddr_t high = ~(paddr_t)0;
- struct pglist pglist;
- struct vm_page *vm_page;
- int error;
-
- if (ISSET(gfp, __GFP_DMA32))
- high = 0xffffffff;
-
- error = uvm_pglistalloc(PAGE_SIZE, low, high, PAGE_SIZE, PAGE_SIZE,
- &pglist, 1, ISSET(gfp, __GFP_WAIT));
- if (error)
- return NULL;
-
- vm_page = TAILQ_FIRST(&pglist);
- TAILQ_REMOVE(&pglist, vm_page, pageq.queue); /* paranoia */
- KASSERT(TAILQ_EMPTY(&pglist));
-
- return container_of(vm_page, struct page, p_vmp);
-}
-
-void
-__free_page(struct page *page)
-{
- struct pglist pglist = TAILQ_HEAD_INITIALIZER(pglist);
-
- TAILQ_INSERT_TAIL(&pglist, &page->p_vmp, pageq.queue);
-
- uvm_pglistfree(&pglist);
-}
diff -r 75812f8a7dee -r b92b94e16b0b sys/modules/drmkms_linux/Makefile
--- a/sys/modules/drmkms_linux/Makefile Thu Jul 17 13:47:19 2014 +0000
+++ b/sys/modules/drmkms_linux/Makefile Thu Jul 17 13:52:22 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2014/07/16 20:56:26 riastradh Exp $
+# $NetBSD: Makefile,v 1.4 2014/07/17 13:52:22 riastradh Exp $
.include "../Makefile.inc"
@@ -12,7 +12,6 @@
KMOD= drmkms_linux
SRCS+= linux_dmi.c
-SRCS+= linux_gfp.c
SRCS+= linux_kmap.c
SRCS+= linux_i2c.c
SRCS+= linux_idr.c
Home |
Main Index |
Thread Index |
Old Index