arch/x86: Fix space issues detected by checkpatch
Fix the following errors and warnings detected by checkpatch.pl: ERROR: space required before the open parenthesis '(' ERROR: space prohibited after that open parenthesis '(' ERROR: space prohibited before that close parenthesis ')' ERROR: space prohibited after that open square bracket '[' ERROR: space required after that ',' (ctx:VxV) ERROR: space prohibited before that ',' (ctx:WxW) ERROR: space required after that ';' (ctx:VxV) ERROR: spaces required around that ':' (ctx:ExV) ERROR: spaces required around that ':' (ctx:VxW) ERROR: spaces required around that ':' (ctx:WxV) ERROR: spaces required around that '=' (ctx:VxV) ERROR: spaces required around that '+=' (ctx:VxV) ERROR: spaces required around that '<=' (ctx:WxV) ERROR: spaces required around that '||' (ctx:VxW) ERROR: space prohibited before that '++' (ctx:WxO) ERROR: need consistent spacing around '+' (ctx:WxV) ERROR: spaces required around that '<' (ctx:WxV) ERROR: spaces required around that '<' (ctx:VxV) ERROR: need consistent spacing around '>>' (ctx:WxV) ERROR: "(foo*)" should be "(foo *)" ERROR: "foo* bar" should be "foo *bar" ERROR: "foo * bar" should be "foo *bar" ERROR: code indent should use tabs where possible WARNING: space prohibited between function name and open parenthesis '(' WARNING: unnecessary whitespace before a quoted newline WARNING: please, no spaces at the start of a line WARNING: please, no space before tabs WARNING: Unnecessary space before function pointer arguments TEST=Build and run on Galileo Gen2 Change-Id: I2d7e1a329c6b2e8ca9633a97b595566544d7fd33 Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com> Reviewed-on: https://review.coreboot.org/18862 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
@ -272,7 +272,7 @@ static void *get_tcpa_log(u32 *size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "TCPA log created at %p\n", lasa);
|
printk(BIOS_DEBUG, "TCPA log created at %p\n", lasa);
|
||||||
memset (lasa, 0, tcpa_default_log_len);
|
memset(lasa, 0, tcpa_default_log_len);
|
||||||
|
|
||||||
*size = tcpa_default_log_len;
|
*size = tcpa_default_log_len;
|
||||||
return lasa;
|
return lasa;
|
||||||
@ -420,7 +420,7 @@ void acpi_create_srat(acpi_srat_t *srat,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void acpi_create_dmar(acpi_dmar_t *dmar, enum dmar_flags flags,
|
void acpi_create_dmar(acpi_dmar_t *dmar, enum dmar_flags flags,
|
||||||
unsigned long (*acpi_fill_dmar) (unsigned long))
|
unsigned long (*acpi_fill_dmar)(unsigned long))
|
||||||
{
|
{
|
||||||
acpi_header_t *header = &(dmar->header);
|
acpi_header_t *header = &(dmar->header);
|
||||||
unsigned long current = (unsigned long)dmar + sizeof(acpi_dmar_t);
|
unsigned long current = (unsigned long)dmar + sizeof(acpi_dmar_t);
|
||||||
@ -580,7 +580,7 @@ void acpi_create_hpet(acpi_hpet_t *hpet)
|
|||||||
addr->addrl = CONFIG_HPET_ADDRESS & 0xffffffff;
|
addr->addrl = CONFIG_HPET_ADDRESS & 0xffffffff;
|
||||||
addr->addrh = ((unsigned long long)CONFIG_HPET_ADDRESS) >> 32;
|
addr->addrh = ((unsigned long long)CONFIG_HPET_ADDRESS) >> 32;
|
||||||
|
|
||||||
hpet->id = *(unsigned int*)CONFIG_HPET_ADDRESS;
|
hpet->id = *(unsigned int *)CONFIG_HPET_ADDRESS;
|
||||||
hpet->number = 0;
|
hpet->number = 0;
|
||||||
hpet->min_tick = CONFIG_HPET_MIN_TICKS;
|
hpet->min_tick = CONFIG_HPET_MIN_TICKS;
|
||||||
|
|
||||||
@ -613,7 +613,7 @@ void acpi_create_vfct(struct device *device,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void acpi_create_ivrs(acpi_ivrs_t *ivrs,
|
void acpi_create_ivrs(acpi_ivrs_t *ivrs,
|
||||||
unsigned long (*acpi_fill_ivrs)(acpi_ivrs_t* ivrs_struct, unsigned long current))
|
unsigned long (*acpi_fill_ivrs)(acpi_ivrs_t *ivrs_struct, unsigned long current))
|
||||||
{
|
{
|
||||||
acpi_header_t *header = &(ivrs->header);
|
acpi_header_t *header = &(ivrs->header);
|
||||||
unsigned long current = (unsigned long)ivrs + sizeof(acpi_ivrs_t);
|
unsigned long current = (unsigned long)ivrs + sizeof(acpi_ivrs_t);
|
||||||
@ -786,7 +786,7 @@ unsigned long acpi_create_hest_error_source(acpi_hest_t *hest, acpi_hest_esd_t *
|
|||||||
printk(BIOS_DEBUG, "Invalid type of Error Source.");
|
printk(BIOS_DEBUG, "Invalid type of Error Source.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
hest->error_source_count ++;
|
hest->error_source_count++;
|
||||||
|
|
||||||
memcpy(pos, data, data_len);
|
memcpy(pos, data, data_len);
|
||||||
len += data_len;
|
len += data_len;
|
||||||
@ -817,7 +817,7 @@ void acpi_write_hest(acpi_hest_t *hest,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_COMMON_FADT)
|
#if IS_ENABLED(CONFIG_COMMON_FADT)
|
||||||
void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs, void *dsdt)
|
void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt)
|
||||||
{
|
{
|
||||||
acpi_header_t *header = &(fadt->header);
|
acpi_header_t *header = &(fadt->header);
|
||||||
|
|
||||||
@ -1015,8 +1015,8 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
madt = (acpi_madt_t *) current;
|
madt = (acpi_madt_t *) current;
|
||||||
acpi_create_madt(madt);
|
acpi_create_madt(madt);
|
||||||
if (madt->header.length > sizeof(acpi_madt_t)) {
|
if (madt->header.length > sizeof(acpi_madt_t)) {
|
||||||
current+=madt->header.length;
|
current += madt->header.length;
|
||||||
acpi_add_table(rsdp,madt);
|
acpi_add_table(rsdp, madt);
|
||||||
}
|
}
|
||||||
current = acpi_align_current(current);
|
current = acpi_align_current(current);
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ void *acpi_backup_container(uintptr_t base, size_t size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
backup_mem->valid = 1;
|
backup_mem->valid = 1;
|
||||||
return (void*)(uintptr_t)backup_mem->cbmem;
|
return (void *)(uintptr_t)backup_mem->cbmem;
|
||||||
}
|
}
|
||||||
|
|
||||||
void backup_ramstage_section(uintptr_t base, size_t size)
|
void backup_ramstage_section(uintptr_t base, size_t size)
|
||||||
@ -157,8 +157,8 @@ void backup_ramstage_section(uintptr_t base, size_t size)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Back up the OS-controlled memory where ramstage will be loaded. */
|
/* Back up the OS-controlled memory where ramstage will be loaded. */
|
||||||
memcpy((void*)(uintptr_t)backup_mem->cbmem,
|
memcpy((void *)(uintptr_t)backup_mem->cbmem,
|
||||||
(void*)(uintptr_t)backup_mem->lowmem, (size_t)backup_mem->size);
|
(void *)(uintptr_t)backup_mem->lowmem, (size_t)backup_mem->size);
|
||||||
backup_mem->valid = 1;
|
backup_mem->valid = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,8 +174,8 @@ void acpi_prepare_for_resume(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Back up the OS-controlled memory where ramstage will be loaded. */
|
/* Back up the OS-controlled memory where ramstage will be loaded. */
|
||||||
memcpy((void*)(uintptr_t)backup_mem->cbmem,
|
memcpy((void *)(uintptr_t)backup_mem->cbmem,
|
||||||
(void*)(uintptr_t)backup_mem->lowmem, (size_t)backup_mem->size);
|
(void *)(uintptr_t)backup_mem->lowmem, (size_t)backup_mem->size);
|
||||||
backup_mem->valid = 1;
|
backup_mem->valid = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,13 +24,13 @@ static void jmp_payload_no_bounce_buffer(void *entry)
|
|||||||
{
|
{
|
||||||
/* Jump to kernel */
|
/* Jump to kernel */
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
" cld \n\t"
|
" cld\n\t"
|
||||||
/* Now jump to the loaded image */
|
/* Now jump to the loaded image */
|
||||||
" call *%0\n\t"
|
" call *%0\n\t"
|
||||||
|
|
||||||
/* The loaded image returned? */
|
/* The loaded image returned? */
|
||||||
" cli \n\t"
|
" cli\n\t"
|
||||||
" cld \n\t"
|
" cld\n\t"
|
||||||
|
|
||||||
::
|
::
|
||||||
"r" (entry)
|
"r" (entry)
|
||||||
@ -51,7 +51,7 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size)
|
|||||||
|
|
||||||
/* Jump to kernel */
|
/* Jump to kernel */
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
" cld \n\t"
|
" cld\n\t"
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
/* switch back to 32-bit mode */
|
/* switch back to 32-bit mode */
|
||||||
" push %4\n\t"
|
" push %4\n\t"
|
||||||
@ -138,7 +138,7 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size)
|
|||||||
" movl $1f, %%eax\n\t"
|
" movl $1f, %%eax\n\t"
|
||||||
" addl 20(%%esp), %%eax\n\t"
|
" addl 20(%%esp), %%eax\n\t"
|
||||||
" jmp *%%eax\n\t"
|
" jmp *%%eax\n\t"
|
||||||
"1: \n\t"
|
"1:\n\t"
|
||||||
|
|
||||||
/* Copy the coreboot bounce buffer over coreboot */
|
/* Copy the coreboot bounce buffer over coreboot */
|
||||||
/* Move ``longs'' the coreboot size is 4 byte aligned */
|
/* Move ``longs'' the coreboot size is 4 byte aligned */
|
||||||
@ -154,8 +154,8 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size)
|
|||||||
" call *4(%%esp)\n\t"
|
" call *4(%%esp)\n\t"
|
||||||
|
|
||||||
/* The loaded image returned? */
|
/* The loaded image returned? */
|
||||||
" cli \n\t"
|
" cli\n\t"
|
||||||
" cld \n\t"
|
" cld\n\t"
|
||||||
|
|
||||||
/* Copy the saved copy of coreboot where coreboot runs */
|
/* Copy the saved copy of coreboot where coreboot runs */
|
||||||
/* Move ``longs'' the coreboot size is 4 byte aligned */
|
/* Move ``longs'' the coreboot size is 4 byte aligned */
|
||||||
@ -173,7 +173,7 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size)
|
|||||||
" movl $1f, %%eax\n\t"
|
" movl $1f, %%eax\n\t"
|
||||||
" subl 20(%%esp), %%eax\n\t"
|
" subl 20(%%esp), %%eax\n\t"
|
||||||
" jmp *%%eax\n\t"
|
" jmp *%%eax\n\t"
|
||||||
"1: \n\t"
|
"1:\n\t"
|
||||||
|
|
||||||
/* Drop the parameters I was passed */
|
/* Drop the parameters I was passed */
|
||||||
" addl $24, %%esp\n\t"
|
" addl $24, %%esp\n\t"
|
||||||
|
@ -29,9 +29,9 @@ static void main(unsigned long bist)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_SEPARATE_VERSTAGE
|
#if CONFIG_SEPARATE_VERSTAGE
|
||||||
const char* target1 = "fallback/verstage";
|
const char *target1 = "fallback/verstage";
|
||||||
#else
|
#else
|
||||||
const char* target1 = "fallback/romstage";
|
const char *target1 = "fallback/romstage";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned long entry;
|
unsigned long entry;
|
||||||
|
@ -93,7 +93,7 @@ static int deep_magic_nexgen_probe(void)
|
|||||||
" jnz 1f\n"
|
" jnz 1f\n"
|
||||||
" movl $1, %%eax\n"
|
" movl $1, %%eax\n"
|
||||||
"1:\n"
|
"1:\n"
|
||||||
: "=a" (ret) : : "cx", "dx" );
|
: "=a" (ret) : : "cx", "dx");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -169,16 +169,16 @@ static void identify_cpu(struct device *cpu)
|
|||||||
struct cpuid_result result;
|
struct cpuid_result result;
|
||||||
result = cpuid(0x00000000);
|
result = cpuid(0x00000000);
|
||||||
cpuid_level = result.eax;
|
cpuid_level = result.eax;
|
||||||
vendor_name[ 0] = (result.ebx >> 0) & 0xff;
|
vendor_name[0] = (result.ebx >> 0) & 0xff;
|
||||||
vendor_name[ 1] = (result.ebx >> 8) & 0xff;
|
vendor_name[1] = (result.ebx >> 8) & 0xff;
|
||||||
vendor_name[ 2] = (result.ebx >> 16) & 0xff;
|
vendor_name[2] = (result.ebx >> 16) & 0xff;
|
||||||
vendor_name[ 3] = (result.ebx >> 24) & 0xff;
|
vendor_name[3] = (result.ebx >> 24) & 0xff;
|
||||||
vendor_name[ 4] = (result.edx >> 0) & 0xff;
|
vendor_name[4] = (result.edx >> 0) & 0xff;
|
||||||
vendor_name[ 5] = (result.edx >> 8) & 0xff;
|
vendor_name[5] = (result.edx >> 8) & 0xff;
|
||||||
vendor_name[ 6] = (result.edx >> 16) & 0xff;
|
vendor_name[6] = (result.edx >> 16) & 0xff;
|
||||||
vendor_name[ 7] = (result.edx >> 24) & 0xff;
|
vendor_name[7] = (result.edx >> 24) & 0xff;
|
||||||
vendor_name[ 8] = (result.ecx >> 0) & 0xff;
|
vendor_name[8] = (result.ecx >> 0) & 0xff;
|
||||||
vendor_name[ 9] = (result.ecx >> 8) & 0xff;
|
vendor_name[9] = (result.ecx >> 8) & 0xff;
|
||||||
vendor_name[10] = (result.ecx >> 16) & 0xff;
|
vendor_name[10] = (result.ecx >> 16) & 0xff;
|
||||||
vendor_name[11] = (result.ecx >> 24) & 0xff;
|
vendor_name[11] = (result.ecx >> 24) & 0xff;
|
||||||
vendor_name[12] = '\0';
|
vendor_name[12] = '\0';
|
||||||
|
@ -37,7 +37,7 @@ void setup_ebda(u32 low_memory_size, u16 ebda_segment, u16 ebda_size)
|
|||||||
|
|
||||||
/* Set up EBDA */
|
/* Set up EBDA */
|
||||||
memset((void *)((uintptr_t)ebda_segment << 4), 0, ebda_size);
|
memset((void *)((uintptr_t)ebda_segment << 4), 0, ebda_size);
|
||||||
write16((void*)((uintptr_t)ebda_segment << 4), (ebda_size >> 10));
|
write16((void *)((uintptr_t)ebda_segment << 4), (ebda_size >> 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_default_ebda(void)
|
void setup_default_ebda(void)
|
||||||
|
@ -266,7 +266,7 @@ static int parse_ulong(char **ptr, unsigned long *value)
|
|||||||
start = *ptr;
|
start = *ptr;
|
||||||
*value = 0;
|
*value = 0;
|
||||||
|
|
||||||
while((digit = hex(**ptr)) >= 0) {
|
while ((digit = hex(**ptr)) >= 0) {
|
||||||
*value = ((*value) << 4) | digit;
|
*value = ((*value) << 4) | digit;
|
||||||
(*ptr)++;
|
(*ptr)++;
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ static void copy_to_hex(char *buf, void *addr, unsigned long count)
|
|||||||
unsigned char ch;
|
unsigned char ch;
|
||||||
char *mem = addr;
|
char *mem = addr;
|
||||||
|
|
||||||
while(count--) {
|
while (count--) {
|
||||||
ch = *mem++;
|
ch = *mem++;
|
||||||
*buf++ = hexchars[ch >> 4];
|
*buf++ = hexchars[ch >> 4];
|
||||||
*buf++ = hexchars[ch & 0x0f];
|
*buf++ = hexchars[ch & 0x0f];
|
||||||
@ -297,9 +297,9 @@ static void copy_from_hex(void *addr, char *buf, unsigned long count)
|
|||||||
unsigned char ch;
|
unsigned char ch;
|
||||||
char *mem = addr;
|
char *mem = addr;
|
||||||
|
|
||||||
while(count--) {
|
while (count--) {
|
||||||
ch = hex (*buf++) << 4;
|
ch = hex(*buf++) << 4;
|
||||||
ch = ch + hex (*buf++);
|
ch = ch + hex(*buf++);
|
||||||
*mem++ = ch;
|
*mem++ = ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -346,7 +346,7 @@ static int get_packet(char *buffer)
|
|||||||
stub_flush();
|
stub_flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while(checksum != xmitcsum);
|
} while (checksum != xmitcsum);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,14 +402,14 @@ void x86_exception(struct eregs *info)
|
|||||||
out_buffer[3] = '\0';
|
out_buffer[3] = '\0';
|
||||||
put_packet(out_buffer);
|
put_packet(out_buffer);
|
||||||
|
|
||||||
while(1) {
|
while (1) {
|
||||||
unsigned long addr, length;
|
unsigned long addr, length;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
out_buffer[0] = '\0';
|
out_buffer[0] = '\0';
|
||||||
out_buffer[1] = '\0';
|
out_buffer[1] = '\0';
|
||||||
if (!get_packet(in_buffer))
|
if (!get_packet(in_buffer))
|
||||||
break;
|
break;
|
||||||
switch(in_buffer[0]) {
|
switch (in_buffer[0]) {
|
||||||
case '?': /* last signal */
|
case '?': /* last signal */
|
||||||
out_buffer[0] = 'S';
|
out_buffer[0] = 'S';
|
||||||
out_buffer[1] = hexchars[(signo >> 4) & 0xf];
|
out_buffer[1] = hexchars[(signo >> 4) & 0xf];
|
||||||
@ -425,12 +425,12 @@ void x86_exception(struct eregs *info)
|
|||||||
info->eip = gdb_stub_registers[PC];
|
info->eip = gdb_stub_registers[PC];
|
||||||
info->cs = gdb_stub_registers[CS];
|
info->cs = gdb_stub_registers[CS];
|
||||||
info->eflags = gdb_stub_registers[PS];
|
info->eflags = gdb_stub_registers[PS];
|
||||||
memcpy(out_buffer, "OK",3);
|
memcpy(out_buffer, "OK", 3);
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
/* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
|
/* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
|
||||||
ptr = &in_buffer[1];
|
ptr = &in_buffer[1];
|
||||||
if ( parse_ulong(&ptr, &addr) &&
|
if (parse_ulong(&ptr, &addr) &&
|
||||||
(*ptr++ == ',') &&
|
(*ptr++ == ',') &&
|
||||||
parse_ulong(&ptr, &length)) {
|
parse_ulong(&ptr, &length)) {
|
||||||
copy_to_hex(out_buffer, (void *)addr, length);
|
copy_to_hex(out_buffer, (void *)addr, length);
|
||||||
@ -440,7 +440,7 @@ void x86_exception(struct eregs *info)
|
|||||||
case 'M':
|
case 'M':
|
||||||
/* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
|
/* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
|
||||||
ptr = &in_buffer[1];
|
ptr = &in_buffer[1];
|
||||||
if ( parse_ulong(&ptr, &addr) &&
|
if (parse_ulong(&ptr, &addr) &&
|
||||||
(*(ptr++) == ',') &&
|
(*(ptr++) == ',') &&
|
||||||
parse_ulong(&ptr, &length) &&
|
parse_ulong(&ptr, &length) &&
|
||||||
(*(ptr++) == ':')) {
|
(*(ptr++) == ':')) {
|
||||||
@ -498,14 +498,14 @@ void x86_exception(struct eregs *info)
|
|||||||
info->error_code, info->eflags,
|
info->error_code, info->eflags,
|
||||||
info->eax, info->ebx, info->ecx, info->edx,
|
info->eax, info->ebx, info->ecx, info->edx,
|
||||||
info->edi, info->esi, info->ebp, info->esp);
|
info->edi, info->esi, info->ebp, info->esp);
|
||||||
u8 *code = (u8*)((uintptr_t)info->eip - (MDUMP_SIZE >>1));
|
u8 *code = (u8 *)((uintptr_t)info->eip - (MDUMP_SIZE >> 1));
|
||||||
/* Align to 8-byte boundary please, and print eight bytes per row.
|
/* Align to 8-byte boundary please, and print eight bytes per row.
|
||||||
* This is done to make DRAM burst timing/reordering errors more
|
* This is done to make DRAM burst timing/reordering errors more
|
||||||
* evident from the looking at the dump */
|
* evident from the looking at the dump */
|
||||||
code = (u8*)((uintptr_t)code & ~0x7);
|
code = (u8 *)((uintptr_t)code & ~0x7);
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < MDUMP_SIZE; i++) {
|
for (i = 0; i < MDUMP_SIZE; i++) {
|
||||||
if ( (i & 0x07) == 0 )
|
if ((i & 0x07) == 0)
|
||||||
printk(BIOS_EMERG, "\n%p:\t", code + i);
|
printk(BIOS_EMERG, "\n%p:\t", code + i);
|
||||||
printk(BIOS_EMERG, "%.2x ", code[i]);
|
printk(BIOS_EMERG, "%.2x ", code[i]);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ static void move_gdt(int is_recovery)
|
|||||||
printk(BIOS_ERR, "Error: Could not relocate GDT.\n");
|
printk(BIOS_ERR, "Error: Could not relocate GDT.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memcpy((void*)newgdt, &gdt, num_gdt_bytes);
|
memcpy((void *)newgdt, &gdt, num_gdt_bytes);
|
||||||
}
|
}
|
||||||
printk(BIOS_DEBUG, "Moving GDT to %p...", newgdt);
|
printk(BIOS_DEBUG, "Moving GDT to %p...", newgdt);
|
||||||
|
|
||||||
|
@ -589,11 +589,11 @@ unsigned long fw_cfg_acpi_tables(unsigned long start);
|
|||||||
unsigned long write_acpi_tables(unsigned long addr);
|
unsigned long write_acpi_tables(unsigned long addr);
|
||||||
unsigned long acpi_fill_madt(unsigned long current);
|
unsigned long acpi_fill_madt(unsigned long current);
|
||||||
unsigned long acpi_fill_mcfg(unsigned long current);
|
unsigned long acpi_fill_mcfg(unsigned long current);
|
||||||
unsigned long acpi_fill_ivrs_ioapic(acpi_ivrs_t* ivrs, unsigned long current);
|
unsigned long acpi_fill_ivrs_ioapic(acpi_ivrs_t *ivrs, unsigned long current);
|
||||||
void acpi_create_ssdt_generator(acpi_header_t *ssdt, const char *oem_table_id);
|
void acpi_create_ssdt_generator(acpi_header_t *ssdt, const char *oem_table_id);
|
||||||
void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs, void *dsdt);
|
void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt);
|
||||||
#if IS_ENABLED(CONFIG_COMMON_FADT)
|
#if IS_ENABLED(CONFIG_COMMON_FADT)
|
||||||
void acpi_fill_fadt(acpi_fadt_t * fadt);
|
void acpi_fill_fadt(acpi_fadt_t *fadt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void update_ssdt(void *ssdt);
|
void update_ssdt(void *ssdt);
|
||||||
@ -617,7 +617,7 @@ unsigned long acpi_create_madt_lapic_nmis(unsigned long current, u16 flags,
|
|||||||
u8 lint);
|
u8 lint);
|
||||||
|
|
||||||
int acpi_create_srat_lapic(acpi_srat_lapic_t *lapic, u8 node, u8 apic);
|
int acpi_create_srat_lapic(acpi_srat_lapic_t *lapic, u8 node, u8 apic);
|
||||||
int acpi_create_srat_mem(acpi_srat_mem_t *mem, u8 node, u32 basek,u32 sizek,
|
int acpi_create_srat_mem(acpi_srat_mem_t *mem, u8 node, u32 basek, u32 sizek,
|
||||||
u32 flags);
|
u32 flags);
|
||||||
int acpi_create_mcfg_mmconfig(acpi_mcfg_mmconfig_t *mmconfig, u32 base,
|
int acpi_create_mcfg_mmconfig(acpi_mcfg_mmconfig_t *mmconfig, u32 base,
|
||||||
u16 seg_nr, u8 start, u8 end);
|
u16 seg_nr, u8 start, u8 end);
|
||||||
@ -631,10 +631,11 @@ void acpi_create_slit(acpi_slit_t *slit,
|
|||||||
void acpi_create_vfct(struct device *device,
|
void acpi_create_vfct(struct device *device,
|
||||||
struct acpi_vfct *vfct,
|
struct acpi_vfct *vfct,
|
||||||
unsigned long (*acpi_fill_vfct)(struct device *device,
|
unsigned long (*acpi_fill_vfct)(struct device *device,
|
||||||
struct acpi_vfct *vfct_struct, unsigned long current));
|
struct acpi_vfct *vfct_struct,
|
||||||
|
unsigned long current));
|
||||||
|
|
||||||
void acpi_create_ivrs(acpi_ivrs_t *ivrs,
|
void acpi_create_ivrs(acpi_ivrs_t *ivrs,
|
||||||
unsigned long (*acpi_fill_ivrs)(acpi_ivrs_t* ivrs_struct, unsigned long current));
|
unsigned long (*acpi_fill_ivrs)(acpi_ivrs_t *ivrs_struct, unsigned long current));
|
||||||
|
|
||||||
#if ENV_RAMSTAGE && !defined(__SIMPLE_DEVICE__)
|
#if ENV_RAMSTAGE && !defined(__SIMPLE_DEVICE__)
|
||||||
void acpi_create_hpet(acpi_hpet_t *hpet);
|
void acpi_create_hpet(acpi_hpet_t *hpet);
|
||||||
@ -649,7 +650,7 @@ void acpi_create_mcfg(acpi_mcfg_t *mcfg);
|
|||||||
void acpi_create_facs(acpi_facs_t *facs);
|
void acpi_create_facs(acpi_facs_t *facs);
|
||||||
|
|
||||||
void acpi_create_dmar(acpi_dmar_t *dmar, enum dmar_flags flags,
|
void acpi_create_dmar(acpi_dmar_t *dmar, enum dmar_flags flags,
|
||||||
unsigned long (*acpi_fill_dmar) (unsigned long));
|
unsigned long (*acpi_fill_dmar)(unsigned long));
|
||||||
unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags,
|
unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags,
|
||||||
u16 segment, u32 bar);
|
u16 segment, u32 bar);
|
||||||
unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags,
|
unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags,
|
||||||
|
@ -205,11 +205,11 @@ void acpigen_write_STA(uint8_t status);
|
|||||||
void acpigen_write_TPC(const char *gnvs_tpc_limit);
|
void acpigen_write_TPC(const char *gnvs_tpc_limit);
|
||||||
void acpigen_write_PSS_package(u32 coreFreq, u32 power, u32 transLat, u32 busmLat,
|
void acpigen_write_PSS_package(u32 coreFreq, u32 power, u32 transLat, u32 busmLat,
|
||||||
u32 control, u32 status);
|
u32 control, u32 status);
|
||||||
typedef enum { SW_ALL=0xfc, SW_ANY=0xfd, HW_ALL=0xfe } PSD_coord;
|
typedef enum { SW_ALL = 0xfc, SW_ANY = 0xfd, HW_ALL = 0xfe } PSD_coord;
|
||||||
void acpigen_write_PSD_package(u32 domain, u32 numprocs, PSD_coord coordtype);
|
void acpigen_write_PSD_package(u32 domain, u32 numprocs, PSD_coord coordtype);
|
||||||
void acpigen_write_CST_package_entry(acpi_cstate_t *cstate);
|
void acpigen_write_CST_package_entry(acpi_cstate_t *cstate);
|
||||||
void acpigen_write_CST_package(acpi_cstate_t *entry, int nentries);
|
void acpigen_write_CST_package(acpi_cstate_t *entry, int nentries);
|
||||||
typedef enum { CSD_HW_ALL=0xfe } CSD_coord;
|
typedef enum { CSD_HW_ALL = 0xfe } CSD_coord;
|
||||||
void acpigen_write_CSD_package(u32 domain, u32 numprocs, CSD_coord coordtype, u32 index);
|
void acpigen_write_CSD_package(u32 domain, u32 numprocs, CSD_coord coordtype, u32 index);
|
||||||
void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len);
|
void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len);
|
||||||
void acpigen_write_TSS_package(int entries, acpi_tstate_t *tstate_list);
|
void acpigen_write_TSS_package(int entries, acpi_tstate_t *tstate_list);
|
||||||
|
@ -50,7 +50,7 @@ static void bootblock_mainboard_init(void)
|
|||||||
static void sanitize_cmos(void)
|
static void sanitize_cmos(void)
|
||||||
{
|
{
|
||||||
if (cmos_error() || !cmos_chksum_valid() || IS_ENABLED(CONFIG_STATIC_OPTION_TABLE)) {
|
if (cmos_error() || !cmos_chksum_valid() || IS_ENABLED(CONFIG_STATIC_OPTION_TABLE)) {
|
||||||
unsigned char *cmos_default = (unsigned char*)walkcbfs("cmos.default");
|
unsigned char *cmos_default = (unsigned char *)walkcbfs("cmos.default");
|
||||||
if (cmos_default) {
|
if (cmos_default) {
|
||||||
int i;
|
int i;
|
||||||
cmos_disable_rtc();
|
cmos_disable_rtc();
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <commonlib/cbfs_serialized.h>
|
#include <commonlib/cbfs_serialized.h>
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
|
|
||||||
#define CBFS_SUBHEADER(_p) ( (void *) ((((uint8_t *) (_p)) + ntohl((_p)->offset))) )
|
#define CBFS_SUBHEADER(_p) ((void *)((((uint8_t *)(_p)) + ntohl((_p)->offset))))
|
||||||
|
|
||||||
static struct cbfs_file *walkcbfs_head(char *target)
|
static struct cbfs_file *walkcbfs_head(char *target)
|
||||||
{
|
{
|
||||||
@ -47,7 +47,7 @@ struct cbfs_stage_restricted {
|
|||||||
unsigned long entry; // this is really 64bit, but properly endianized
|
unsigned long entry; // this is really 64bit, but properly endianized
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline unsigned long findstage(char* target)
|
static inline unsigned long findstage(char *target)
|
||||||
{
|
{
|
||||||
struct cbfs_stage_restricted *stage = walkcbfs(target);
|
struct cbfs_stage_restricted *stage = walkcbfs(target);
|
||||||
if ((u32)stage != 0)
|
if ((u32)stage != 0)
|
||||||
|
@ -204,7 +204,7 @@ static inline struct cpu_info *cpu_info(void)
|
|||||||
"andl %%esp,%0; "
|
"andl %%esp,%0; "
|
||||||
"orl %2, %0 "
|
"orl %2, %0 "
|
||||||
#endif
|
#endif
|
||||||
:"=r" (ci)
|
: "=r" (ci)
|
||||||
: "0" (~(CONFIG_STACK_SIZE - 1)),
|
: "0" (~(CONFIG_STACK_SIZE - 1)),
|
||||||
"r" (CONFIG_STACK_SIZE - sizeof(struct cpu_info))
|
"r" (CONFIG_STACK_SIZE - sizeof(struct cpu_info))
|
||||||
);
|
);
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
asm(".section .car.global_data,\"w\",@nobits");
|
asm(".section .car.global_data,\"w\",@nobits");
|
||||||
asm(".previous");
|
asm(".previous");
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#define CAR_GLOBAL __attribute__((used,section(".car.global_data")))
|
#define CAR_GLOBAL __attribute__((used, section(".car.global_data")))
|
||||||
#else
|
#else
|
||||||
#define CAR_GLOBAL __attribute__((used,section(".car.global_data#")))
|
#define CAR_GLOBAL __attribute__((used, section(".car.global_data#")))
|
||||||
#endif /* __clang__ */
|
#endif /* __clang__ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -56,9 +56,9 @@ void *car_sync_var_ptr(void *var);
|
|||||||
#define car_get_var(var) \
|
#define car_get_var(var) \
|
||||||
*(typeof(var) *)car_get_var_ptr(&(var))
|
*(typeof(var) *)car_get_var_ptr(&(var))
|
||||||
#define car_sync_var(var) \
|
#define car_sync_var(var) \
|
||||||
*(typeof (var) *)car_sync_var_ptr(&(var))
|
*(typeof(var) *)car_sync_var_ptr(&(var))
|
||||||
#define car_set_var(var, val) \
|
#define car_set_var(var, val) \
|
||||||
do { car_get_var(var) = (val); } while(0)
|
do { car_get_var(var) = (val); } while (0)
|
||||||
|
|
||||||
static inline size_t car_data_size(void)
|
static inline size_t car_data_size(void)
|
||||||
{
|
{
|
||||||
|
@ -303,7 +303,7 @@ void pci_write_config32(pci_devfn_t dev, unsigned where, uint32_t value)
|
|||||||
#define PCI_DEV_INVALID (0xffffffffU)
|
#define PCI_DEV_INVALID (0xffffffffU)
|
||||||
static inline pci_devfn_t pci_io_locate_device(unsigned pci_id, pci_devfn_t dev)
|
static inline pci_devfn_t pci_io_locate_device(unsigned pci_id, pci_devfn_t dev)
|
||||||
{
|
{
|
||||||
for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0,0,1)) {
|
for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0, 0, 1)) {
|
||||||
unsigned int id;
|
unsigned int id;
|
||||||
id = pci_io_read_config32(dev, 0);
|
id = pci_io_read_config32(dev, 0);
|
||||||
if (id == pci_id)
|
if (id == pci_id)
|
||||||
@ -314,7 +314,7 @@ static inline pci_devfn_t pci_io_locate_device(unsigned pci_id, pci_devfn_t dev)
|
|||||||
|
|
||||||
static inline pci_devfn_t pci_locate_device(unsigned pci_id, pci_devfn_t dev)
|
static inline pci_devfn_t pci_locate_device(unsigned pci_id, pci_devfn_t dev)
|
||||||
{
|
{
|
||||||
for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0,0,1)) {
|
for (; dev <= PCI_DEV(255, 31, 7); dev += PCI_DEV(0, 0, 1)) {
|
||||||
unsigned int id;
|
unsigned int id;
|
||||||
id = pci_read_config32(dev, 0);
|
id = pci_read_config32(dev, 0);
|
||||||
if (id == pci_id)
|
if (id == pci_id)
|
||||||
@ -330,7 +330,7 @@ static inline pci_devfn_t pci_locate_device_on_bus(unsigned pci_id, unsigned bus
|
|||||||
dev = PCI_DEV(bus, 0, 0);
|
dev = PCI_DEV(bus, 0, 0);
|
||||||
last = PCI_DEV(bus, 31, 7);
|
last = PCI_DEV(bus, 31, 7);
|
||||||
|
|
||||||
for (; dev <=last; dev += PCI_DEV(0,0,1)) {
|
for (; dev <= last; dev += PCI_DEV(0, 0, 1)) {
|
||||||
unsigned int id;
|
unsigned int id;
|
||||||
id = pci_read_config32(dev, 0);
|
id = pci_read_config32(dev, 0);
|
||||||
if (id == pci_id)
|
if (id == pci_id)
|
||||||
@ -343,15 +343,15 @@ static inline pci_devfn_t pci_locate_device_on_bus(unsigned pci_id, unsigned bus
|
|||||||
static inline __attribute__((always_inline)) void pnp_write_config(pnp_devfn_t dev, uint8_t reg, uint8_t value)
|
static inline __attribute__((always_inline)) void pnp_write_config(pnp_devfn_t dev, uint8_t reg, uint8_t value)
|
||||||
{
|
{
|
||||||
unsigned port = dev >> 8;
|
unsigned port = dev >> 8;
|
||||||
outb(reg, port );
|
outb(reg, port);
|
||||||
outb(value, port +1);
|
outb(value, port + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline __attribute__((always_inline)) uint8_t pnp_read_config(pnp_devfn_t dev, uint8_t reg)
|
static inline __attribute__((always_inline)) uint8_t pnp_read_config(pnp_devfn_t dev, uint8_t reg)
|
||||||
{
|
{
|
||||||
unsigned port = dev >> 8;
|
unsigned port = dev >> 8;
|
||||||
outb(reg, port);
|
outb(reg, port);
|
||||||
return inb(port +1);
|
return inb(port + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline __attribute__((always_inline))
|
static inline __attribute__((always_inline))
|
||||||
|
@ -46,7 +46,7 @@ typedef struct { volatile int counter; } atomic_t;
|
|||||||
* Atomically sets the value of v to i. Note that the guaranteed
|
* Atomically sets the value of v to i. Note that the guaranteed
|
||||||
* useful range of an atomic_t is only 24 bits.
|
* useful range of an atomic_t is only 24 bits.
|
||||||
*/
|
*/
|
||||||
#define atomic_set(v,i) (((v)->counter) = (i))
|
#define atomic_set(v, i) (((v)->counter) = (i))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* atomic_inc - increment atomic variable
|
* atomic_inc - increment atomic variable
|
||||||
@ -59,8 +59,8 @@ static __inline__ __attribute__((always_inline)) void atomic_inc(atomic_t *v)
|
|||||||
{
|
{
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
"lock ; incl %0"
|
"lock ; incl %0"
|
||||||
:"=m" (v->counter)
|
: "=m" (v->counter)
|
||||||
:"m" (v->counter));
|
: "m" (v->counter));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -74,8 +74,8 @@ static __inline__ __attribute__((always_inline)) void atomic_dec(atomic_t *v)
|
|||||||
{
|
{
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
"lock ; decl %0"
|
"lock ; decl %0"
|
||||||
:"=m" (v->counter)
|
: "=m" (v->counter)
|
||||||
:"m" (v->counter));
|
: "m" (v->counter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ typedef struct {
|
|||||||
#ifdef __PRE_RAM__
|
#ifdef __PRE_RAM__
|
||||||
spinlock_t *romstage_console_lock(void);
|
spinlock_t *romstage_console_lock(void);
|
||||||
void initialize_romstage_console_lock(void);
|
void initialize_romstage_console_lock(void);
|
||||||
spinlock_t* romstage_nvram_cbfs_lock(void);
|
spinlock_t *romstage_nvram_cbfs_lock(void);
|
||||||
void initialize_romstage_nvram_cbfs_lock(void);
|
void initialize_romstage_nvram_cbfs_lock(void);
|
||||||
spinlock_t* romstage_microcode_cbfs_lock(void);
|
spinlock_t *romstage_microcode_cbfs_lock(void);
|
||||||
void initialize_romstage_microcode_cbfs_lock(void);
|
void initialize_romstage_microcode_cbfs_lock(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -50,9 +50,9 @@ void initialize_romstage_microcode_cbfs_lock(void);
|
|||||||
*
|
*
|
||||||
* We make no fairness assumptions. They have a cost.
|
* We make no fairness assumptions. They have a cost.
|
||||||
*/
|
*/
|
||||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
#define barrier() __asm__ __volatile__("" : : : "memory")
|
||||||
#define spin_is_locked(x) (*(volatile char *)(&(x)->lock) <= 0)
|
#define spin_is_locked(x) (*(volatile char *)(&(x)->lock) <= 0)
|
||||||
#define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x))
|
#define spin_unlock_wait(x) do { barrier(); } while (spin_is_locked(x))
|
||||||
|
|
||||||
#define spin_lock_string \
|
#define spin_lock_string \
|
||||||
"\n1:\t" \
|
"\n1:\t" \
|
||||||
@ -76,31 +76,31 @@ static inline __attribute__((always_inline)) void spin_lock(spinlock_t *lock)
|
|||||||
{
|
{
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
spin_lock_string
|
spin_lock_string
|
||||||
:"=m" (lock->lock) : : "memory");
|
: "=m" (lock->lock) : : "memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline __attribute__((always_inline)) void spin_unlock(spinlock_t *lock)
|
static inline __attribute__((always_inline)) void spin_unlock(spinlock_t *lock)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
spin_unlock_string
|
spin_unlock_string
|
||||||
:"=m" (lock->lock) : : "memory");
|
: "=m" (lock->lock) : : "memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
|
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
|
||||||
static inline __attribute__((always_inline)) void cpu_relax(void)
|
static inline __attribute__((always_inline)) void cpu_relax(void)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("rep;nop": : :"memory");
|
__asm__ __volatile__("rep;nop" : : : "memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !__PRE_RAM__ */
|
#else /* !__PRE_RAM__ */
|
||||||
|
|
||||||
#define DECLARE_SPIN_LOCK(x)
|
#define DECLARE_SPIN_LOCK(x)
|
||||||
#define barrier() do {} while(0)
|
#define barrier() do {} while (0)
|
||||||
#define spin_is_locked(lock) 0
|
#define spin_is_locked(lock) 0
|
||||||
#define spin_unlock_wait(lock) do {} while(0)
|
#define spin_unlock_wait(lock) do {} while (0)
|
||||||
#define spin_lock(lock) do {} while(0)
|
#define spin_lock(lock) do {} while (0)
|
||||||
#define spin_unlock(lock) do {} while(0)
|
#define spin_unlock(lock) do {} while (0)
|
||||||
#define cpu_relax() do {} while(0)
|
#define cpu_relax() do {} while (0)
|
||||||
|
|
||||||
#endif /* !__PRE_RAM__ */
|
#endif /* !__PRE_RAM__ */
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
void *memmove(void *dest, const void *src, size_t n)
|
void *memmove(void *dest, const void *src, size_t n)
|
||||||
{
|
{
|
||||||
int d0,d1,d2,d3,d4,d5;
|
int d0, d1, d2, d3, d4, d5;
|
||||||
char *ret = dest;
|
char *ret = dest;
|
||||||
|
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
@ -192,11 +192,11 @@ void *memmove(void *dest, const void *src, size_t n)
|
|||||||
".p2align 4\n\t"
|
".p2align 4\n\t"
|
||||||
"11:"
|
"11:"
|
||||||
: "=&c" (d0), "=&S" (d1), "=&D" (d2),
|
: "=&c" (d0), "=&S" (d1), "=&D" (d2),
|
||||||
"=r" (d3),"=r" (d4), "=r"(d5)
|
"=r" (d3), "=r" (d4), "=r"(d5)
|
||||||
:"0" (n),
|
: "0" (n),
|
||||||
"1" (src),
|
"1" (src),
|
||||||
"2" (dest)
|
"2" (dest)
|
||||||
:"memory");
|
: "memory");
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ static int cbfs_master_header_props(struct cbfs_props *props)
|
|||||||
/* The offset is relative to the end of the media. */
|
/* The offset is relative to the end of the media. */
|
||||||
offset += CONFIG_ROM_SIZE;
|
offset += CONFIG_ROM_SIZE;
|
||||||
|
|
||||||
rdev_readat(bdev, &header , offset, sizeof(header));
|
rdev_readat(bdev, &header, offset, sizeof(header));
|
||||||
|
|
||||||
header.magic = ntohl(header.magic);
|
header.magic = ntohl(header.magic);
|
||||||
header.romsize = ntohl(header.romsize);
|
header.romsize = ntohl(header.romsize);
|
||||||
|
@ -169,7 +169,7 @@ void smp_write_processors(struct mp_config_table *mc)
|
|||||||
cpu_features = result.eax;
|
cpu_features = result.eax;
|
||||||
cpu_feature_flags = result.edx;
|
cpu_feature_flags = result.edx;
|
||||||
/* order the output of the cpus to fix a bug in kernel 2.6.11 */
|
/* order the output of the cpus to fix a bug in kernel 2.6.11 */
|
||||||
for (order_id = 0;order_id <256; order_id++) {
|
for (order_id = 0; order_id < 256; order_id++) {
|
||||||
for (cpu = all_devices; cpu; cpu = cpu->next) {
|
for (cpu = all_devices; cpu; cpu = cpu->next) {
|
||||||
unsigned long cpu_flag;
|
unsigned long cpu_flag;
|
||||||
if ((cpu->path.type != DEVICE_PATH_APIC) ||
|
if ((cpu->path.type != DEVICE_PATH_APIC) ||
|
||||||
@ -467,7 +467,7 @@ void mptable_write_buses(struct mp_config_table *mc, int *max_pci_bus,
|
|||||||
if (highest < bus->secondary) highest = bus->secondary;
|
if (highest < bus->secondary) highest = bus->secondary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i=0; i <= highest; i++) {
|
for (i = 0; i <= highest; i++) {
|
||||||
if (buses[i]) {
|
if (buses[i]) {
|
||||||
smp_write_bus(mc, i, "PCI ");
|
smp_write_bus(mc, i, "PCI ");
|
||||||
*max_pci_bus = i;
|
*max_pci_bus = i;
|
||||||
@ -556,7 +556,7 @@ unsigned long __attribute__((weak)) write_smp_table(unsigned long addr)
|
|||||||
if (!have_fixed_entries) {
|
if (!have_fixed_entries) {
|
||||||
pin = (dev->path.pci.devfn & 7) % 4;
|
pin = (dev->path.pci.devfn & 7) % 4;
|
||||||
oldparent = parent = dev;
|
oldparent = parent = dev;
|
||||||
while((parent = parent->bus->dev)) {
|
while ((parent = parent->bus->dev)) {
|
||||||
parentpin = (oldparent->path.pci.devfn >> 3) + (oldparent->path.pci.devfn & 7);
|
parentpin = (oldparent->path.pci.devfn >> 3) + (oldparent->path.pci.devfn & 7);
|
||||||
parentpin += dev->path.pci.devfn & 7;
|
parentpin += dev->path.pci.devfn & 7;
|
||||||
parentpin += dev->path.pci.devfn >> 3;
|
parentpin += dev->path.pci.devfn >> 3;
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if !CONFIG_PCI_IO_CFG_EXT
|
#if !CONFIG_PCI_IO_CFG_EXT
|
||||||
#define CONFIG_CMD(bus,devfn, where) (0x80000000 | (bus << 16) | \
|
#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus << 16) | \
|
||||||
(devfn << 8) | (where & ~3))
|
(devfn << 8) | (where & ~3))
|
||||||
#else
|
#else
|
||||||
#define CONFIG_CMD(bus,devfn, where) (0x80000000 | (bus << 16) | \
|
#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus << 16) | \
|
||||||
(devfn << 8) | ((where & 0xff) & ~3) |\
|
(devfn << 8) | ((where & 0xff) & ~3) |\
|
||||||
((where & 0xf00)<<16))
|
((where & 0xf00)<<16))
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
static void check_pirq_routing_table(struct irq_routing_table *rt)
|
static void check_pirq_routing_table(struct irq_routing_table *rt)
|
||||||
{
|
{
|
||||||
uint8_t *addr = (uint8_t *)rt;
|
uint8_t *addr = (uint8_t *)rt;
|
||||||
uint8_t sum=0;
|
uint8_t sum = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printk(BIOS_INFO, "Checking Interrupt Routing Table consistency...\n");
|
printk(BIOS_INFO, "Checking Interrupt Routing Table consistency...\n");
|
||||||
@ -33,7 +33,7 @@ static void check_pirq_routing_table(struct irq_routing_table *rt)
|
|||||||
(unsigned int) sizeof(struct irq_routing_table),
|
(unsigned int) sizeof(struct irq_routing_table),
|
||||||
rt->size
|
rt->size
|
||||||
);
|
);
|
||||||
rt->size=sizeof(struct irq_routing_table);
|
rt->size = sizeof(struct irq_routing_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < rt->size; i++)
|
for (i = 0; i < rt->size; i++)
|
||||||
@ -52,13 +52,13 @@ static void check_pirq_routing_table(struct irq_routing_table *rt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rt->signature != PIRQ_SIGNATURE || rt->version != PIRQ_VERSION ||
|
if (rt->signature != PIRQ_SIGNATURE || rt->version != PIRQ_VERSION ||
|
||||||
rt->size % 16 ) {
|
rt->size % 16) {
|
||||||
printk(BIOS_WARNING, "Interrupt Routing Table not valid.\n");
|
printk(BIOS_WARNING, "Interrupt Routing Table not valid.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sum = 0;
|
sum = 0;
|
||||||
for (i=0; i<rt->size; i++)
|
for (i = 0; i < rt->size; i++)
|
||||||
sum += addr[i];
|
sum += addr[i];
|
||||||
|
|
||||||
/* We're manually fixing the checksum above. This warning can probably
|
/* We're manually fixing the checksum above. This warning can probably
|
||||||
@ -78,8 +78,8 @@ static int verify_copy_pirq_routing_table(unsigned long addr, const struct irq_r
|
|||||||
int i;
|
int i;
|
||||||
uint8_t *rt_orig, *rt_curr;
|
uint8_t *rt_orig, *rt_curr;
|
||||||
|
|
||||||
rt_curr = (uint8_t*)addr;
|
rt_curr = (uint8_t *)addr;
|
||||||
rt_orig = (uint8_t*)routing_table;
|
rt_orig = (uint8_t *)routing_table;
|
||||||
printk(BIOS_INFO, "Verifying copy of Interrupt Routing Table at 0x%08lx... ", addr);
|
printk(BIOS_INFO, "Verifying copy of Interrupt Routing Table at 0x%08lx... ", addr);
|
||||||
for (i = 0; i < routing_table->size; i++) {
|
for (i = 0; i < routing_table->size; i++) {
|
||||||
if (*(rt_curr + i) != *(rt_orig + i)) {
|
if (*(rt_curr + i) != *(rt_orig + i)) {
|
||||||
@ -96,7 +96,7 @@ static int verify_copy_pirq_routing_table(unsigned long addr, const struct irq_r
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_PIRQ_ROUTE
|
#if CONFIG_PIRQ_ROUTE
|
||||||
static u8 pirq_get_next_free_irq(u8* pirq, u16 bitmap)
|
static u8 pirq_get_next_free_irq(u8 *pirq, u16 bitmap)
|
||||||
{
|
{
|
||||||
int i, link;
|
int i, link;
|
||||||
u8 irq = 0;
|
u8 irq = 0;
|
||||||
@ -152,7 +152,7 @@ static void pirq_route_irqs(unsigned long addr)
|
|||||||
printk(BIOS_DEBUG, "INT: %c link: %x bitmap: %x ",
|
printk(BIOS_DEBUG, "INT: %c link: %x bitmap: %x ",
|
||||||
'A' + intx, link, bitmap);
|
'A' + intx, link, bitmap);
|
||||||
|
|
||||||
if (!bitmap|| !link || link > CONFIG_MAX_PIRQ_LINKS) {
|
if (!bitmap || !link || link > CONFIG_MAX_PIRQ_LINKS) {
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "not routed\n");
|
printk(BIOS_DEBUG, "not routed\n");
|
||||||
irq_slot[intx] = irq;
|
irq_slot[intx] = irq;
|
||||||
|
@ -75,7 +75,7 @@ int smbios_string_table_len(char *start)
|
|||||||
char *p = start;
|
char *p = start;
|
||||||
int i, len = 0;
|
int i, len = 0;
|
||||||
|
|
||||||
while(*p) {
|
while (*p) {
|
||||||
i = strlen(p) + 1;
|
i = strlen(p) + 1;
|
||||||
p += i;
|
p += i;
|
||||||
len += i;
|
len += i;
|
||||||
@ -576,7 +576,14 @@ static int smbios_walk_device_tree(struct device *tree, int *handle, unsigned lo
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define update_max(len, max_len, stmt) do { int tmp = stmt; max_len = MAX(max_len, tmp); len += tmp; } while(0)
|
#define update_max(len, max_len, stmt) \
|
||||||
|
do { \
|
||||||
|
int tmp = stmt; \
|
||||||
|
\
|
||||||
|
max_len = MAX(max_len, tmp); \
|
||||||
|
len += tmp; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
unsigned long smbios_write_tables(unsigned long current)
|
unsigned long smbios_write_tables(unsigned long current)
|
||||||
{
|
{
|
||||||
struct smbios_entry *se;
|
struct smbios_entry *se;
|
||||||
|
@ -112,7 +112,7 @@ static unsigned long write_acpi_table(unsigned long rom_table_end)
|
|||||||
|
|
||||||
rom_table_end = ALIGN(rom_table_end, 16);
|
rom_table_end = ALIGN(rom_table_end, 16);
|
||||||
new_high_table_pointer = write_acpi_tables(high_table_pointer);
|
new_high_table_pointer = write_acpi_tables(high_table_pointer);
|
||||||
if (new_high_table_pointer > ( high_table_pointer
|
if (new_high_table_pointer > (high_table_pointer
|
||||||
+ MAX_ACPI_SIZE))
|
+ MAX_ACPI_SIZE))
|
||||||
printk(BIOS_ERR, "ERROR: Increase ACPI size\n");
|
printk(BIOS_ERR, "ERROR: Increase ACPI size\n");
|
||||||
printk(BIOS_DEBUG, "ACPI tables: %ld bytes.\n",
|
printk(BIOS_DEBUG, "ACPI tables: %ld bytes.\n",
|
||||||
@ -165,7 +165,7 @@ static unsigned long write_smbios_table(unsigned long rom_table_end)
|
|||||||
memcpy((void *)rom_table_end, (void *)high_table_pointer, sizeof(struct smbios_entry));
|
memcpy((void *)rom_table_end, (void *)high_table_pointer, sizeof(struct smbios_entry));
|
||||||
rom_table_end += sizeof(struct smbios_entry);
|
rom_table_end += sizeof(struct smbios_entry);
|
||||||
|
|
||||||
if (new_high_table_pointer > ( high_table_pointer
|
if (new_high_table_pointer > (high_table_pointer
|
||||||
+ MAX_SMBIOS_SIZE))
|
+ MAX_SMBIOS_SIZE))
|
||||||
printk(BIOS_ERR, "ERROR: Increase SMBIOS size\n");
|
printk(BIOS_ERR, "ERROR: Increase SMBIOS size\n");
|
||||||
printk(BIOS_DEBUG, "SMBIOS tables: %ld bytes.\n",
|
printk(BIOS_DEBUG, "SMBIOS tables: %ld bytes.\n",
|
||||||
|
@ -38,7 +38,7 @@ static inline uintptr_t push_stack(uintptr_t cur_stack, uintptr_t value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void arch_prepare_thread(struct thread *t,
|
void arch_prepare_thread(struct thread *t,
|
||||||
void asmlinkage (*thread_entry)(void *), void *arg)
|
asmlinkage void (*thread_entry)(void *), void *arg)
|
||||||
{
|
{
|
||||||
uintptr_t stack = t->stack_current;
|
uintptr_t stack = t->stack_current;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user