XHCI test sending noop command
This commit is contained in:
@@ -239,12 +239,12 @@ static uint32_t lapic_calibrate (uint32_t us) {
|
||||
|
||||
lapic_write (LAPIC_DCR, DIVIDER_VALUE);
|
||||
|
||||
lapic_write (LAPIC_LVTTR, SCHED_PREEMPT_TIMER | (1 << 16));
|
||||
lapic_write (LAPIC_LVTTR, INTR_SCHED_PREEMPT_TIMER | (1 << 16));
|
||||
lapic_write (LAPIC_TIMICT, 0xFFFFFFFF);
|
||||
|
||||
sleep_micro (us);
|
||||
|
||||
lapic_write (LAPIC_LVTTR, SCHED_PREEMPT_TIMER | (0 << 16));
|
||||
lapic_write (LAPIC_LVTTR, INTR_SCHED_PREEMPT_TIMER | (0 << 16));
|
||||
uint32_t ticks = 0xFFFFFFFF - lapic_read (LAPIC_TIMCCT);
|
||||
DEBUG ("timer ticks = %u\n", ticks);
|
||||
|
||||
@@ -261,7 +261,7 @@ static uint32_t lapic_calibrate (uint32_t us) {
|
||||
static void lapic_start (uint32_t ticks) {
|
||||
lapic_write (LAPIC_DCR, DIVIDER_VALUE);
|
||||
lapic_write (LAPIC_TIMICT, ticks);
|
||||
lapic_write (LAPIC_LVTTR, SCHED_PREEMPT_TIMER | (1 << 17));
|
||||
lapic_write (LAPIC_LVTTR, INTR_SCHED_PREEMPT_TIMER | (1 << 17));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -78,8 +78,8 @@ void bootmain (void) {
|
||||
struct device* temp0 = device_find ("temp0");
|
||||
vfs_create_volume (thiscpu->kproc, &rctx, "temp", FS_FAT16, temp0, true);
|
||||
|
||||
irq_attach (&proc_irq_sched, NULL, SCHED_PREEMPT_TIMER);
|
||||
irq_attach (&proc_irq_sched, NULL, CPU_REQUEST_SCHED);
|
||||
irq_attach (&proc_irq_sched, NULL, INTR_SCHED_PREEMPT_TIMER);
|
||||
irq_attach (&proc_irq_sched, NULL, INTR_CPU_REQUEST_SCHED);
|
||||
|
||||
smp_init ();
|
||||
|
||||
|
||||
@@ -126,9 +126,9 @@ static void idt_init (void) {
|
||||
IDT_ENTRY (40, 2); IDT_ENTRY (41, 2); IDT_ENTRY (42, 2); IDT_ENTRY (43, 2);
|
||||
IDT_ENTRY (44, 2); IDT_ENTRY (45, 2); IDT_ENTRY (46, 2); IDT_ENTRY (47, 2);
|
||||
|
||||
IDT_ENTRY (SCHED_PREEMPT_TIMER, 2);
|
||||
IDT_ENTRY (CPU_REQUEST_SCHED, 2);
|
||||
IDT_ENTRY (CPU_SPURIOUS, 2);
|
||||
IDT_ENTRY (INTR_SCHED_PREEMPT_TIMER, 2);
|
||||
IDT_ENTRY (INTR_CPU_REQUEST_SCHED, 2);
|
||||
IDT_ENTRY (INTR_CPU_SPURIOUS, 2);
|
||||
/* clang-format on */
|
||||
#undef IDT_ENTRY
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#ifndef _KERNEL_AMD64_INTR_DEFS_H
|
||||
#define _KERNEL_AMD64_INTR_DEFS_H
|
||||
|
||||
#define PS2KB 32
|
||||
#define IDE_DRIVE_PRIM 33
|
||||
#define IDE_DRIVE_SCND 34
|
||||
#define INTR_PS2KB 32
|
||||
#define INTR_IDE_DRIVE_PRIM 33
|
||||
#define INTR_IDE_DRIVE_SCND 34
|
||||
#define INTR_XHCI 35
|
||||
|
||||
#define SCHED_PREEMPT_TIMER 80
|
||||
#define CPU_REQUEST_SCHED 82
|
||||
#define CPU_SPURIOUS 255
|
||||
#define INTR_SCHED_PREEMPT_TIMER 80
|
||||
#define INTR_CPU_REQUEST_SCHED 82
|
||||
#define INTR_CPU_SPURIOUS 255
|
||||
|
||||
#endif // _KERNEL_AMD64_INTR_DEFS_H
|
||||
|
||||
@@ -91,6 +91,6 @@ make_intr_stub(no_err, 45)
|
||||
make_intr_stub(no_err, 46)
|
||||
make_intr_stub(no_err, 47)
|
||||
|
||||
make_intr_stub(no_err, SCHED_PREEMPT_TIMER)
|
||||
make_intr_stub(no_err, CPU_REQUEST_SCHED)
|
||||
make_intr_stub(no_err, CPU_SPURIOUS)
|
||||
make_intr_stub(no_err, INTR_SCHED_PREEMPT_TIMER)
|
||||
make_intr_stub(no_err, INTR_CPU_REQUEST_SCHED)
|
||||
make_intr_stub(no_err, INTR_CPU_SPURIOUS)
|
||||
|
||||
@@ -52,7 +52,7 @@ void cpu_request_sched (struct cpu* cpu, bool user) {
|
||||
return;
|
||||
}
|
||||
|
||||
lapic_ipi (cpu->lapic_id, CPU_REQUEST_SCHED);
|
||||
lapic_ipi (cpu->lapic_id, INTR_CPU_REQUEST_SCHED);
|
||||
}
|
||||
|
||||
struct cpu* cpu_find_lightest (void) {
|
||||
|
||||
Reference in New Issue
Block a user