mirror of
https://github.com/memtest86plus/memtest86plus
synced 2025-03-12 17:02:58 +03:00
Simple maintenance improvements (#145)
* Fix typos * Add missing final newline * Trim trailing whitespace
This commit is contained in:
parent
148dfd4d54
commit
9660eead4e
@ -69,7 +69,7 @@ booted directly by a legacy BIOS (in floppy mode) or by an intermediate
|
|||||||
bootloader using the Linux 16-bit boot protocol and a `memtest.efi` binary
|
bootloader using the Linux 16-bit boot protocol and a `memtest.efi` binary
|
||||||
image file which can be booted directly by a 32-bit UEFI BIOS. Either image
|
image file which can be booted directly by a 32-bit UEFI BIOS. Either image
|
||||||
can be booted by an intermediate bootloader using the Linux 32-bit or 32-bit
|
can be booted by an intermediate bootloader using the Linux 32-bit or 32-bit
|
||||||
EFI handover boot protocols.
|
EFI handover boot protocols.
|
||||||
|
|
||||||
To build a 64-bit image, change directory into the `build64` directory and
|
To build a 64-bit image, change directory into the `build64` directory and
|
||||||
type `make`. The result is a `memtest.bin` binary image file which can be
|
type `make`. The result is a `memtest.bin` binary image file which can be
|
||||||
@ -144,7 +144,7 @@ recognised:
|
|||||||
* activate serial/tty console output, where *x* is one of the following IO port
|
* activate serial/tty console output, where *x* is one of the following IO port
|
||||||
* 0 = 0x3F8
|
* 0 = 0x3F8
|
||||||
* 1 = 0x2F8
|
* 1 = 0x2F8
|
||||||
* 2 = 0x3E8
|
* 2 = 0x3E8
|
||||||
* 3 = 0x2E8
|
* 3 = 0x2E8
|
||||||
* and *y* is an optional baud rate to choose from the following list
|
* and *y* is an optional baud rate to choose from the following list
|
||||||
* 9600
|
* 9600
|
||||||
|
@ -334,7 +334,7 @@ void addr_error(testword_t *addr1, testword_t *addr2, testword_t good, testword_
|
|||||||
void data_error(testword_t *addr, testword_t good, testword_t bad, bool use_for_badram)
|
void data_error(testword_t *addr, testword_t good, testword_t bad, bool use_for_badram)
|
||||||
{
|
{
|
||||||
#if USB_WORKAROUND
|
#if USB_WORKAROUND
|
||||||
/* Skip any errrors that appear to be due to the BIOS using location
|
/* Skip any errors that appear to be due to the BIOS using location
|
||||||
* 0x4e0 for USB keyboard support. This often happens with Intel
|
* 0x4e0 for USB keyboard support. This often happens with Intel
|
||||||
* 810, 815 and 820 chipsets. It is possible that we will skip
|
* 810, 815 and 820 chipsets. It is possible that we will skip
|
||||||
* a real error but the odds are very low.
|
* a real error but the odds are very low.
|
||||||
|
@ -196,7 +196,7 @@ void interrupt(struct trap_regs *trap_regs)
|
|||||||
|
|
||||||
clear_screen_region(ROW_FOOTER, 0, ROW_FOOTER, SCREEN_WIDTH - 1);
|
clear_screen_region(ROW_FOOTER, 0, ROW_FOOTER, SCREEN_WIDTH - 1);
|
||||||
prints(ROW_FOOTER, 0, "Press any key to reboot...");
|
prints(ROW_FOOTER, 0, "Press any key to reboot...");
|
||||||
|
|
||||||
while (get_key() == 0) { }
|
while (get_key() == 0) { }
|
||||||
reboot();
|
reboot();
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ do_setup:
|
|||||||
call empty_8042
|
call empty_8042
|
||||||
movb $0xd1, %al # send write command
|
movb $0xd1, %al # send write command
|
||||||
outb %al, $0x64
|
outb %al, $0x64
|
||||||
call empty_8042
|
call empty_8042
|
||||||
movb $0xdf, %al # A20 on
|
movb $0xdf, %al # A20 on
|
||||||
outb %al, $0x60
|
outb %al, $0x60
|
||||||
call empty_8042
|
call empty_8042
|
||||||
@ -352,7 +352,7 @@ empty_8042:
|
|||||||
call delay
|
call delay
|
||||||
inb $0x60, %al # read it
|
inb $0x60, %al # read it
|
||||||
jmp empty_8042
|
jmp empty_8042
|
||||||
|
|
||||||
no_output:
|
no_output:
|
||||||
testb $2, %al # is input buffer full?
|
testb $2, %al # is input buffer full?
|
||||||
jnz empty_8042 # yes - loop
|
jnz empty_8042 # yes - loop
|
||||||
|
@ -46,7 +46,7 @@ static inline void cache_on(void)
|
|||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
__asm__ __volatile__ ("\t"
|
__asm__ __volatile__ ("\t"
|
||||||
"movq %%cr0, %%rax \n\t"
|
"movq %%cr0, %%rax \n\t"
|
||||||
"andl $0x9fffffff, %%eax \n\t" /* Clear CD and NW */
|
"andl $0x9fffffff, %%eax \n\t" /* Clear CD and NW */
|
||||||
"movq %%rax, %%cr0 \n"
|
"movq %%rax, %%cr0 \n"
|
||||||
: /* no outputs */
|
: /* no outputs */
|
||||||
: /* no inputs */
|
: /* no inputs */
|
||||||
@ -55,7 +55,7 @@ static inline void cache_on(void)
|
|||||||
#else
|
#else
|
||||||
__asm__ __volatile__ ("\t"
|
__asm__ __volatile__ ("\t"
|
||||||
"movl %%cr0, %%eax \n\t"
|
"movl %%cr0, %%eax \n\t"
|
||||||
"andl $0x9fffffff, %%eax \n\t" /* Clear CD and NW */
|
"andl $0x9fffffff, %%eax \n\t" /* Clear CD and NW */
|
||||||
"movl %%eax, %%cr0 \n"
|
"movl %%eax, %%cr0 \n"
|
||||||
: /* no outputs */
|
: /* no outputs */
|
||||||
: /* no inputs */
|
: /* no inputs */
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
#define EHCI_USBCMD_ITC(n) ((n) << 16) // Interrupt Threshold Control = n (n = 1,2,4,8,16,32,64)
|
#define EHCI_USBCMD_ITC(n) ((n) << 16) // Interrupt Threshold Control = n (n = 1,2,4,8,16,32,64)
|
||||||
|
|
||||||
// USB Status register
|
// USB Status register
|
||||||
|
|
||||||
#define EHCI_USBSTS_INT 0x00000001 // Interrupt
|
#define EHCI_USBSTS_INT 0x00000001 // Interrupt
|
||||||
#define EHCI_USBSTS_ERR 0x00000002 // Error interrupt
|
#define EHCI_USBSTS_ERR 0x00000002 // Error interrupt
|
||||||
@ -60,7 +60,7 @@
|
|||||||
#define EHCI_USBSTS_PSS 0x00004000 // Periodic Schedule Status
|
#define EHCI_USBSTS_PSS 0x00004000 // Periodic Schedule Status
|
||||||
#define EHCI_USBSTS_ASS 0x00008000 // Asynchronous Schedule Status
|
#define EHCI_USBSTS_ASS 0x00008000 // Asynchronous Schedule Status
|
||||||
|
|
||||||
// Port Status and Control register
|
// Port Status and Control register
|
||||||
|
|
||||||
#define EHCI_PORT_SC_CCS 0x00000001 // Current Connect Status
|
#define EHCI_PORT_SC_CCS 0x00000001 // Current Connect Status
|
||||||
#define EHCI_PORT_SC_CCSC 0x00000002 // Current Connect Status Change
|
#define EHCI_PORT_SC_CCSC 0x00000002 // Current Connect Status Change
|
||||||
@ -78,7 +78,7 @@
|
|||||||
#define EHCI_PORT_SC_LS_J 0x00000800 // Line Status is J-state
|
#define EHCI_PORT_SC_LS_J 0x00000800 // Line Status is J-state
|
||||||
#define EHCI_PORT_SC_LS_U 0x00000c00 // Line Status is undefined
|
#define EHCI_PORT_SC_LS_U 0x00000c00 // Line Status is undefined
|
||||||
|
|
||||||
// Link Pointer
|
// Link Pointer
|
||||||
|
|
||||||
#define EHCI_LP_TERMINATE 0x00000001 // Terminate (T) bit
|
#define EHCI_LP_TERMINATE 0x00000001 // Terminate (T) bit
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ bool ohci_init(uintptr_t base_addr, usb_hcd_t *hcd)
|
|||||||
{
|
{
|
||||||
ohci_op_regs_t *op_regs = (ohci_op_regs_t *)base_addr;
|
ohci_op_regs_t *op_regs = (ohci_op_regs_t *)base_addr;
|
||||||
|
|
||||||
// Check the host controller revison.
|
// Check the host controller revision.
|
||||||
if ((read32(&op_regs->revision) & 0xff) != 0x10) {
|
if ((read32(&op_regs->revision) & 0xff) != 0x10) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ extern struct mem_dev *dmi_memory_device;
|
|||||||
int smbios_init(void);
|
int smbios_init(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print DMI
|
* Print DMI
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void print_smbios_startup_info(void);
|
void print_smbios_startup_info(void);
|
||||||
|
@ -192,7 +192,7 @@ static spd_info parse_spd_ddr5(uint8_t slot_idx)
|
|||||||
spdi.sku_len = 0;
|
spdi.sku_len = 0;
|
||||||
spdi.module_size = 0;
|
spdi.module_size = 0;
|
||||||
|
|
||||||
// Compute module size for symmetric & assymetric configuration
|
// Compute module size for symmetric & asymmetric configuration
|
||||||
for (int sbyte_adr = 1; sbyte_adr <= 2; sbyte_adr++) {
|
for (int sbyte_adr = 1; sbyte_adr <= 2; sbyte_adr++) {
|
||||||
uint32_t cur_rank = 0;
|
uint32_t cur_rank = 0;
|
||||||
uint8_t sbyte = get_spd(slot_idx, sbyte_adr * 4);
|
uint8_t sbyte = get_spd(slot_idx, sbyte_adr * 4);
|
||||||
@ -871,7 +871,7 @@ static spd_info parse_spd_ddr(uint8_t slot_idx)
|
|||||||
case 128:
|
case 128:
|
||||||
spdi.module_size = 512;
|
spdi.module_size = 512;
|
||||||
break;
|
break;
|
||||||
default: // we don't support asymetric banking
|
default: // we don't support asymmetric banking
|
||||||
spdi.module_size = 0;
|
spdi.module_size = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -127,4 +127,4 @@ extern ram_info ram;
|
|||||||
|
|
||||||
void print_smbus_startup_info(void);
|
void print_smbus_startup_info(void);
|
||||||
|
|
||||||
#endif // SMBUS_H
|
#endif // SMBUS_H
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
#define UHCI_USBCMD_GR 0x0004 // Global Reset
|
#define UHCI_USBCMD_GR 0x0004 // Global Reset
|
||||||
#define UHCI_USBCMD_MAXP 0x0080 // Max Packet
|
#define UHCI_USBCMD_MAXP 0x0080 // Max Packet
|
||||||
|
|
||||||
// USB Status register
|
// USB Status register
|
||||||
|
|
||||||
#define UHCI_USBSTS_INT 0x0001 // Interrupt
|
#define UHCI_USBSTS_INT 0x0001 // Interrupt
|
||||||
#define UHCI_USBSTS_ERR 0x0002 // Error interrupt
|
#define UHCI_USBSTS_ERR 0x0002 // Error interrupt
|
||||||
|
@ -600,7 +600,7 @@ bool assign_usb_address(const usb_hcd_t *hcd, const usb_hub_t *hub, int port_num
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool find_attached_usb_keyboards(const usb_hcd_t *hcd, const usb_hub_t *hub, int port_num,
|
bool find_attached_usb_keyboards(const usb_hcd_t *hcd, const usb_hub_t *hub, int port_num,
|
||||||
usb_speed_t device_speed, int device_id, int *num_devices,
|
usb_speed_t device_speed, int device_id, int *num_devices,
|
||||||
usb_ep_t keyboards[], int max_keyboards, int *num_keyboards)
|
usb_ep_t keyboards[], int max_keyboards, int *num_keyboards)
|
||||||
{
|
{
|
||||||
|
@ -70,7 +70,7 @@ int test_addr_walk1(int my_cpu)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
write_word(p2, ~invert ^ (testword_t)p2);
|
write_word(p2, ~invert ^ (testword_t)p2);
|
||||||
|
|
||||||
testword_t actual = read_word(p1);
|
testword_t actual = read_word(p1);
|
||||||
if (unlikely(actual != expect)) {
|
if (unlikely(actual != expect)) {
|
||||||
addr_error(p1, p2, expect, actual);
|
addr_error(p1, p2, expect, actual);
|
||||||
|
@ -84,7 +84,7 @@ int test_block_move(int my_cpu, int iterations)
|
|||||||
}
|
}
|
||||||
flush_caches(my_cpu);
|
flush_caches(my_cpu);
|
||||||
|
|
||||||
// Now move the data around. First move the data up half of the segment size
|
// Now move the data around. First move the data up half of the segment size
|
||||||
// we are testing. Then move the data to the original location + 32 bytes.
|
// we are testing. Then move the data to the original location + 32 bytes.
|
||||||
for (int i = 0; i < vm_map_size; i++) {
|
for (int i = 0; i < vm_map_size; i++) {
|
||||||
testword_t *start, *end;
|
testword_t *start, *end;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user