/* -*- Mode: C; tab-width: 4; indent-tabs-mode: 't; c-basic-offset: 4 -*- * * Name : $RCSfile: linuxsrv.h $ * * Copyright : 2001,2002 by Imagination Technologies Limited. * All rights reserved. * No part of this software, either material or conceptual * may be copied or distributed, transmitted, transcribed, * stored in a retrieval system or translated into any * human or computer language in any form by any means, * electronic, mechanical, manual or other-wise, or * disclosed to third parties without the express written * permission of: * Imagination Technologies Limited, * HomePark Industrial Estate, * Kings Langley, * Hertfordshire, * WD4 8LZ, * UK * * Description : module defs for pvr core drivers * * Version : $Revision: 1.13 $ * **************************************************************************/ #ifndef _LINUXSRV_H__ #define _LINUXSRV_H__ #if !defined (LINUX) && !defined (ADS_ARM) #error "linuxsrv.h: don't include me in non-linux/non-ADS builds" #endif /* these are the node names used to access the core drivers */ #define KERNMAN_DRVNAME "/dev/pvrcore0" #define PMXSERV_DRVNAME "/dev/pvrcore1" #define PMXDXSERV_DRVNAME "/dev/pvrcore2" #define TWODAPI_DRVNAME "/dev/pvr2d" /* these are the minor numbers that are used to distinguish the target driver */ #define KERNMAN_DRV_MINOR 0 #define PMXSERV_DRV_MINOR 1 #define PMXDXSERV_DRV_MINOR 2 /* as we are only allowed one argument to ioctl in linux, package up the windows DeviceIOControl data into the structure below and send it. This allows the windows code to work if you substitute a DeviceIOControl of your own that acts as a wrapper. */ typedef struct tagIOCTL_PACKAGE { unsigned long dwCmd; // ioctl command unsigned long dwSize; // needs to be correctly set void *pInBuffer; // input data buffer unsigned long dwInBufferSize; // size of input data buffer void *pOutBuffer; // output data buffer unsigned long dwOutBufferSize; // size of output data buffer } IOCTL_PACKAGE; /* // This defines the maximum size of the array // of KV_OFFSET_STRUCT elements which represent // individually mmapped kernel memory areas. */ #define MAX_MMAP_AREAS 512 #define KVOFFSET_TABLE_SIZE (sizeof(KV_OFFSET_LOCKED_STRUCT) + sizeof(KV_OFFSET_STRUCT) * MAX_MMAP_AREAS) typedef enum { PVR_MMAP_CONTIG, PVR_MMAP_VIRTUAL, PVR_MMAP_SCATTER, PVR_MMAP_AGP_SCATTER } PVR_MMAP_TYPE; /* // This structure represents the relationship // between an mmap file offset and a kernel // virtual address. */ typedef struct tagKV_OFFSET_STRUCT { unsigned long pkvPageAlignedAddress; unsigned long nOffset; unsigned long nLength; PVR_MMAP_TYPE eMapType; unsigned long bCached; unsigned long pPhysAddr; } KV_OFFSET_STRUCT; /* table of above structures plus lock */ typedef struct tagKV_OFFSET_LOCKED_STRUCT { unsigned long *lockAddress; KV_OFFSET_STRUCT pKVOffsetTable[0]; } KV_OFFSET_LOCKED_STRUCT; typedef KV_OFFSET_STRUCT* PKV_OFFSET_STRUCT; typedef KV_OFFSET_LOCKED_STRUCT *PKV_OFFSET_LOCKED_STRUCT; /* new ioctls to deal with the registry reading mechanism */ #define GENERIC_IOCTL_SEND_REGISTRY_INFO 0x80000001 #define GENERIC_IOCTL_GET_REGISTRY_INFO 0x80000002 #define GENERIC_IOCTL_INIT_CARD 0x80000003 #define GENERIC_IOCTL_MUNMAP_EVENT 0x80000004 /* DRM interface */ #ifndef DRM_IOCTL_BASE #define DRM_IOCTL_BASE 'd' #define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) #endif #define DRM_IOCTL_PVR_MMAP DRM_IO(0x40) #define DRM_IOCTL_PVR_DRM DRM_IO(0x41) #define DRM_IOCTL_PVR DRM_IO(0x42) typedef struct __REGISTRY_ENTRY { char cEntryName[64]; /* Entry name */ char cKeyName[32]; /* Key name */ int dwData; /* Value stored */ char cData[32]; /* String data, sometimes used */ int disabled; /* true if the item was prefixed by ; */ }REGISTRY_ENTRY; #define MAX_REGISTRY_ENTRIES 200 /* max of 200 registry entries for the moment */ typedef struct __MUNMAP_EVENT { unsigned long userAddress; unsigned long length; } MUNMAP_EVENT; unsigned DeviceIoControl(unsigned hDevice, /* handle to device */ unsigned long dwIoControlCode, /* operation */ void *pInBuffer, /* input data buffer */ unsigned long nInBufferSize, /* size of input data buffer */ void * pOutBuffer, /* output data buffer */ unsigned long nOutBufferSize, /* size of output data buffer */ unsigned long *pBytesReturned); /* byte count */ int PVROopenService(char *service); void PVRCloseService(int service); #endif /* end of $RCSfile: linuxsrv.h $ */