1/* 2 * Copyright (c) 2000-2008 Apple 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#ifndef _IOATAREGI386_H 24#define _IOATAREGI386_H 25 26#include <libkern/c++/OSObject.h> 27 28/* 29 * IOATAReg: ATA register abstract base class. 30 */ 31#define DefineIOATAReg(w) \ 32class IOATAReg##w : public OSObject \ 33{ \ 34 OSDeclareAbstractStructors( IOATAReg##w ) \ 35 \ 36public: \ 37 virtual void operator = (UInt##w rhs) = 0; \ 38 virtual operator UInt##w() const = 0; \ 39} 40 41DefineIOATAReg( 8 ); 42DefineIOATAReg( 16 ); 43DefineIOATAReg( 32 ); 44 45typedef IOATAReg8 * IOATARegPtr8; 46typedef IOATAReg16 * IOATARegPtr16; 47typedef IOATAReg32 * IOATARegPtr32; 48 49#define IOATARegPtr8Cast(x) (x) 50 51/* 52 * IOATAIOReg: I/O mapped ATA registers. 53 */ 54#define DefineIOATAIOReg(w) \ 55class IOATAIOReg##w : public IOATAReg##w \ 56{ \ 57 OSDeclareDefaultStructors( IOATAIOReg##w ) \ 58 \ 59protected: \ 60 UInt16 _address; \ 61 \ 62public: \ 63 static IOATAIOReg##w * withAddress( UInt16 address ); \ 64 \ 65 virtual bool initWithAddress( UInt16 address ); \ 66 virtual UInt16 getAddress() const; \ 67 \ 68 virtual void operator = (UInt##w rhs); \ 69 virtual operator UInt##w() const; \ 70} 71 72DefineIOATAIOReg( 8 ); 73DefineIOATAIOReg( 16 ); 74DefineIOATAIOReg( 32 ); 75 76#endif /* !_IOATAREGI386_H */ 77