cregit-Linux how code gets into the kernel

Release 4.14 arch/sh/drivers/pci/ops-dreamcast.c

/*
 * PCI operations for the Sega Dreamcast
 *
 * Copyright (C) 2001, 2002  M. R. Brown
 * Copyright (C) 2002, 2003  Paul Mundt
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */

#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/pci.h>
#include <linux/module.h>
#include <linux/io.h>
#include <mach/pci.h>

/*
 * The !gapspci_config_access case really shouldn't happen, ever, unless
 * someone implicitly messes around with the last devfn value.. otherwise we
 * only support a single device anyways, and if we didn't have a BBA, we
 * wouldn't make it terribly far through the PCI setup anyways.
 *
 * Also, we could very easily support both Type 0 and Type 1 configurations
 * here, but since it doesn't seem that there is any such implementation in
 * existence, we don't bother.
 *
 * I suppose if someone actually gets around to ripping the chip out of
 * the BBA and hanging some more devices off of it, then this might be
 * something to take into consideration. However, due to the cost of the BBA,
 * and the general lack of activity by DC hardware hackers, this doesn't seem
 * likely to happen anytime soon.
 */

static int gapspci_config_access(unsigned char bus, unsigned int devfn) { return (bus == 0) && (devfn == 0); }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton2281.48%133.33%
Hanna V. Linder311.11%133.33%
Linus Torvalds27.41%133.33%
Total27100.00%3100.00%

/* * We can also actually read and write in b/w/l sizes! Thankfully this part * was at least done right, and we don't have to do the stupid masking and * shifting that we do on the 7751! Small wonders never cease to amaze. */
static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) { *val = 0xffffffff; if (!gapspci_config_access(bus->number, devfn)) return PCIBIOS_DEVICE_NOT_FOUND; switch (size) { case 1: *val = inb(GAPSPCI_BBA_CONFIG+where); break; case 2: *val = inw(GAPSPCI_BBA_CONFIG+where); break; case 4: *val = inl(GAPSPCI_BBA_CONFIG+where); break; } return PCIBIOS_SUCCESSFUL; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds4951.04%125.00%
Hanna V. Linder2425.00%125.00%
Andrew Morton2020.83%125.00%
Magnus Damm33.12%125.00%
Total96100.00%4100.00%


static int gapspci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) { if (!gapspci_config_access(bus->number, devfn)) return PCIBIOS_DEVICE_NOT_FOUND; switch (size) { case 1: outb(( u8)val, GAPSPCI_BBA_CONFIG+where); break; case 2: outw((u16)val, GAPSPCI_BBA_CONFIG+where); break; case 4: outl((u32)val, GAPSPCI_BBA_CONFIG+where); break; } return PCIBIOS_SUCCESSFUL; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds4344.79%125.00%
Hanna V. Linder4041.67%125.00%
Andrew Morton1010.42%125.00%
Magnus Damm33.12%125.00%
Total96100.00%4100.00%

struct pci_ops gapspci_pci_ops = { .read = gapspci_read, .write = gapspci_write, };

Overall Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds12546.64%111.11%
Hanna V. Linder7628.36%111.11%
Andrew Morton5319.78%111.11%
Magnus Damm62.24%111.11%
Paul Mundt41.49%333.33%
Adrian Bunk31.12%111.11%
Simon Arlott10.37%111.11%
Total268100.00%9100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.