mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 11:55:24 +00:00
lx_emul: provide more pci functions
- pci_dev_present() based on devices on bus - pci_request_regions() as dummy - pci_release_regions() as dummy
This commit is contained in:
parent
0fa683f244
commit
6d14f5442e
@ -1,3 +1,17 @@
|
||||
/*
|
||||
* \brief Replaces drivers/pci/pci.c
|
||||
* \author Stefan Kalkowski
|
||||
* \author Christian Helmuth
|
||||
* \date 2021-03-16
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2021 Genode Labs GmbH
|
||||
*
|
||||
* This file is distributed under the terms of the GNU General Public License
|
||||
* version 2.
|
||||
*/
|
||||
|
||||
#include <linux/pci.h>
|
||||
#include <lx_emul/pci.h>
|
||||
|
||||
@ -40,3 +54,12 @@ u8 pci_find_capability(struct pci_dev * dev,int cap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void pci_release_regions(struct pci_dev *pdev) { }
|
||||
|
||||
|
||||
int pci_request_regions(struct pci_dev *pdev, const char *res_name)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,22 @@
|
||||
/*
|
||||
* \brief Replaces drivers/pci/search.c
|
||||
* \author Stefan Kalkowski
|
||||
* \author Christian Helmuth
|
||||
* \date 2021-03-16
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2021 Genode Labs GmbH
|
||||
*
|
||||
* This file is distributed under the terms of the GNU General Public License
|
||||
* version 2.
|
||||
*/
|
||||
|
||||
#include <lx_emul/pci.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include "../drivers/pci/pci.h"
|
||||
|
||||
struct pci_dev * pci_get_class(unsigned int class, struct pci_dev *from)
|
||||
{
|
||||
struct pci_dev *dev;
|
||||
@ -42,3 +58,20 @@ struct pci_dev * pci_get_device(unsigned int vendor,unsigned int device,struct p
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int pci_dev_present(const struct pci_device_id *ids)
|
||||
{
|
||||
struct pci_dev *dev;
|
||||
struct pci_bus *bus = (struct pci_bus *) lx_emul_pci_root_bus();
|
||||
|
||||
while (ids->vendor || ids->subvendor || ids->class_mask) {
|
||||
list_for_each_entry(dev, &bus->devices, bus_list) {
|
||||
if (pci_match_one_device(ids, dev))
|
||||
return 1;
|
||||
}
|
||||
ids++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1596,14 +1596,6 @@ int pagecache_write_end(struct file * file,struct address_space * mapping,loff_t
|
||||
enum reboot_mode panic_reboot_mode;
|
||||
|
||||
|
||||
#include <linux/pci.h>
|
||||
|
||||
int pci_dev_present(const struct pci_device_id * ids)
|
||||
{
|
||||
lx_emul_trace_and_stop(__func__);
|
||||
}
|
||||
|
||||
|
||||
#include <linux/pci.h>
|
||||
|
||||
void pci_disable_device(struct pci_dev * dev)
|
||||
|
Loading…
x
Reference in New Issue
Block a user