pc, pc64: disable all pci devices for /dev/reboot

Make sure all pci busmaster activity is disabled,
including MSI/MSI-X interrupts, before switching
control to the new kernel.
This commit is contained in:
cinap_lenrek 2020-11-21 16:17:20 +01:00
parent c5d08a602c
commit e6684dbfda
2 changed files with 8 additions and 0 deletions

View file

@ -5,6 +5,7 @@
#include "dat.h"
#include "fns.h"
#include "io.h"
#include "../port/pci.h"
#include "ureg.h"
#include "pool.h"
#include "rebootcode.i"
@ -689,5 +690,8 @@ reboot(void *entry, void *code, ulong size)
/* shutdown devices */
chandevshutdown();
/* disable pci devices */
pcireset();
rebootjump((ulong)entry & ~0xF0000000UL, PADDR(code), size);
}

View file

@ -5,6 +5,7 @@
#include "dat.h"
#include "fns.h"
#include "io.h"
#include "../port/pci.h"
#include "ureg.h"
#include "pool.h"
#include "rebootcode.i"
@ -286,6 +287,9 @@ reboot(void *entry, void *code, ulong size)
/* shutdown devices */
chandevshutdown();
/* disable pci devices */
pcireset();
rebootjump((uintptr)entry & (ulong)~0xF0000000UL, PADDR(code), size);
}