Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/amd/ivrs_drv.c
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | ivhd_hdrs[i] = ivhd; | ||||
/* | /* | ||||
* Scan for presence of legacy and non-legacy device type | * Scan for presence of legacy and non-legacy device type | ||||
* for same AMD-Vi device and override the old one. | * for same AMD-Vi device and override the old one. | ||||
*/ | */ | ||||
for (i = ivhd_count - 1 ; i > 0 ; i--){ | for (i = ivhd_count - 1 ; i > 0 ; i--){ | ||||
if (ivhd_is_newer(&ivhd_hdrs[i-1]->Header, | if (ivhd_is_newer(&ivhd_hdrs[i-1]->Header, | ||||
&ivhd_hdrs[i]->Header)) { | &ivhd_hdrs[i]->Header)) { | ||||
ivhd_hdrs[i-1] = ivhd_hdrs[i]; | memmove(&ivhd_hdrs[i-1], &ivhd_hdrs[i], | ||||
sizeof(void *) * (ivhd_count - i)); | |||||
ivhd_count--; | ivhd_count--; | ||||
} | } | ||||
} | } | ||||
ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF, | ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF, | ||||
M_WAITOK | M_ZERO); | M_WAITOK | M_ZERO); | ||||
for (i = 0; i < ivhd_count; i++) { | for (i = 0; i < ivhd_count; i++) { | ||||
ivhd = ivhd_hdrs[i]; | ivhd = ivhd_hdrs[i]; | ||||
KASSERT(ivhd, ("ivhd%d is NULL\n", i)); | KASSERT(ivhd, ("ivhd%d is NULL\n", i)); | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 353 Lines • Show Last 20 Lines |