git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chore: fix almost *ALL* warnings.
[lunaix-os.git]
/
lunaix-os
/
hal
/
pci.c
diff --git
a/lunaix-os/hal/pci.c
b/lunaix-os/hal/pci.c
index cb7cfe75351ca7ad6e1b48f14298827c7bd70f34..96cd676de3ef790de0e26b21fcbf42c66b8333f2 100644
(file)
--- a/
lunaix-os/hal/pci.c
+++ b/
lunaix-os/hal/pci.c
@@
-28,7
+28,7
@@
pci_probe_msi_info(struct pci_device* device);
void
pci_probe_device(int bus, int dev, int funct)
{
void
pci_probe_device(int bus, int dev, int funct)
{
- u
int
32_t base = PCI_ADDRESS(bus, dev, funct);
+ u32_t base = PCI_ADDRESS(bus, dev, funct);
pci_reg_t reg1 = pci_read_cspace(base, 0);
// Vendor=0xffff则表示设备不存在
pci_reg_t reg1 = pci_read_cspace(base, 0);
// Vendor=0xffff则表示设备不存在
@@
-102,7
+102,7
@@
pci_probe()
void
pci_probe_bar_info(struct pci_device* device)
{
void
pci_probe_bar_info(struct pci_device* device)
{
- u
int
32_t bar;
+ u32_t bar;
struct pci_base_addr* ba;
for (size_t i = 0; i < 6; i++) {
ba = &device->bar[i];
struct pci_base_addr* ba;
for (size_t i = 0; i < 6; i++) {
ba = &device->bar[i];
@@
-132,7
+132,7
@@
pci_probe_msi_info(struct pci_device* device)
}
pci_reg_t cap_ptr = pci_read_cspace(device->cspace_base, 0x34) & 0xff;
}
pci_reg_t cap_ptr = pci_read_cspace(device->cspace_base, 0x34) & 0xff;
- u
int
32_t cap_hdr;
+ u32_t cap_hdr;
while (cap_ptr) {
cap_hdr = pci_read_cspace(device->cspace_base, cap_ptr);
while (cap_ptr) {
cap_hdr = pci_read_cspace(device->cspace_base, cap_ptr);
@@
-242,7
+242,7
@@
pci_build_fsmapping()
}
size_t
}
size_t
-pci_bar_sizing(struct pci_device* dev, u
int32_t* bar_out, uint
32_t bar_num)
+pci_bar_sizing(struct pci_device* dev, u
32_t* bar_out, u
32_t bar_num)
{
pci_reg_t bar = pci_read_cspace(dev->cspace_base, PCI_REG_BAR(bar_num));
if (!bar) {
{
pci_reg_t bar = pci_read_cspace(dev->cspace_base, PCI_REG_BAR(bar_num));
if (!bar) {
@@
-265,10
+265,10
@@
void
pci_setup_msi(struct pci_device* device, int vector)
{
// Dest: APIC#0, Physical Destination, No redirection
pci_setup_msi(struct pci_device* device, int vector)
{
// Dest: APIC#0, Physical Destination, No redirection
- u
int
32_t msi_addr = (__APIC_BASE_PADDR);
+ u32_t msi_addr = (__APIC_BASE_PADDR);
// Edge trigger, Fixed delivery
// Edge trigger, Fixed delivery
- u
int
32_t msi_data = vector;
+ u32_t msi_data = vector;
pci_write_cspace(
device->cspace_base, PCI_MSI_ADDR(device->msi_loc), msi_addr);
pci_write_cspace(
device->cspace_base, PCI_MSI_ADDR(device->msi_loc), msi_addr);
@@
-292,9
+292,9
@@
pci_setup_msi(struct pci_device* device, int vector)
}
struct pci_device*
}
struct pci_device*
-pci_get_device_by_id(u
int16_t vendorId, uint
16_t deviceId)
+pci_get_device_by_id(u
16_t vendorId, u
16_t deviceId)
{
{
- u
int
32_t dev_info = vendorId | (deviceId << 16);
+ u32_t dev_info = vendorId | (deviceId << 16);
struct pci_device *pos, *n;
llist_for_each(pos, n, &pci_devices, dev_chain)
{
struct pci_device *pos, *n;
llist_for_each(pos, n, &pci_devices, dev_chain)
{
@@
-307,7
+307,7
@@
pci_get_device_by_id(uint16_t vendorId, uint16_t deviceId)
}
struct pci_device*
}
struct pci_device*
-pci_get_device_by_class(u
int
32_t class)
+pci_get_device_by_class(u32_t class)
{
struct pci_device *pos, *n;
llist_for_each(pos, n, &pci_devices, dev_chain)
{
struct pci_device *pos, *n;
llist_for_each(pos, n, &pci_devices, dev_chain)