Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / hidds / nouveau / drm / libdrm / arosdrm.h
blobf1922d8e9939960c0e85d8b9be71bd89fb3060df
1 /*
2 * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
4 * All Rights Reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
27 #if !defined(AROSDRM_H)
28 #define AROSDRM_H
30 #include <drm.h>
32 typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */
33 typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */
35 typedef struct _drmLock {
36 volatile unsigned int lock;
37 char padding[60];
38 /* This is big enough for most current (and future?) architectures:
39 DEC Alpha: 32 bytes
40 Intel Merced: ?
41 Intel P5/PPro/PII/PIII: 32 bytes
42 Intel StrongARM: 32 bytes
43 Intel i386/i486: 16 bytes
44 MIPS: 32 bytes (?)
45 Motorola 68k: 16 bytes
46 Motorola PowerPC: 32 bytes
47 Sun SPARC: 32 bytes
49 } drmLock, *drmLockPtr;
51 typedef struct _drmVersion {
52 int version_major; /**< Major version */
53 int version_minor; /**< Minor version */
54 int version_patchlevel; /**< Patch level */
55 int name_len; /**< Length of name buffer */
56 char *name; /**< Name of driver */
57 int date_len; /**< Length of date buffer */
58 char *date; /**< User-space buffer to hold date */
59 int desc_len; /**< Length of desc buffer */
60 char *desc; /**< User-space buffer to hold desc */
61 } drmVersion, *drmVersionPtr;
63 extern int drmOpen(const char *name, const char *busid);
64 extern int drmClose(int fd);
65 extern drmVersionPtr drmGetVersion(int fd);
66 extern void drmFreeVersion(drmVersionPtr);
67 extern int drmCommandNone(int fd, unsigned long drmCommandIndex);
68 extern int drmCommandRead(int fd, unsigned long drmCommandIndex,
69 void *data, unsigned long size);
70 extern int drmCommandWrite(int fd, unsigned long drmCommandIndex,
71 void *data, unsigned long size);
72 extern int drmCommandWriteRead(int fd, unsigned long drmCommandIndex,
73 void *data, unsigned long size);
74 extern int drmCreateContext(int fd, drm_context_t * handle);
75 extern int drmDestroyContext(int fd, drm_context_t handle);
76 extern int drmIoctl(int fd, unsigned long request, void *arg);
78 extern void *drmMalloc(int size);
79 extern void drmFree(void *pt);
81 /* AROS specific */
82 extern void * drmMMap(int fd, uint32_t handle);
83 extern void drmMUnmap(int fd, uint32_t handle);
85 #endif