1 | /* $Id: $ */
|
---|
2 | /** @file
|
---|
3 | *
|
---|
4 | * VBox storage devices:
|
---|
5 | * PIIX3 ATA busmaster controller definitions
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2015 Oracle Corporation
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | * available from http://www.virtualbox.org. This file is free software;
|
---|
13 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | * General Public License (GPL) as published by the Free Software
|
---|
15 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | */
|
---|
19 |
|
---|
20 | #ifndef __PIIX3ATABmDma_h__
|
---|
21 | #define __PIIX3ATABmDma_h__
|
---|
22 |
|
---|
23 |
|
---|
24 | /** @defgroup grp_piix3atabmdma PIIX3 ATA Bus Master DMA
|
---|
25 | * @{
|
---|
26 | */
|
---|
27 |
|
---|
28 | /** @name BM_STATUS
|
---|
29 | * @{
|
---|
30 | */
|
---|
31 | /** Currently performing a DMA operation. */
|
---|
32 | #define BM_STATUS_DMAING 0x01
|
---|
33 | /** An error occurred during the DMA operation. */
|
---|
34 | #define BM_STATUS_ERROR 0x02
|
---|
35 | /** The DMA unit has raised the IDE interrupt line. */
|
---|
36 | #define BM_STATUS_INT 0x04
|
---|
37 | /** User-defined bit 0, commonly used to signal that drive 0 supports DMA. */
|
---|
38 | #define BM_STATUS_D0DMA 0x20
|
---|
39 | /** User-defined bit 1, commonly used to signal that drive 1 supports DMA. */
|
---|
40 | #define BM_STATUS_D1DMA 0x40
|
---|
41 | /** @} */
|
---|
42 |
|
---|
43 | /** @name BM_CMD
|
---|
44 | * @{
|
---|
45 | */
|
---|
46 | /** Start the DMA operation. */
|
---|
47 | #define BM_CMD_START 0x01
|
---|
48 | /** Data transfer direction: from device to memory if set. */
|
---|
49 | #define BM_CMD_WRITE 0x08
|
---|
50 | /** @} */
|
---|
51 |
|
---|
52 |
|
---|
53 | /** PIIX3 Bus Master DMA unit state. */
|
---|
54 | typedef struct BMDMAState {
|
---|
55 | /** Command register. */
|
---|
56 | uint8_t u8Cmd;
|
---|
57 | /** Status register. */
|
---|
58 | uint8_t u8Status;
|
---|
59 | /** Address of the MMIO region in the guest's memory space. */
|
---|
60 | RTGCPHYS32 pvAddr;
|
---|
61 | } BMDMAState;
|
---|
62 |
|
---|
63 |
|
---|
64 | /** PIIX3 Bus Master DMA descriptor entry. */
|
---|
65 | typedef struct BMDMADesc {
|
---|
66 | /** Address of the DMA source/target buffer. */
|
---|
67 | RTGCPHYS32 pBuffer;
|
---|
68 | /** Size of the DMA source/target buffer. */
|
---|
69 | uint32_t cbBuffer;
|
---|
70 | } BMDMADesc;
|
---|
71 |
|
---|
72 | /** @} */
|
---|
73 |
|
---|
74 |
|
---|
75 | #endif /* !__PIIX3ATABmDma_h__ */
|
---|