xf86sbusBus.h revision 45e9809aff7304721fddb95654901b32195c9c7a
148N/A/*
148N/A * SBUS bus-specific declarations
148N/A *
148N/A * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
148N/A *
148N/A * Permission is hereby granted, free of charge, to any person obtaining a copy
148N/A * of this software and associated documentation files (the "Software"), to deal
148N/A * in the Software without restriction, including without limitation the rights
148N/A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
148N/A * copies of the Software, and to permit persons to whom the Software is
148N/A * furnished to do so, subject to the following conditions:
148N/A *
148N/A * The above copyright notice and this permission notice shall be included in
148N/A * all copies or substantial portions of the Software.
148N/A *
148N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
148N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
148N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
148N/A * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
148N/A * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
148N/A * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
148N/A */
690N/A
148N/A#ifndef _XF86_SBUSBUS_H
148N/A#define _XF86_SBUSBUS_H
148N/A
148N/A#include "xf86str.h"
148N/A
148N/A#define SBUS_DEVICE_BW2 0x0001
618N/A#define SBUS_DEVICE_CG2 0x0002
148N/A#define SBUS_DEVICE_CG3 0x0003
148N/A#define SBUS_DEVICE_CG4 0x0004
844N/A#define SBUS_DEVICE_CG6 0x0005
844N/A#define SBUS_DEVICE_CG8 0x0006
148N/A#define SBUS_DEVICE_CG12 0x0007
1273N/A#define SBUS_DEVICE_CG14 0x0008
148N/A#define SBUS_DEVICE_LEO 0x0009
1002N/A#define SBUS_DEVICE_TCX 0x000a
1002N/A#define SBUS_DEVICE_FFB 0x000b
1002N/A#define SBUS_DEVICE_GT 0x000c
1002N/A#define SBUS_DEVICE_MGX 0x000d
1002N/A
1002N/Atypedef struct sbus_prom_node {
148N/A int node;
148N/A /* Because of misdesigned openpromio */
148N/A int cookie[2];
181N/A} sbusPromNode, *sbusPromNodePtr;
148N/A
148N/Atypedef struct sbus_device {
148N/A int devId;
148N/A int fbNum;
148N/A int fd;
148N/A int width, height;
148N/A sbusPromNode node;
148N/A char *descr;
148N/A char *device;
148N/A} sbusDevice, *sbusDevicePtr;
148N/A
148N/Aextern struct sbus_devtable {
1002N/A int devId;
690N/A int fbType;
148N/A char *promName;
1002N/A char *descr;
1002N/A} sbusDeviceTable[];
148N/A
727N/Avoid xf86SbusProbe(void);
727N/Aextern sbusDevicePtr *xf86SbusInfo;
822N/A
822N/Aint xf86MatchSbusInstances(const char *driverName, int sbusDevId,
727N/A GDevPtr *devList, int numDevs, DriverPtr drvp,
727N/A int **foundEntities);
727N/AsbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex);
727N/Aint xf86GetEntityForSbusInfo(sbusDevicePtr psdp);
822N/Avoid xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp);
727N/Apointer xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset,
727N/A unsigned long size);
148N/Avoid xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size);
148N/Avoid xf86SbusHideOsHwCursor(sbusDevicePtr psdp);
148N/Avoid xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg);
148N/ABool xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp);
560N/A
727N/Aextern int promRootNode;
148N/A
181N/Aint promGetSibling(int node);
148N/Aint promGetChild(int node);
148N/Achar * promGetProperty(const char *prop, int *lenp);
148N/Aint promGetBool(const char *prop);
148N/A
int sparcPromInit(void);
void sparcPromClose(void);
char * sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp);
int sparcPromGetBool(sbusPromNodePtr pnode, const char *prop);
void sparcPromAssignNodes(void);
char * sparcPromNode2Pathname(sbusPromNodePtr pnode);
int sparcPromPathname2Node(const char *pathName);
#endif /* _XF86_SBUSBUS_H */