coreboot-kgpe-d16/src/soc/amd/stoneyridge/nb_util.c
Patrick Rudolph e56189cfd1 pci: Move inline PCI functions to pci_ops.h
Move inline function where they belong to. Fixes compilation
on non x86 platforms.

Change-Id: Ia05391c43b8d501bd68df5654bcfb587f8786f71
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/25720
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-04-20 13:03:54 +00:00

40 lines
1.1 KiB
C

/*
* This file is part of the coreboot project.
*
* Copyright (C) 2018 Advanced Micro Devices
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <soc/northbridge.h>
#include <soc/pci_devs.h>
#include <device/pci_ops.h>
uint32_t nb_ioapic_read(unsigned int index)
{
pci_write_config32(SOC_GNB_DEV, NB_IOAPIC_INDEX, index);
return pci_read_config32(SOC_GNB_DEV, NB_IOAPIC_DATA);
}
void nb_ioapic_write(unsigned int index, uint32_t value)
{
pci_write_config32(SOC_GNB_DEV, NB_IOAPIC_INDEX, index);
pci_write_config32(SOC_GNB_DEV, NB_IOAPIC_DATA, value);
}
void *get_ap_entry_ptr(void)
{
return (void *)nb_ioapic_read(AP_SCRATCH_REG);
}
void set_ap_entry_ptr(void *entry)
{
nb_ioapic_write(AP_SCRATCH_REG, (uintptr_t)entry);
}