Code changes from my work and the AMD760MP chipset.

The primary changes is the way in which printk works.
But there are many other assorted code cleanups.
Just look and see :)
This commit is contained in:
Eric W. Biederman 2001-08-08 02:45:10 +00:00
commit ed8c9d7e0d
62 changed files with 1362 additions and 977 deletions

View file

@ -1,25 +1,25 @@
#ifndef _INTEL_CPUID_H_
#define _INTEL_CPUID_H_
#ifndef CPU_P5_CPUID_H
#define CPU_P5_CPUID_H
#ifdef i586
int intel_mtrr_check(void);
#endif
void intel_display_cpuid(void);
int mtrr_check(void);
void display_cpuid(void);
/*
* Generic CPUID function. copied from Linux kernel headers
*/
extern inline void intel_cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
{
__asm__("cpuid"
__asm__("pushl %%ebx\n\t"
"cpuid\n\t"
"movl %%ebx, %%esi\n\t"
"popl %%ebx\n\t"
: "=a" (*eax),
"=b" (*ebx),
"=S" (*ebx),
"=c" (*ecx),
"=d" (*edx)
: "a" (op)
: "cc");
}
#endif /* _INTEL_CPUID_H_ */
#endif /* CPU_P5_CPUID_H */

View file

@ -15,4 +15,6 @@
#define BBL_CR_BUSY 0x11B
#define BBL_CR_CTL3 0x11E
extern int p6_configure_l2_cache(void);
#endif /* __LINUXBIOS_P6_L2_CACHE_H */

View file

@ -1,3 +1,6 @@
#ifndef CPU_P6_MSR_H
#define CPU_P6_MSR_H
/*
* Access to machine-specific registers (available on 586 and better only)
* Note: the rd* operations modify the parameters directly (without using
@ -27,4 +30,4 @@
__asm__ __volatile__("rdpmc" \
: "=a" (low), "=d" (high) \
: "c" (counter))
#endif /* CPU_P6_MSR_H */

View file

@ -1,5 +1,5 @@
#ifndef __LINUXBIOS_MTRR_H
#define __LINUXBIOS_MTRR_H
#ifndef __LINUXBIOS_CPU_P6_MTRR_H
#define __LINUXBIOS_CPU_P6_MTRR_H
/* These are the region types */
#define MTRR_TYPE_UNCACHABLE 0
@ -30,4 +30,13 @@
#define MTRRfix4K_F0000_MSR 0x26e
#define MTRRfix4K_F8000_MSR 0x26f
#endif /* __LINUXBIOS_MTRR_H */
#if !defined(ASSEMBLY)
#if defined(INTEL_PPRO_MTRR)
void setup_mtrrs(unsigned long ramsizeK);
#endif
#endif /* ASSEMBLY */
#endif /* __LINUXBIOS_CPU_P6_MTRR_H */

View file

@ -423,6 +423,7 @@ void pci_set_method(void);
void pci_enumerate(void);
void pci_configure(void);
void pci_enable(void);
void pci_zero_irq_settings(void);
// historical functions ...
void intel_conf_writeb(unsigned long port, unsigned char value);

View file

@ -1,27 +1,68 @@
#ifndef PRINTK_H
#define PRINTK_H
/* These defines copied from linux/include/linux/kernel.h */
#ifndef MAXIMUM_CONSOLE_LOGLEVEL
#define MAXIMUM_CONSOLE_LOGLEVEL 8
#endif
#define KERN_EMERG "<0>" /* system is unusable */
#define KERN_ALERT "<1>" /* action must be taken immediately */
#define KERN_CRIT "<2>" /* critical conditions */
#define KERN_ERR "<3>" /* error conditions */
#define KERN_WARNING "<4>" /* warning conditions */
#define KERN_NOTICE "<5>" /* normal but significant condition */
#define KERN_INFO "<6>" /* informational */
#define KERN_DEBUG "<7>" /* debug-level messages */
#define KERN_SPEW "<8>" /* Way too many details */
#define BIOS_EMERG 0 /* system is unusable */
#define BIOS_ALERT 1 /* action must be taken immediately */
#define BIOS_CRIT 2 /* critical conditions */
#define BIOS_ERR 3 /* error conditions */
#define BIOS_WARNING 4 /* warning conditions */
#define BIOS_NOTICE 5 /* normal but significant condition */
#define BIOS_INFO 6 /* informational */
#define BIOS_DEBUG 7 /* debug-level messages */
#define BIOS_SPEW 8 /* Way too many details */
extern int console_loglevel;
int printk(const char *fmt, ...);
int do_printk(int msg_level, const char *fmt, ...);
#ifdef DEBUG
#define DBG(x...) printk(KERN_DEBUG x)
#define PRINTK(x...) printk(x)
#else
#define DBG(x...)
#define PRINTK(x...)
#define printk_emerg(fmt, arg...) do_printk(BIOS_EMERG ,fmt, ##arg)
#define printk_alart(fmt, arg...) do_printk(BIOS_ALERT ,fmt, ##arg)
#define printk_crit(fmt, arg...) do_printk(BIOS_CRIT ,fmt, ##arg)
#define printk_err(fmt, arg...) do_printk(BIOS_ERR ,fmt, ##arg)
#define printk_warning(fmt, arg...) do_printk(BIOS_WARNING ,fmt, ##arg)
#define printk_notice(fmt, arg...) do_printk(BIOS_NOTICE ,fmt, ##arg)
#define printk_info(fmt, arg...) do_printk(BIOS_INFO ,fmt, ##arg)
#define printk_debug(fmt, arg...) do_printk(BIOS_DEBUG ,fmt, ##arg)
#define printk_spew(fmt, arg...) do_printk(BIOS_SPEW ,fmt, ##arg)
#if MAXIMUM_CONSOLE_LOGLEVEL <= 0
#undef printk_emerg
#define printk_emerg(fmt, arg...) do {} while(0)
#endif
#if MAXIMUM_CONSOLE_LOGLEVEL <= 1
#undef printk_alert
#define printk_alart(fmt, arg...) do {} while(0)
#endif
#if MAXIMUM_CONSOLE_LOGLEVEL <= 2
#undef printk_crit
#define printk_crit(fmt, arg...) do {} while(0)
#endif
#if MAXIMUM_CONSOLE_LOGLEVEL <= 3
#undef printk_err
#define printk_err(fmt, arg...) do {} while(0)
#endif
#if MAXIMUM_CONSOLE_LOGLEVEL <= 4
#undef printk_warning
#define printk_warning(fmt, arg...) do {} while(0)
#endif
#if MAXIMUM_CONSOLE_LOGLEVEL <= 5
#undef printk_notice
#define printk_notice(fmt, arg...) do {} while(0)
#endif
#if MAXIMUM_CONSOLE_LOGLEVEL <= 6
#undef printk_info
#define printk_info(fmt, arg...) do {} while(0)
#endif
#if MAXIMUM_CONSOLE_LOGLEVEL <= 7
#undef printk_debug
#define printk_debug(fmt, arg...) do {} while(0)
#endif
#if MAXIMUM_CONSOLE_LOGLEVEL <= 8
#undef printk_spew
#define printk_spew(fmt, arg...) do {} while(0)
#endif
#endif

View file

@ -3,5 +3,8 @@
void ttys0_init(void);
void ttys0_tx_byte(unsigned char data);
unsigned char ttys0_rx_byte(void);
unsigned long ttys0_rx_bytes(char *buffer, unsigned long size);
void uart_init(unsigned base_port, unsigned divisor);
#endif /* _SERIAL_SUBR_H_ */