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