]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/IOCommand.h
xnu-517.7.21.tar.gz
[apple/xnu.git] / iokit / IOKit / IOCommand.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 /*
24 *
25 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
26 *
27 * HISTORY
28 *
29 * 2001-01-18 gvdl Made the primary queue pointer public, to be used when
30 * Ownership is clear.
31 * 11/13/2000 CJS Created IOCommand class and implementation
32 *
33 */
34
35 /*!
36 * @header IOCommand
37 * @abstract
38 * This header contains the IOCommand class definition.
39 */
40
41 #ifndef _IOKIT_IO_COMMAND_H_
42 #define _IOKIT_IO_COMMAND_H_
43
44 /*
45 * Kernel
46 */
47
48 #if defined(KERNEL) && defined(__cplusplus)
49
50 #include <kern/queue.h>
51 #include <libkern/c++/OSObject.h>
52
53 class IOCommandPool;
54
55 /*!
56 * @class IOCommand
57 * @abstract
58 * This class is an abstract class which represents an I/O command.
59 * @discussion
60 * This class is an abstract class which represents an I/O command passed
61 * from a device driver to a controller. All controller commands (e.g. IOATACommand)
62 * should inherit from this class.
63 */
64
65 class IOCommand : public OSObject
66 {
67 OSDeclareAbstractStructors(IOCommand)
68
69 protected:
70 virtual bool init(void);
71
72 public:
73 /*! @var fCommandChain
74 This variable is used by the current 'owner' to queue the command. During the life cycle of a command it moves through a series of queues. This is the queue pointer for it. Only valid while 'ownership' is clear. For instance a IOCommandPool uses this pointer to maintain its list of free commands. May be manipulated using the kern/queue.h macros */
75 queue_chain_t fCommandChain; /* used to queue commands */
76 };
77
78 #endif /* defined(KERNEL) && defined(__cplusplus) */
79
80 #endif /* _IOKIT_IO_COMMAND_H_ */