summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-10-08 10:25:25 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-10-08 10:25:25 +0000
commitae0de4f1dc696416261f4be6a8bfe29a6562ead5 (patch)
tree9231b15ac2912e97319d184f3dbd1c44376616ef /sys/dev
parent361de308e70d3b45e4befde95404cc1523933624 (diff)
Implement set_pages_array_wb() and set_pages_array_wc() for powerpc. Since
powerpc doesn't actually implement write-combining fall back to uncached mappings. ok mpi@, jsg@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/ttm/ttm_page_alloc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/ttm/ttm_page_alloc.c b/sys/dev/pci/drm/ttm/ttm_page_alloc.c
index fbb2e946ff9..5b32bd7285b 100644
--- a/sys/dev/pci/drm/ttm/ttm_page_alloc.c
+++ b/sys/dev/pci/drm/ttm/ttm_page_alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttm_page_alloc.c,v 1.10 2015/09/27 11:09:26 jsg Exp $ */
+/* $OpenBSD: ttm_page_alloc.c,v 1.11 2015/10/08 10:25:24 kettenis Exp $ */
/*
* Copyright (c) Red Hat Inc.
@@ -244,18 +244,21 @@ static struct kobj_type ttm_pool_kobj_type = {
#endif
};
+#ifndef PG_PMAP_WC
+#define PG_PMAP_WC PG_PMAP_UC
+#endif
+
static struct ttm_pool_manager *_manager;
static int set_pages_array_wb(struct vm_page **pages, int addrinarray)
{
#ifdef TTM_HAS_AGP
-#if defined(__amd64__) || defined(__i386__)
+#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__)
int i;
for (i = 0; i < addrinarray; i++)
atomic_clearbits_int(&pages[i]->pg_flags, PG_PMAP_WC);
#else
- printf("%s stub\n", __func__);
return -ENOSYS;
#endif
#endif
@@ -265,13 +268,12 @@ static int set_pages_array_wb(struct vm_page **pages, int addrinarray)
static int set_pages_array_wc(struct vm_page **pages, int addrinarray)
{
#ifdef TTM_HAS_AGP
-#if defined(__amd64__) || defined(__i386__)
+#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__)
int i;
for (i = 0; i < addrinarray; i++)
atomic_setbits_int(&pages[i]->pg_flags, PG_PMAP_WC);
#else
- printf("%s stub\n", __func__);
return -ENOSYS;
#endif
#endif