pci: change pci_find_device
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
fc0720b118
commit
16b2e9de0a
3 changed files with 34 additions and 2 deletions
|
|
@ -52,7 +52,7 @@ void pci_config_write32(struct pci_host *host, u8 bus, u8 dev, u8 func, u16 reg,
|
|||
*addr = val;
|
||||
}
|
||||
|
||||
size_t pci_find_device(u16 minor, u16 major, list_t *out)
|
||||
size_t pci_find_device(u16 major, u16 minor, list_t *out)
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ struct pci_device {
|
|||
void pci_register_host(struct pci_host *host);
|
||||
u32 pci_config_read(struct pci_host *host, u32 bus, u32 slot, u32 func, u32 offset);
|
||||
void pci_config_write(struct pci_host *host, u32 bus, u32 slot, u32 func, u32 offset, u32 val);
|
||||
size_t pci_find_device(u16 minor, u16 major, list_t *out);
|
||||
size_t pci_find_device(u16 major, u16 minor, list_t *out);
|
||||
|
||||
#endif /* _PCI_H_ */
|
||||
|
|
|
|||
32
include/lib/endian.h
Normal file
32
include/lib/endian.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ENDIAN_H_
|
||||
#define _ENDIAN_H_
|
||||
|
||||
#include <kernel/types.h>
|
||||
|
||||
#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
#define htobe16(x) ((uint16_t)(x))
|
||||
#define htobe32(x) ((uint32_t)(x))
|
||||
#define htobe64(x) ((uint64_t)(x))
|
||||
|
||||
#define htole16(x) __builtin_bswap16(x)
|
||||
#define htole32(x) __builtin_bswap32(x)
|
||||
#define htole64(x) __builtin_bswap64(x)
|
||||
#else
|
||||
#define htobe16(x) __builtin_bswap16(x)
|
||||
#define htobe32(x) __builtin_bswap32(x)
|
||||
#define htobe64(x) __builtin_bswap64(x)
|
||||
|
||||
#define htole16(x) ((u16)(x))
|
||||
#define htole32(x) ((u32)(x))
|
||||
#define htole64(x) ((u64)(x))
|
||||
#endif
|
||||
#define betoh16(x) htobe16(x)
|
||||
#define betoh32(x) htobe32(x)
|
||||
#define betoh64(x) htobe64(x)
|
||||
|
||||
#define letoh16(x) htole16(x)
|
||||
#define letoh32(x) htole32(x)
|
||||
#define letoh64(x) htole64(x)
|
||||
|
||||
#endif /* _ENDIAN_H_ */
|
||||
Loading…
Reference in a new issue