2 * This file is part of the coreboot project.
4 * Copyright (C) 2007 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #error "FILECODE was not defined, should be #define'd to 0xFxxx"
29 /* include LinuxBIOS pci functions */
30 #include <device/pci_def.h>
31 #include <device/pci_ids.h>
34 #define ASSERT(x) ((x) ? 0 : ErrorStop(((uint32)FILECODE)*0x10000 + ((__LINE__)%10) + (((__LINE__/10)%10)*0x10) + (((__LINE__/100)%10)*0x100) +(((__LINE__/1000)%10)*0x1000)))
39 #ifdef AMD_DEBUG_ERROR_STOP
40 /* Macro to aid debugging, causes program to halt and display the line number of the halt in decimal */
41 #define STOP_HERE ErrorStop(((uint32)FILECODE)*0x10000 + ((__LINE__)%10) + (((__LINE__/10)%10)*0x10) + (((__LINE__/100)%10)*0x100) +(((__LINE__/1000)%10)*0x1000))
43 /* Macro to aid debugging, causes program to halt and display the line number of the halt in decimal */
44 /* #define STOP_HERE STOP_HERE_OnlyForDebugUse */
48 void CALLCONV AmdPCIReadBits(SBDFO loc, uint8 highbit, uint8 lowbit, uint32 *value);
49 void CALLCONV AmdPCIWriteBits(SBDFO loc, uint8 highbit, uint8 lowbit, uint32 *value);
50 void CALLCONV AmdPCIFindNextCap(SBDFO *current);
52 void CALLCONV Amdmemcpy(void *dst, const void *src, uint32 length);
53 void CALLCONV Amdmemset(void *buf, uint8 val, uint32 length);
55 uint8 CALLCONV AmdBitScanReverse(uint32 value);
56 uint32 CALLCONV AmdRotateRight(uint32 value, uint8 size, uint32 count);
57 uint32 CALLCONV AmdRotateLeft(uint32 value, uint8 size, uint32 count);