1 /* $Id: sun-fbs4.c,v 1.2 2009/08/29 21:27:00 fredette Exp $ */
2
3 /* bus/sbus/sun-fbs4.c - Sun SBus S4 framebuffer emulation: */
4
5 /*
6 * Copyright (c) 2006 Matt Fredette
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Matt Fredette.
20 * 4. The name of the author may not be used to endorse or promote products
21 * derived from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
27 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36 #include <tme/common.h>
37 _TME_RCSID("$Id: sun-fbs4.c,v 1.2 2009/08/29 21:27:00 fredette Exp $");
38
39 /* includes: */
40 #include <tme/machine/sun.h>
41
42 /* this creates a new SBus bwtwo: */
TME_ELEMENT_SUB_NEW_DECL(tme_bus_sbus,bwtwo)43 TME_ELEMENT_SUB_NEW_DECL(tme_bus_sbus,bwtwo) {
44 const char *sub_args[4];
45
46 /* the bwtwo implementation requires an explicit type: */
47 sub_args[0] = args[0];
48 sub_args[1] = "type";
49 sub_args[2] = "sbus";
50 sub_args[3] = NULL;
51
52 /* we don't expect any arguments: */
53 if (args[1] != NULL) {
54 tme_output_append_error(_output,
55 "%s %s, ",
56 args[1],
57 _("unexpected"));
58 return (EINVAL);
59 }
60
61 /* create the new bwtwo: */
62 return (tme_sun_bwtwo(element, sub_args, _output));
63 }
64
65 /* this creates a new Sbus cgthree: */
TME_ELEMENT_SUB_NEW_DECL(tme_bus_sbus,cgthree)66 TME_ELEMENT_SUB_NEW_DECL(tme_bus_sbus,cgthree) {
67 return (tme_sun_cgthree(element, args, _output));
68 }
69
70 /* this creates a new Sbus cgsix: */
TME_ELEMENT_SUB_NEW_DECL(tme_bus_sbus,cgsix)71 TME_ELEMENT_SUB_NEW_DECL(tme_bus_sbus,cgsix) {
72 return (tme_sun_cgsix(element, args, _output));
73 }
74