Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_ahci.c
Show All 35 Lines | |||||
#include <sys/linker_set.h> | #include <sys/linker_set.h> | ||||
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#include <sys/uio.h> | #include <sys/uio.h> | ||||
#include <sys/ioctl.h> | #include <sys/ioctl.h> | ||||
#include <sys/disk.h> | #include <sys/disk.h> | ||||
#include <sys/ata.h> | #include <sys/ata.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#include <machine/vmm_snapshot.h> | |||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <strings.h> | #include <strings.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <assert.h> | #include <assert.h> | ||||
#include <pthread.h> | #include <pthread.h> | ||||
#include <pthread_np.h> | #include <pthread_np.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <md5.h> | #include <md5.h> | ||||
#include "bhyverun.h" | #include "bhyverun.h" | ||||
#include "config.h" | #include "config.h" | ||||
#include "debug.h" | #include "debug.h" | ||||
#include "pci_emul.h" | #include "pci_emul.h" | ||||
#ifdef BHYVE_SNAPSHOT | |||||
#include "snapshot.h" | |||||
#endif | |||||
#include "ahci.h" | #include "ahci.h" | ||||
#include "block_if.h" | #include "block_if.h" | ||||
#define DEF_PORTS 6 /* Intel ICH8 AHCI supports 6 ports */ | #define DEF_PORTS 6 /* Intel ICH8 AHCI supports 6 ports */ | ||||
#define MAX_PORTS 32 /* AHCI supports 32 ports */ | #define MAX_PORTS 32 /* AHCI supports 32 ports */ | ||||
#define PxSIG_ATA 0x00000101 /* ATA drive */ | #define PxSIG_ATA 0x00000101 /* ATA drive */ | ||||
#define PxSIG_ATAPI 0xeb140101 /* ATAPI drive */ | #define PxSIG_ATAPI 0xeb140101 /* ATAPI drive */ | ||||
▲ Show 20 Lines • Show All 2,546 Lines • ▼ Show 20 Lines | for (i = 0; i < MAX_PORTS; i++) { | ||||
if (port->port != i) { | if (port->port != i) { | ||||
fprintf(stderr, "%s: ports not matching: " | fprintf(stderr, "%s: ports not matching: " | ||||
"actual: %d expected: %d\r\n", | "actual: %d expected: %d\r\n", | ||||
__func__, port->port, i); | __func__, port->port, i); | ||||
ret = EINVAL; | ret = EINVAL; | ||||
goto done; | goto done; | ||||
} | } | ||||
SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(port->cmd_lst, | SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(pi->pi_vmctx, port->cmd_lst, | ||||
AHCI_CL_SIZE * AHCI_MAX_SLOTS, false, meta, ret, done); | AHCI_CL_SIZE * AHCI_MAX_SLOTS, false, meta, ret, done); | ||||
SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(port->rfis, 256, false, meta, | SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(pi->pi_vmctx, port->rfis, 256, | ||||
ret, done); | false, meta, ret, done); | ||||
SNAPSHOT_VAR_OR_LEAVE(port->ata_ident, meta, ret, done); | SNAPSHOT_VAR_OR_LEAVE(port->ata_ident, meta, ret, done); | ||||
SNAPSHOT_VAR_OR_LEAVE(port->atapi, meta, ret, done); | SNAPSHOT_VAR_OR_LEAVE(port->atapi, meta, ret, done); | ||||
SNAPSHOT_VAR_OR_LEAVE(port->reset, meta, ret, done); | SNAPSHOT_VAR_OR_LEAVE(port->reset, meta, ret, done); | ||||
SNAPSHOT_VAR_OR_LEAVE(port->waitforclear, meta, ret, done); | SNAPSHOT_VAR_OR_LEAVE(port->waitforclear, meta, ret, done); | ||||
SNAPSHOT_VAR_OR_LEAVE(port->mult_sectors, meta, ret, done); | SNAPSHOT_VAR_OR_LEAVE(port->mult_sectors, meta, ret, done); | ||||
SNAPSHOT_VAR_OR_LEAVE(port->xfermode, meta, ret, done); | SNAPSHOT_VAR_OR_LEAVE(port->xfermode, meta, ret, done); | ||||
SNAPSHOT_VAR_OR_LEAVE(port->err_cfis, meta, ret, done); | SNAPSHOT_VAR_OR_LEAVE(port->err_cfis, meta, ret, done); | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |