TODO
- x86emu need (imo) some common header with prototypes at least
- clog2, ulzma, hardwaremain prototypes added by this patch probably should
be moved to some header too.
- in src/devices/device_util.c prototype is before function because seems,
it is used only within same file, if not it should be moved to debug
section of prototypes in include/device/device.h
Signed-off-by: Maciej Pijanka <maciej.pijanka@gmail.com>
Acked-by: Myles Watson <mylesgw@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4871
2b7e53f0-3cfb-0310-b3e9-
8179ed1497e1
} __attribute__((packed));
// Copy GDT to new location and reload it
+void move_gdt(void);
void move_gdt(void)
{
void *newgdt;
uint64_t high_tables_base = 0;
uint64_t high_tables_size;
-void cbmem_list(void);
-
void move_gdt(void);
void cbmem_arch_init(void)
{
*/
#define div_long_long_rem(a,b,c) div_ll_X_l_rem(a,b,c)
+extern inline long
+div_ll_X_l_rem(long long divs, long div, long *rem);
+
extern inline long
div_ll_X_l_rem(long long divs, long div, long *rem)
{
#include <arch/registers.h>
+void x86_exception(struct eregs *info);
+
void x86_exception(struct eregs *info)
{
#if CONFIG_GDB_STUB == 1
#define console_loglevel CONFIG_DEFAULT_CONSOLE_LOGLEVEL
#endif
+void console_tx_byte(unsigned char byte);
+int do_printk(int msg_level, const char *fmt, ...);
+
void console_tx_byte(unsigned char byte)
{
if (byte == '\n')
* In the dev_enumerate() phase,
*/
+void hardwaremain(int boot_complete);
+
void hardwaremain(int boot_complete)
{
struct lb_memory *lb_mem;
}
}
-void resource_tree(struct device *root, int debug_level, int depth)
+static void resource_tree(struct device *root, int debug_level, int depth)
{
int i = 0, link = 0;
struct device *child;
int cbmem_reinit(u64 baseaddr);
void *cbmem_add(u32 id, u64 size);
void *cbmem_find(u32 id);
+void cbmem_list(void);
+void cbmem_arch_init(void);
#endif
#if !defined(__ROMCC__) && !defined (ASSEMBLY)
+#include <device/device.h>
+void enable_fixed_mtrr(void);
void x86_setup_var_mtrrs(unsigned address_bits);
void x86_setup_mtrrs(unsigned address_bits);
int x86_mtrr_check(void);
+void set_var_mtrr_resource(void *gp, struct device *dev, struct resource *res);
+void x86_setup_fixed_mtrrs(void);
#endif /* __ROMCC__ */
asm volatile ("rdtsc" : "=A" (val));
return val;
}
+
+void init_timer(void);
#endif
void show_devs_tree(struct device *dev, int debug_level, int depth, int linknum);
void show_devs_subtree(struct device *root, int debug_level, const char *msg);
void show_all_devs(int debug_level, const char *msg);
+void show_all_devs_tree(int debug_level, const char *msg);
void show_one_resource(int debug_level, struct device *dev,
struct resource *resource, const char *comment);
void show_all_devs_resources(int debug_level, const char* msg);
void root_dev_enable_resources(device_t dev);
unsigned int root_dev_scan_bus(device_t root, unsigned int max);
void root_dev_init(device_t dev);
+void root_dev_reset(struct bus *bus);
#endif /* DEVICE_H */
struct cbmem_entry *cbmem_toc;
cbmem_toc = (struct cbmem_entry *)(unsigned long)baseaddr;
- debug("Re-Initializing CBMEM area to 0x%lx\n", baseaddr);
+ debug("Re-Initializing CBMEM area to 0x%lx\n", (unsigned long)baseaddr);
#ifndef __ROMCC__
bss_cbmem_toc = cbmem_toc;
#endif
#endif
if (cbmem_toc == NULL)
- return NULL;
+ return;
for (i = 0; i < MAX_CBMEM_ENTRIES; i++) {
/* Assume 8 bits per byte */
#define CHAR_BIT 8
+unsigned long log2(unsigned long x);
+
unsigned long log2(unsigned long x)
{
// assume 8 bits per byte.
#include <console/console.h>
#include <string.h>
+unsigned long ulzma(unsigned char * src, unsigned char * dst);
unsigned long ulzma(unsigned char * src, unsigned char * dst)
{
void rtc_init(int invalid)
{
+#if CONFIG_HAVE_OPTION_TABLE
unsigned char x;
int cmos_invalid, checksum_invalid;
+#endif
printk_debug("RTC Init\n");
#include <arch/io.h>
+#include <delay.h>
void udelay(unsigned usecs)
{
#ifndef __ROMCC__
#include "chip.h"
void i82371eb_enable(device_t dev);
+void i82371eb_hard_reset(void);
#endif
/* If 'cond' is true this macro sets the bit(s) specified by 'bits' in the
static void isa_init(struct device *dev)
{
- u16 reg16;
u32 reg32;
/* Initialize the real time clock (RTC). */
};
void x86_exception(struct eregs *info);
+void run_bios(struct device *dev, unsigned long addr);
extern unsigned char __idt_handler, __idt_handler_size;
extern unsigned char __realmode_code, __realmode_code_size;
void run_bios(struct device *dev, unsigned long addr)
{
- int i;
-
/* clear vga bios data area */
memset(0x400, 0, 0x200);
PCIBIOS_BADREG = 0x8700
};
+int int12_handler(struct eregs *regs);
+int int1a_handler(struct eregs *regs);
+int int15_handler(struct eregs *regs);
+
int int12_handler(struct eregs *regs)
{
regs->eax = 64 * 1024;