Skip to content

Commit

Permalink
Merge branch 'kernel-src-clean' into kernel-src
Browse files Browse the repository at this point in the history
  • Loading branch information
anttikantee committed Jun 16, 2015
2 parents e9a5712 + 6c0f80a commit c643ebb
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 15 deletions.
4 changes: 2 additions & 2 deletions sys/rump/dev/lib/libpci/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.5 2015/06/03 13:41:56 pooka Exp $
# $NetBSD: Makefile,v 1.6 2015/06/15 15:38:52 pooka Exp $
#

RUMPTOP= ${TOPRUMP}
Expand Down Expand Up @@ -26,7 +26,7 @@ CPPFLAGS+= -I${.CURDIR}/opt -I${RUMPTOP}/librump/rumpkern
CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs

.if ${RUMP_PCI_IOSPACE:Uno} == "yes"
CPPFLAGS+=-DRUMP_PCI_IOSPACE
.error RUMP_PCI_IOSPACE defined in Makefile. Use userfeatures.h instead.
.endif

.PATH: ${RUMPCOMP_USER_PATH.rumpdev_pci}
Expand Down
19 changes: 15 additions & 4 deletions sys/rump/dev/lib/libpci/pci_at_mainbus.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: pci_at_mainbus.c,v 1.5 2014/08/22 14:28:58 pooka Exp $ */
/* $NetBSD: pci_at_mainbus.c,v 1.6 2015/06/15 15:38:52 pooka Exp $ */

/*
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
Expand Down Expand Up @@ -26,7 +26,7 @@
*/

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pci_at_mainbus.c,v 1.5 2014/08/22 14:28:58 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: pci_at_mainbus.c,v 1.6 2015/06/15 15:38:52 pooka Exp $");

#include <sys/param.h>
#include <sys/conf.h>
Expand All @@ -43,6 +43,8 @@ __KERNEL_RCSID(0, "$NetBSD: pci_at_mainbus.c,v 1.5 2014/08/22 14:28:58 pooka Exp
#include "rump_private.h"
#include "rump_vfs_private.h"

#include "pci_user.h"

RUMP_COMPONENT(RUMP_COMPONENT_DEV)
{
extern const struct cdevsw pci_cdevsw;
Expand Down Expand Up @@ -80,8 +82,17 @@ RUMP_COMPONENT(RUMP_COMPONENT_DEV_AFTERMAINBUS)
#endif
pba.pba_flags = PCI_FLAGS_MEM_OKAY |
PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;;
#ifdef RUMP_PCI_IOSPACE
pba.pba_flags |= PCI_FLAGS_IO_OKAY;

#ifdef RUMPCOMP_USERFEATURE_PCI_IOSPACE
int error;

error = rumpcomp_pci_iospace_init();
if (!error) {
pba.pba_flags |= PCI_FLAGS_IO_OKAY;
} else {
aprint_error("pci: I/O space init error %d, I/O space not "
"available\n", error);
}
#endif

mainbus = device_find_by_driver_unit("mainbus", 0);
Expand Down
19 changes: 17 additions & 2 deletions sys/rump/dev/lib/libpci/pci_user.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* Possible userfeature macro flags:
*
* RUMPCOMP_USERFEATURE_PCI_DMAFREE:
* Support free'ing DMA memory. If not, panic() when free() is called.
*
* RUMPCOMP_USERFEATURE_PCI_IOSPACE
* Support for PCI I/O space. If yes, rumpcomp_pci_iospace_init()
* must be provided.
*/

#include "rumpcomp_userfeatures_pci.h"

void *rumpcomp_pci_map(unsigned long, unsigned long);
Expand All @@ -9,8 +20,8 @@ void *rumpcomp_pci_irq_establish(unsigned, int (*)(void *), void *);

/* XXX: needs work: support boundary-restricted allocations */
int rumpcomp_pci_dmalloc(size_t, size_t, unsigned long *, unsigned long *);
#ifdef rumpcomp_pci_free
void rumpcomp_pci_free(unsigned long, size_t);
#ifdef RUMPCOMP_USERFEATURE_PCI_DMAFREE
void rumpcomp_pci_dmafree(unsigned long, size_t);
#endif

struct rumpcomp_pci_dmaseg {
Expand All @@ -22,3 +33,7 @@ int rumpcomp_pci_dmamem_map(struct rumpcomp_pci_dmaseg *, size_t, size_t,
void **);

unsigned long rumpcomp_pci_virt_to_mach(void *);

#ifdef RUMPCOMP_USERFEATURE_PCI_IOSPACE
int rumpcomp_pci_iospace_init(void);
#endif
6 changes: 3 additions & 3 deletions sys/rump/dev/lib/libpci/rumpdev_bus_dma.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: rumpdev_bus_dma.c,v 1.4 2015/06/03 13:55:42 pooka Exp $ */
/* $NetBSD: rumpdev_bus_dma.c,v 1.5 2015/06/15 15:38:52 pooka Exp $ */

/*-
* Copyright (c) 2013 Antti Kantee
Expand Down Expand Up @@ -446,11 +446,11 @@ bus_dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map,
void
bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
{
#ifdef rumpcomp_pci_free
#ifdef RUMPCOMP_USERFEATURE_PCI_DMAFREE
vaddr_t vacookie = segs[0]._ds_vacookie;
bus_size_t sizecookie = segs[0]._ds_sizecookie;

rumpcomp_pci_free(vacookie, sizecookie);
rumpcomp_pci_dmafree(vacookie, sizecookie);
#else
panic("bus_dmamem_free not implemented");
#endif
Expand Down
5 changes: 3 additions & 2 deletions sys/rump/dev/lib/libpci/rumpdev_bus_space.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: rumpdev_bus_space.c,v 1.4 2015/05/17 13:45:37 pooka Exp $ */
/* $NetBSD: rumpdev_bus_space.c,v 1.5 2015/06/15 15:38:52 pooka Exp $ */

/*-
* Copyright (c) 2013 Antti Kantee. All Rights Reserved.
Expand Down Expand Up @@ -34,7 +34,8 @@

#include "pci_user.h"

#if defined(RUMP_PCI_IOSPACE) && (defined(__i386__) || defined(__x86_64__))
#if defined(RUMPCOMP_USERFEATURE_PCI_IOSPACE) \
&& (defined(__i386__) || defined(__x86_64__))
#define IOSPACE_SUPPORTED
#endif

Expand Down
4 changes: 2 additions & 2 deletions sys/rump/dev/lib/libumass/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# $NetBSD: Makefile,v 1.7 2014/03/13 01:54:59 pooka Exp $
# $NetBSD: Makefile,v 1.8 2015/06/13 23:33:20 pooka Exp $
#

.PATH: ${.CURDIR}/../../../../dev/usb

LIB= rumpdev_umass
IOCONF= UMASS.ioconf

.if ${MACHINE} == "i386"
.if ${MACHINE} == "i386" || ${MACHINE} == "amd64"
SRCS= umass.c umass_isdata.c umass_quirks.c umass_scsipi.c

SRCS+= umass_component.c
Expand Down

0 comments on commit c643ebb

Please sign in to comment.