hpcmips hpcsh common files are moved to arch/hpc.
This commit is contained in:
parent
f80f6c9cca
commit
6be22c0c6f
5
sys/arch/hpc/Makefile
Normal file
5
sys/arch/hpc/Makefile
Normal file
@ -0,0 +1,5 @@
|
||||
# $NetBSD: Makefile,v 1.1 2001/01/28 02:52:15 uch Exp $
|
||||
|
||||
SUBDIR= hpc
|
||||
|
||||
.include <bsd.kinc.mk>
|
4
sys/arch/hpc/conf/files.hpc
Normal file
4
sys/arch/hpc/conf/files.hpc
Normal file
@ -0,0 +1,4 @@
|
||||
# $NetBSD: files.hpc,v 1.1 2001/01/28 02:52:16 uch Exp $
|
||||
|
||||
file arch/hpc/hpc/config_hook.c
|
||||
file arch/hpc/hpc/platid.c
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.4 2000/05/20 03:41:28 shin Exp $
|
||||
# $NetBSD: Makefile,v 1.1 2001/01/28 02:52:16 uch Exp $
|
||||
|
||||
SUBDIR= platid_gen
|
||||
|
||||
@ -9,10 +9,13 @@ test: platid_test
|
||||
diff platid_test.out platid_test.canon
|
||||
|
||||
platid_test: platid.c platid_mask.c platid_test.c platid_name.c
|
||||
ln -sf ../include ./machine
|
||||
ln -sf ./ ./machine
|
||||
ln -sf ../../mips/include ./mips
|
||||
$(HOST_CC) -I. -DPLATID_TEST platid.c platid_mask.c platid_name.c platid_test.c -o $@
|
||||
|
||||
CLEANFILES+= platid_test platid_test.out machine mips
|
||||
|
||||
clean:
|
||||
rm -f machine mips platid_test.out platid_test
|
||||
|
||||
.include <bsd.subdir.mk>
|
99
sys/arch/hpc/hpc/bootinfo.h
Normal file
99
sys/arch/hpc/hpc/bootinfo.h
Normal file
@ -0,0 +1,99 @@
|
||||
/* $NetBSD: bootinfo.h,v 1.1 2001/01/28 02:52:16 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPC_BOOTINFO_H_
|
||||
#define _HPC_BOOTINFO_H_
|
||||
|
||||
struct bootinfo {
|
||||
short length;
|
||||
short reserved;
|
||||
int magic;
|
||||
void *fb_addr;
|
||||
short fb_line_bytes;
|
||||
short fb_width;
|
||||
short fb_height;
|
||||
short fb_type;
|
||||
|
||||
short bi_cnuse;
|
||||
unsigned long platid_cpu;
|
||||
unsigned long platid_machine;
|
||||
|
||||
long timezone;
|
||||
};
|
||||
|
||||
#define BI_CNUSE_BUILTIN (1<<0)
|
||||
#define BI_CNUSE_SERIAL (1<<1)
|
||||
|
||||
extern struct bootinfo *bootinfo;
|
||||
#define BOOTINFO_MAGIC 0x13536135
|
||||
|
||||
#define BIFB_D2_M2L_3 0
|
||||
#define BIFBN_D2_M2L_3 "D2_M2L_3"
|
||||
|
||||
#define BIFB_D2_M2L_3x2 1
|
||||
#define BIFBN_D2_M2L_3x2 "D2_M2L_3x2"
|
||||
|
||||
#define BIFB_D2_M2L_0 2
|
||||
#define BIFBN_D2_M2L_0 "D2_M2L_0"
|
||||
|
||||
#define BIFB_D8_00 3
|
||||
#define BIFBN_D8_00 "D8_00"
|
||||
|
||||
#define BIFB_D8_FF 4
|
||||
#define BIFBN_D8_FF "D8_FF"
|
||||
|
||||
#define BIFB_D16_0000 5
|
||||
#define BIFBN_D16_0000 "D16_0000"
|
||||
|
||||
#define BIFB_D16_FFFF 6
|
||||
#define BIFBN_D16_FFFF "D16_FFFF"
|
||||
|
||||
#define BIFB_D2_M2L_0x2 7
|
||||
#define BIFBN_D2_M2L_0x2 "D2_M2L_0x2"
|
||||
|
||||
#define BIFB_D4_M2L_F 8
|
||||
#define BIFBN_D4_M2L_F "D4_M2L_F"
|
||||
|
||||
#define BIFB_D4_M2L_Fx2 9
|
||||
#define BIFBN_D4_M2L_Fx2 "D4_M2L_Fx2"
|
||||
|
||||
#define BIFB_D4_M2L_0 10
|
||||
#define BIFBN_D4_M2L_0 "D4_M2L_0"
|
||||
|
||||
#define BIFB_D4_M2L_0x2 11
|
||||
#define BIFBN_D4_M2L_0x2 "D4_M2L_0x2"
|
||||
|
||||
#endif /* _HPC_BOOTINFO_H_ */
|
@ -1,7 +1,7 @@
|
||||
/* $NetBSD: config_hook.c,v 1.3 2000/08/10 08:27:54 jeffs Exp $ */
|
||||
/* $NetBSD: config_hook.c,v 1.1 2001/01/28 02:52:17 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
309
sys/arch/hpc/hpc/config_hook.h
Normal file
309
sys/arch/hpc/hpc/config_hook.h
Normal file
@ -0,0 +1,309 @@
|
||||
/* $NetBSD: config_hook.h,v 1.1 2001/01/28 02:52:17 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_HOOK_H_
|
||||
#define _CONFIG_HOOK_H_
|
||||
|
||||
enum config_hook_mode {
|
||||
CONFIG_HOOK_SHARE,
|
||||
CONFIG_HOOK_REPLACE,
|
||||
CONFIG_HOOK_EXCLUSIVE,
|
||||
};
|
||||
|
||||
typedef void *config_hook_tag;
|
||||
|
||||
void config_hook_init __P((void));
|
||||
config_hook_tag config_hook __P((int type, long id, enum config_hook_mode mode,
|
||||
int (*func) __P((void*, int, long, void*)),
|
||||
void *ctx));
|
||||
void config_unhook __P((config_hook_tag));
|
||||
int config_hook_call __P((int type, long id, void *msg));
|
||||
|
||||
/*
|
||||
* hook types and IDs
|
||||
*/
|
||||
/* apm releted events */
|
||||
#define CONFIG_HOOK_PMEVENT 0
|
||||
#define CONFIG_HOOK_PMEVENT_STANDBYREQ 0
|
||||
#define CONFIG_HOOK_PMEVENT_SUSPENDREQ 1
|
||||
#define CONFIG_HOOK_PMEVENT_HARDPOWER 2
|
||||
#define CONFIG_HOOK_PMEVENT_BATTERY 3
|
||||
#define CONFIG_HOOK_PMEVENT_AC 4
|
||||
|
||||
|
||||
/* get value */
|
||||
#define CONFIG_HOOK_GET 1
|
||||
/* set value and send event */
|
||||
#define CONFIG_HOOK_SET 2
|
||||
/* external event */
|
||||
#define CONFIG_HOOK_EVENT CONFIG_HOOK_SET
|
||||
|
||||
|
||||
/* CONFIG_HOOK_GET/CONFIG_HOOK_SET/CONFIG_HOOK_EVENT event id's */
|
||||
#define CONFIG_HOOK_POWER_COM0 0
|
||||
#define CONFIG_HOOK_POWER_COM1 1
|
||||
#define CONFIG_HOOK_POWER_COM2 2
|
||||
#define CONFIG_HOOK_POWER_COM3 3
|
||||
#define CONFIG_HOOK_POWER_LCDLIGHT 4
|
||||
#define CONFIG_HOOK_POWER_LCD 5
|
||||
#define CONFIG_HOOK_POWER_SPEAKER 6
|
||||
#define CONFIG_HOOK_BUTTON_POWER 7
|
||||
#define CONFIG_HOOK_BUTTON_OK 8
|
||||
#define CONFIG_HOOK_BUTTON_CANCEL 9
|
||||
#define CONFIG_HOOK_BUTTON_UP 10
|
||||
#define CONFIG_HOOK_BUTTON_DOWN 11
|
||||
#define CONFIG_HOOK_BUTTON_REC 12
|
||||
#define CONFIG_HOOK_BUTTON_COVER 13
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT 14
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST 15
|
||||
#define CONFIG_HOOK_BUTTON_APP0 16
|
||||
#define CONFIG_HOOK_BUTTON_APP1 17
|
||||
#define CONFIG_HOOK_BUTTON_APP2 18
|
||||
#define CONFIG_HOOK_BUTTON_APP3 19
|
||||
#define CONFIG_HOOK_BUTTON_LEFT 20
|
||||
#define CONFIG_HOOK_BUTTON_RIGHT 21
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST_UP 22
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST_DOWN 23
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT_UP 24
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT_DOWN 25
|
||||
#define CONFIG_HOOK_LED 26
|
||||
#define CONFIG_HOOK_LED_MAX 27
|
||||
#define CONFIG_HOOK_CONTRAST 28
|
||||
#define CONFIG_HOOK_CONTRAST_MAX 29
|
||||
#define CONFIG_HOOK_BRIGHTNESS 30
|
||||
#define CONFIG_HOOK_BRIGHTNESS_MAX 31
|
||||
#define CONFIG_HOOK_COM0_CTS 32
|
||||
#define CONFIG_HOOK_COM1_CTS 33
|
||||
#define CONFIG_HOOK_COM2_CTS 34
|
||||
#define CONFIG_HOOK_COM3_CTS 35
|
||||
#define CONFIG_HOOK_COM0_DCD 36
|
||||
#define CONFIG_HOOK_COM1_DCD 37
|
||||
#define CONFIG_HOOK_COM2_DCD 38
|
||||
#define CONFIG_HOOK_COM3_DCD 39
|
||||
#define CONFIG_HOOK_COM0_RTS 40
|
||||
#define CONFIG_HOOK_COM1_RTS 41
|
||||
#define CONFIG_HOOK_COM2_RTS 42
|
||||
#define CONFIG_HOOK_COM3_RTS 43
|
||||
#define CONFIG_HOOK_COM0_DTR 44
|
||||
#define CONFIG_HOOK_COM1_DTR 45
|
||||
#define CONFIG_HOOK_COM2_DTR 46
|
||||
#define CONFIG_HOOK_COM3_DTR 47
|
||||
#define CONFIG_HOOK_BATTERYVAL 48
|
||||
#define CONFIG_HOOK_ACADAPTER 49
|
||||
#define CONFIG_HOOK_CHARGE 50
|
||||
|
||||
#define CONFIG_HOOK_MAX_ID CONFIG_HOOK_CHARGE
|
||||
|
||||
/* old type events */
|
||||
|
||||
#define CONFIG_HOOK_POWERCONTROL 3
|
||||
#define CONFIG_HOOK_POWERCONTROL_COM0 CONFIG_HOOK_POWER_COM0
|
||||
#define CONFIG_HOOK_POWERCONTROL_COM1 CONFIG_HOOK_POWER_COM1
|
||||
#define CONFIG_HOOK_POWERCONTROL_COM2 CONFIG_HOOK_POWER_COM2
|
||||
#define CONFIG_HOOK_POWERCONTROL_COM3 CONFIG_HOOK_POWER_COM3
|
||||
#define CONFIG_HOOK_POWERCONTROL_LCDLIGHT CONFIG_HOOK_POWER_LCDLIGHT
|
||||
#define CONFIG_HOOK_POWERCONTROL_LCD CONFIG_HOOK_POWER_LCD
|
||||
#define CONFIG_HOOK_POWERCONTROL_SPEAKER CONFIG_HOOK_POWER_SPEAKER
|
||||
#define CONFIG_HOOK_POWERCONTROL_LED CONFIG_HOOK_LED
|
||||
|
||||
#define CONFIG_HOOK_BUTTONEVENT 4
|
||||
#define CONFIG_HOOK_BUTTONEVENT_POWER CONFIG_HOOK_BUTTON_POWER
|
||||
#define CONFIG_HOOK_BUTTONEVENT_OK CONFIG_HOOK_BUTTON_OK
|
||||
#define CONFIG_HOOK_BUTTONEVENT_CANCEL CONFIG_HOOK_BUTTON_CANCEL
|
||||
#define CONFIG_HOOK_BUTTONEVENT_UP CONFIG_HOOK_BUTTON_UP
|
||||
#define CONFIG_HOOK_BUTTONEVENT_DOWN CONFIG_HOOK_BUTTON_DOWN
|
||||
#define CONFIG_HOOK_BUTTONEVENT_REC CONFIG_HOOK_BUTTON_REC
|
||||
#define CONFIG_HOOK_BUTTONEVENT_COVER CONFIG_HOOK_BUTTON_COVER
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LIGHT CONFIG_HOOK_BUTTON_LIGHT
|
||||
#define CONFIG_HOOK_BUTTONEVENT_CONTRAST CONFIG_HOOK_BUTTON_CONTRAST
|
||||
#define CONFIG_HOOK_BUTTONEVENT_APP0 CONFIG_HOOK_BUTTON_APP0
|
||||
#define CONFIG_HOOK_BUTTONEVENT_APP1 CONFIG_HOOK_BUTTON_APP1
|
||||
#define CONFIG_HOOK_BUTTONEVENT_APP2 CONFIG_HOOK_BUTTON_APP2
|
||||
#define CONFIG_HOOK_BUTTONEVENT_APP3 CONFIG_HOOK_BUTTON_APP3
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LEFT CONFIG_HOOK_BUTTON_LEFT
|
||||
#define CONFIG_HOOK_BUTTONEVENT_RIGHT CONFIG_HOOK_BUTTON_RIGHT
|
||||
#define CONFIG_HOOK_BUTTONEVENT_CONTRAST_UP CONFIG_HOOK_BUTTON_CONTRAST_UP
|
||||
#define CONFIG_HOOK_BUTTONEVENT_CONTRAST_DOWN CONFIG_HOOK_BUTTON_CONTRAST_DOWN
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LIGHT_UP CONFIG_HOOK_BUTTON_LIGHT_UP
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LIGHT_DOWN CONFIG_HOOK_BUTTON_LIGHT_DOWN
|
||||
|
||||
#define CONFIG_HOOK_NTYPES 5
|
||||
|
||||
/*
|
||||
* nicknames for including from configration file.
|
||||
*/
|
||||
#ifdef CONFIG_HOOK_DEFINE_NICKNAME
|
||||
#define PMEVENT CONFIG_HOOK_PMEVENT
|
||||
#define SET CONFIG_HOOK_SET
|
||||
#define EVENT CONFIG_HOOK_EVENT
|
||||
#define GET CONFIG_HOOK_GET
|
||||
/* old event type */
|
||||
#define POWER CONFIG_HOOK_POWERCONTROL
|
||||
#define BUTTON CONFIG_HOOK_BUTTONEVENT
|
||||
|
||||
#define PWCTL_COM0 CONFIG_HOOK_POWER_COM0
|
||||
#define PWCTL_COM1 CONFIG_HOOK_POWER_COM1
|
||||
#define PWCTL_COM2 CONFIG_HOOK_POWER_COM2
|
||||
#define PWCTL_COM3 CONFIG_HOOK_POWER_COM3
|
||||
#define PWCTL_LCDLIGHT CONFIG_HOOK_POWER_LCDLIGHT
|
||||
#define PWCTL_LCD CONFIG_HOOK_POWER_LCD
|
||||
#define PWCTL_SPEAKER CONFIG_HOOK_POWER_SPEAKER
|
||||
#define PWCTL_LED CONFIG_HOOK_LED
|
||||
#define BTN_POWER CONFIG_HOOK_BUTTON_POWER
|
||||
#define BTN_OK CONFIG_HOOK_BUTTON_OK
|
||||
#define BTN_CANCEL CONFIG_HOOK_BUTTON_CANCEL
|
||||
#define BTN_UP CONFIG_HOOK_BUTTON_UP
|
||||
#define BTN_DOWN CONFIG_HOOK_BUTTON_DOWN
|
||||
#define BTN_REC CONFIG_HOOK_BUTTON_REC
|
||||
#define BTN_COVER CONFIG_HOOK_BUTTON_COVER
|
||||
#define BTN_LIGHT CONFIG_HOOK_BUTTON_LIGHT
|
||||
#define BTN_CONTRAST CONFIG_HOOK_BUTTON_CONTRAST
|
||||
#define BTN_APP0 CONFIG_HOOK_BUTTON_APP0
|
||||
#define BTN_APP1 CONFIG_HOOK_BUTTON_APP1
|
||||
#define BTN_APP2 CONFIG_HOOK_BUTTON_APP2
|
||||
#define BTN_APP3 CONFIG_HOOK_BUTTON_APP3
|
||||
#define BTN_LEFT CONFIG_HOOK_BUTTON_LEFT
|
||||
#define BTN_RIGHT CONFIG_HOOK_BUTTON_RIGHT
|
||||
#define BTN_CONTRAST_UP CONFIG_HOOK_BUTTON_CONTRAST_UP
|
||||
#define BTN_CONTRAST_DN CONFIG_HOOK_BUTTON_CONTRAST_DOWN
|
||||
#define BTN_LIGHT_UP CONFIG_HOOK_BUTTON_LIGHT_UP
|
||||
#define BTN_LIGHT_DN CONFIG_HOOK_BUTTON_LIGHT_DOWN
|
||||
/* PMEVENT */
|
||||
#define PME_STANBY CONFIG_HOOK_PMEVENT_STANDBYREQ
|
||||
#define PME_SUSPEND CONFIG_HOOK_PMEVENT_SUSPENDREQ
|
||||
#define PME_HARDPOWER CONFIG_HOOK_PMEVENT_HARDPOWER
|
||||
#define PME_BATTERY CONFIG_HOOK_PMEVENT_BATTERY
|
||||
#define PME_AC CONFIG_HOOK_PMEVENT_AC
|
||||
/* new one */
|
||||
#define POWER_COM0 CONFIG_HOOK_POWER_COM0
|
||||
#define POWER_COM1 CONFIG_HOOK_POWER_COM1
|
||||
#define POWER_COM2 CONFIG_HOOK_POWER_COM2
|
||||
#define POWER_COM3 CONFIG_HOOK_POWER_COM3
|
||||
#define POWER_LCDLIGHT CONFIG_HOOK_POWER_LCDLIGHT
|
||||
#define POWER_LCD CONFIG_HOOK_POWER_LCD
|
||||
#define POWER_SPEAKER CONFIG_HOOK_POWER_SPEAKER
|
||||
#define BUTTON_POWER CONFIG_HOOK_BUTTON_POWER
|
||||
#define BUTTON_OK CONFIG_HOOK_BUTTON_OK
|
||||
#define BUTTON_CANCEL CONFIG_HOOK_BUTTON_CANCEL
|
||||
#define BUTTON_UP CONFIG_HOOK_BUTTON_UP
|
||||
#define BUTTON_DOWN CONFIG_HOOK_BUTTON_DOWN
|
||||
#define BUTTON_REC CONFIG_HOOK_BUTTON_REC
|
||||
#define BUTTON_COVER CONFIG_HOOK_BUTTON_COVER
|
||||
#define BUTTON_LIGHT CONFIG_HOOK_BUTTON_LIGHT
|
||||
#define BUTTON_CONTRAST CONFIG_HOOK_BUTTON_CONTRAST
|
||||
#define BUTTON_APP0 CONFIG_HOOK_BUTTON_APP0
|
||||
#define BUTTON_APP1 CONFIG_HOOK_BUTTON_APP1
|
||||
#define BUTTON_APP2 CONFIG_HOOK_BUTTON_APP2
|
||||
#define BUTTON_APP3 CONFIG_HOOK_BUTTON_APP3
|
||||
#define BUTTON_LEFT CONFIG_HOOK_BUTTON_LEFT
|
||||
#define BUTTON_RIGHT CONFIG_HOOK_BUTTON_RIGHT
|
||||
#define BUTTON_CONTRAST_UP CONFIG_HOOK_BUTTON_CONTRAST_UP
|
||||
#define BUTTON_CONTRAST_DOWN CONFIG_HOOK_BUTTON_CONTRAST_DOWN
|
||||
#define BUTTON_LIFHT_UP CONFIG_HOOK_BUTTON_LIGHT_UP
|
||||
#define BUTTON_LIFHT_DOWN CONFIG_HOOK_BUTTON_LIGHT_DOWN
|
||||
#define LED CONFIG_HOOK_LED
|
||||
#define LED_MAX CONFIG_HOOK_LED_MAX
|
||||
#define CONTRAST CONFIG_HOOK_CONTRAST
|
||||
#define CONTRAST_MAX CONFIG_HOOK_CONTRAST_MAX
|
||||
#define BRIGHTNESS CONFIG_HOOK_BRIGHTNESS
|
||||
#define BRIGHTNESS_MAX CONFIG_HOOK_BRIGHTNESS_MAX
|
||||
#define COM0_CTS CONFIG_HOOK_COM0_CTS
|
||||
#define COM1_CTS CONFIG_HOOK_COM1_CTS
|
||||
#define COM2_CTS CONFIG_HOOK_COM2_CTS
|
||||
#define COM3_CTS CONFIG_HOOK_COM3_CTS
|
||||
#define COM0_DCD CONFIG_HOOK_COM0_DCD
|
||||
#define COM1_DCD CONFIG_HOOK_COM1_DCD
|
||||
#define COM2_DCD CONFIG_HOOK_COM2_DCD
|
||||
#define COM3_DCD CONFIG_HOOK_COM3_DCD
|
||||
#define COM0_RTS CONFIG_HOOK_COM0_RTS
|
||||
#define COM1_RTS CONFIG_HOOK_COM1_RTS
|
||||
#define COM2_RTS CONFIG_HOOK_COM2_RTS
|
||||
#define COM3_RTS CONFIG_HOOK_COM3_RTS
|
||||
#define COM0_DTR CONFIG_HOOK_COM0_DTR
|
||||
#define COM1_DTR CONFIG_HOOK_COM1_DTR
|
||||
#define COM2_DTR CONFIG_HOOK_COM2_DTR
|
||||
#define COM3_DTR CONFIG_HOOK_COM3_DTR
|
||||
#define BATTERYVAL CONFIG_HOOK_BATTERYVAL
|
||||
#define ACADAPTER CONFIG_HOOK_ACADAPTER
|
||||
#define CHARGE CONFIG_HOOK_CHARGE
|
||||
#endif /* CONFIG_HOOK_DEFINE_NICKNAME */
|
||||
|
||||
#define CONFIG_HOOK_MAXVALUE 1 /* max value, check in this file */
|
||||
#define CONFIG_HOOK_VALUEP(p) ((int)(p)>= 0 && (int)(p)<= CONFIG_HOOK_MAXVALUE)
|
||||
#define CONFIG_HOOK_PTRP(p) (!CONFIG_HOOK_VALUEP(p))
|
||||
|
||||
/*
|
||||
* POWERCONTROL value
|
||||
*/
|
||||
#define PWCTL_ON ((void *)1)
|
||||
#define PWCTL_OFF ((void *)0)
|
||||
|
||||
/* CONFIG_HOOK typical value */
|
||||
#define CONFIG_HOOK_ON 1
|
||||
#define CONFIG_HOOK_OFF 0
|
||||
|
||||
/*
|
||||
* CONFIG_HOOK_LED value
|
||||
*/
|
||||
#define CONFIG_HOOK_LED_ON 0
|
||||
#define CONFIG_HOOK_LED_OFF 1
|
||||
#define CONFIG_HOOK_LED_FLASH 2 /* flash 100msec */
|
||||
#define CONFIG_HOOK_LED_FLASH2 3 /* flash 200msec */
|
||||
#define CONFIG_HOOK_LED_FLASH5 4 /* flash 500msec */
|
||||
#define CONFIG_HOOK_LED_BLINK 5 /* blink 1sec interval */
|
||||
#define CONFIG_HOOK_LED_BLINK2 6 /* blink 2sec interval */
|
||||
|
||||
/*
|
||||
* CONFIG_HOOK_AC event value
|
||||
*/
|
||||
#define CONFIG_HOOK_AC_OFF 0
|
||||
#define CONFIG_HOOK_AC_ON_CHARGE 1
|
||||
#define CONFIG_HOOK_AC_ON_NOCHARGE 2
|
||||
#define CONFIG_HOOK_AC_UNKNOWN 3
|
||||
|
||||
/*
|
||||
* CONFIG_HOOK_BATTERY event value
|
||||
*/
|
||||
#define CONFIG_HOOK_BATT_CRITICAL 0
|
||||
#define CONFIG_HOOK_BATT_20P 1
|
||||
#define CONFIG_HOOK_BATT_LOW 2
|
||||
#define CONFIG_HOOK_BATT_50P 3
|
||||
#define CONFIG_HOOK_BATT_HIGH 4
|
||||
#define CONFIG_HOOK_BATT_80P 5
|
||||
#define CONFIG_HOOK_BATT_100P 6
|
||||
#define CONFIG_HOOK_BATT_UNKNOWN 7
|
||||
#define CONFIG_HOOK_BATT_NO_SYSTEM_BATTERY 8
|
||||
#endif /* _CONFIG_HOOK_H_ */
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: platid.awk,v 1.1.1.1 1999/09/16 12:23:20 takemura Exp $
|
||||
# $NetBSD: platid.awk,v 1.1 2001/01/28 02:52:18 uch Exp $
|
||||
#
|
||||
# Copyright (c) 1999
|
||||
# Shin Takemura and PocketBSD Project. All rights reserved.
|
@ -1,7 +1,7 @@
|
||||
/* $NetBSD: platid.c,v 1.4 2000/12/28 07:10:14 sato Exp $ */
|
||||
/* $NetBSD: platid.c,v 1.1 2001/01/28 02:52:21 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -33,11 +33,17 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <machine/platid.h>
|
||||
|
||||
platid_t platid_unknown = {{ PLATID_UNKNOWN, PLATID_UNKNOWN }};
|
||||
platid_t platid_wild = {{ PLATID_WILD, PLATID_WILD }};
|
||||
platid_t platid = {{ PLATID_UNKNOWN, PLATID_UNKNOWN }};
|
||||
|
||||
void
|
||||
platid_ntoh(platid_t *pid)
|
||||
{
|
||||
@ -45,7 +51,6 @@ platid_ntoh(platid_t *pid)
|
||||
pid->dw.dw1 = ntohl(pid->dw.dw1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
platid_hton(platid_t *pid)
|
||||
{
|
||||
@ -53,7 +58,6 @@ platid_hton(platid_t *pid)
|
||||
pid->dw.dw1 = htonl(pid->dw.dw1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
platid_dump(char *name, void* pxx)
|
||||
{
|
||||
@ -67,31 +71,26 @@ platid_dump(char *name, void* pxx)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
platid_t platid_unknown = {{ PLATID_UNKNOWN, PLATID_UNKNOWN }};
|
||||
platid_t platid_wild = {{ PLATID_WILD, PLATID_WILD }};
|
||||
platid_t platid = {{ PLATID_UNKNOWN, PLATID_UNKNOWN }};
|
||||
|
||||
|
||||
int
|
||||
platid_match(platid_t *platid, platid_mask_t *mask)
|
||||
{
|
||||
return platid_match_sub(platid, mask, 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
platid_match_sub(platid_t *platid, platid_mask_t *mask, int unknown_is_match)
|
||||
{
|
||||
int match_count;
|
||||
|
||||
#define PLATID_MATCH(mbr) \
|
||||
if (platid->s.mbr != mask->s.mbr && \
|
||||
mask->s.mbr != platid_wild.s.mbr && \
|
||||
!(platid->s.mbr == platid_unknown.s.mbr && unknown_is_match)) { \
|
||||
return (0); \
|
||||
} else if (platid->s.mbr == mask->s.mbr) \
|
||||
match_count++;
|
||||
#define PLATID_MATCH(mbr) \
|
||||
if (platid->s.mbr != mask->s.mbr && \
|
||||
mask->s.mbr != platid_wild.s.mbr && \
|
||||
!(platid->s.mbr == platid_unknown.s.mbr && \
|
||||
unknown_is_match)) { \
|
||||
return (0); \
|
||||
} else if (platid->s.mbr == mask->s.mbr) { \
|
||||
match_count++; \
|
||||
}
|
||||
|
||||
match_count = 1;
|
||||
PLATID_MATCH(cpu_submodel);
|
||||
@ -109,7 +108,7 @@ platid_match_sub(platid_t *platid, platid_mask_t *mask, int unknown_is_match)
|
||||
#undef PLATID_MATCH
|
||||
}
|
||||
|
||||
char*
|
||||
tchar*
|
||||
platid_name(platid_t *platid)
|
||||
{
|
||||
int match_level;
|
||||
@ -127,7 +126,7 @@ platid_name(platid_t *platid)
|
||||
if (0 < match_level)
|
||||
return (match->name);
|
||||
else
|
||||
return ("UNKNOWN");
|
||||
return (TEXT("UNKNOWN"));
|
||||
}
|
||||
|
||||
struct platid_data *
|
147
sys/arch/hpc/hpc/platid.h
Normal file
147
sys/arch/hpc/hpc/platid.h
Normal file
@ -0,0 +1,147 @@
|
||||
/* $NetBSD: platid.h,v 1.1 2001/01/28 02:52:21 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define PLATID_FLAGS_BITS 8
|
||||
#define PLATID_CPU_SUBMODEL_BITS 6
|
||||
#define PLATID_CPU_MODEL_BITS 6
|
||||
#define PLATID_CPU_SERIES_BITS 6
|
||||
#define PLATID_CPU_ARCH_BITS 6
|
||||
|
||||
#define PLATID_SUBMODEL_BITS 8
|
||||
#define PLATID_MODEL_BITS 8
|
||||
#define PLATID_SERIES_BITS 6
|
||||
#define PLATID_VENDOR_BITS 10
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
unsigned long dw0, dw1;
|
||||
} dw;
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
struct platid {
|
||||
unsigned int flags :PLATID_FLAGS_BITS;
|
||||
unsigned int cpu_submodel :PLATID_CPU_SUBMODEL_BITS;
|
||||
unsigned int cpu_model :PLATID_CPU_MODEL_BITS;
|
||||
unsigned int cpu_series :PLATID_CPU_SERIES_BITS;
|
||||
unsigned int cpu_arch :PLATID_CPU_ARCH_BITS;
|
||||
|
||||
unsigned int submodel :PLATID_SUBMODEL_BITS;
|
||||
unsigned int model :PLATID_MODEL_BITS;
|
||||
unsigned int series :PLATID_SERIES_BITS;
|
||||
unsigned int vendor :PLATID_VENDOR_BITS;
|
||||
} s;
|
||||
#else
|
||||
#error BYTE_ORDER != LITTLE_ENDIAN
|
||||
#endif
|
||||
} platid_t;
|
||||
|
||||
typedef platid_t platid_mask_t;
|
||||
|
||||
#ifdef UNICODE
|
||||
typedef unsigned short tchar;
|
||||
#ifndef TEXT
|
||||
#define TEXT(x) L##x
|
||||
#endif
|
||||
#else
|
||||
typedef char tchar;
|
||||
#define TEXT(x) x
|
||||
#endif
|
||||
|
||||
struct platid_name {
|
||||
platid_mask_t *mask;
|
||||
tchar *name;
|
||||
};
|
||||
|
||||
struct platid_data {
|
||||
platid_mask_t *mask;
|
||||
void *data;
|
||||
};
|
||||
|
||||
#define PLATID_FLAGS_SHIFT 0
|
||||
#define PLATID_CPU_SUBMODEL_SHIFT 8
|
||||
#define PLATID_CPU_MODEL_SHIFT 14
|
||||
#define PLATID_CPU_SERIES_SHIFT 20
|
||||
#define PLATID_CPU_ARCH_SHIFT 26
|
||||
|
||||
#define PLATID_SUBMODEL_SHIFT 0
|
||||
#define PLATID_MODEL_SHIFT 8
|
||||
#define PLATID_SERIES_SHIFT 16
|
||||
#define PLATID_VENDOR_SHIFT 22
|
||||
|
||||
#define PLATID_FLAGS_MASK \
|
||||
(((1 << PLATID_FLAGS_BITS) - 1) << PLATID_FLAGS_SHIFT)
|
||||
#define PLATID_CPU_SUBMODEL_MASK \
|
||||
(((1 << PLATID_CPU_SUBMODEL_BITS) - 1) << PLATID_CPU_SUBMODEL_SHIFT)
|
||||
#define PLATID_CPU_MODEL_MASK \
|
||||
(((1 << PLATID_CPU_MODEL_BITS) - 1) << PLATID_CPU_MODEL_SHIFT)
|
||||
#define PLATID_CPU_SERIES_MASK \
|
||||
(((1 << PLATID_CPU_SERIES_BITS) - 1) << PLATID_CPU_SERIES_SHIFT)
|
||||
#define PLATID_CPU_ARCH_MASK \
|
||||
(((1 << PLATID_CPU_ARCH_BITS) - 1) << PLATID_CPU_ARCH_SHIFT)
|
||||
|
||||
#define PLATID_SUBMODEL_MASK \
|
||||
(((1 << PLATID_SUBMODEL_BITS) - 1) << PLATID_SUBMODEL_SHIFT)
|
||||
#define PLATID_MODEL_MASK \
|
||||
(((1 << PLATID_MODEL_BITS) - 1) << PLATID_MODEL_SHIFT)
|
||||
#define PLATID_SERIES_MASK \
|
||||
(((1 << PLATID_SERIES_BITS) - 1) << PLATID_SERIES_SHIFT)
|
||||
#define PLATID_VENDOR_MASK \
|
||||
(((1 << PLATID_VENDOR_BITS) - 1) << PLATID_VENDOR_SHIFT)
|
||||
|
||||
#define PLATID_UNKNOWN 0
|
||||
#define PLATID_WILD PLATID_UNKNOWN
|
||||
#define PLATID_DEREFP(pp) ((platid_t *)(pp))
|
||||
#define PLATID_DEREF(pp) (*PLATID_DEREFP(pp))
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern platid_t platid_unknown;
|
||||
extern platid_t platid_wild;
|
||||
extern platid_t platid;
|
||||
extern struct platid_name platid_name_table[];
|
||||
extern int platid_name_table_size;
|
||||
|
||||
void platid_ntoh(platid_t *);
|
||||
void platid_hton(platid_t *);
|
||||
void platid_dump(char *, void *);
|
||||
int platid_match(platid_t *, platid_mask_t *);
|
||||
int platid_match_sub(platid_t *, platid_mask_t *, int);
|
||||
tchar* platid_name(platid_t *);
|
||||
struct platid_data *platid_search(platid_t *, struct platid_data *);
|
||||
__END_DECLS
|
||||
|
||||
#include <machine/platid_generated.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: platid_copyright.awk,v 1.2 2000/02/06 08:47:06 takemura Exp $
|
||||
# $NetBSD: platid_copyright.awk,v 1.1 2001/01/28 02:52:22 uch Exp $
|
||||
#
|
||||
# Copyright (c) 1999
|
||||
# Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
@ -35,8 +35,7 @@
|
||||
#
|
||||
BEGIN{
|
||||
words = ""
|
||||
printf("/* $Id")
|
||||
printf(": $ */\n\n")
|
||||
printf("/* $NetBSD: platid_copyright.awk,v 1.1 2001/01/28 02:52:22 uch Exp $ */\n\n")
|
||||
}
|
||||
/\/\*/,/\*\//{
|
||||
words=sprintf("%s%s\n", words, $0)
|
40
sys/arch/hpc/hpc/platid_gen/Makefile
Normal file
40
sys/arch/hpc/hpc/platid_gen/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
# $NetBSD: Makefile,v 1.1 2001/01/28 02:52:24 uch Exp $
|
||||
|
||||
S= ../../../..
|
||||
|
||||
GENHDR = $S/arch/${MACHINE}/include/platid_generated.h
|
||||
MASK_H = $S/arch/${MACHINE}/include/platid_mask.h
|
||||
MASK_C = $S/arch/${MACHINE}/${MACHINE}/platid_mask.c
|
||||
NAME_C = $S/arch/${MACHINE}/${MACHINE}/platid_name.c
|
||||
GENERATEDS = ${GENHDR} ${MASK_H} ${MASK_C} ${NAME_C}
|
||||
|
||||
PROG = platid_gen
|
||||
BINDIR = /usr/sbin
|
||||
SRCS = platid_gen.c gram.y scan.l
|
||||
|
||||
YFLAGS =
|
||||
YHEADER = 1
|
||||
CPPFLAGS += -I${.CURDIR} -I.
|
||||
CLEANFILES += gram.h
|
||||
LEX = flex
|
||||
MAN =
|
||||
|
||||
all: ${PROG} ${GENERATEDS}
|
||||
|
||||
DEFFILE = $S/arch/${MACHINE}/conf/platid.def
|
||||
PLATIDGEN = $S/arch/hpc/hpc/platid_gen/${PROG}
|
||||
|
||||
${GENHDR}: ${DEFFILE}
|
||||
awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET}
|
||||
${PLATIDGEN} -header < ${DEFFILE} >> ${GENHDR}
|
||||
${MASK_H}: ${DEFFILE}
|
||||
awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET}
|
||||
${PLATIDGEN} -mask_h < ${DEFFILE} >> ${MASK_H}
|
||||
${MASK_C}: ${DEFFILE}
|
||||
awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET}
|
||||
${PLATIDGEN} -mask_c < ${DEFFILE} >> ${MASK_C}
|
||||
${NAME_C}: ${DEFFILE}
|
||||
awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET}
|
||||
${PLATIDGEN} -name_c < ${DEFFILE} >> ${NAME_C}
|
||||
|
||||
.include <bsd.prog.mk>
|
216
sys/arch/hpc/hpc/platid_gen/gram.y
Normal file
216
sys/arch/hpc/hpc/platid_gen/gram.y
Normal file
@ -0,0 +1,216 @@
|
||||
%{
|
||||
/* $NetBSD: gram.y,v 1.1 2001/01/28 02:52:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "platid_gen.h"
|
||||
|
||||
#define LIST_NEW(l) { \
|
||||
(l) = new_node(LIST, 0, NULL, NULL, NULL); \
|
||||
}
|
||||
#define LIST_ADD(l, i) { \
|
||||
if ((l)->ptr1 == NULL) { \
|
||||
(l)->ptr1 = (i); \
|
||||
(l)->ptr2 = (i); \
|
||||
} else { \
|
||||
((node_t*)(l)->ptr2)->link = (i); \
|
||||
(l)->ptr2 = (i); \
|
||||
} \
|
||||
(i)->link = NULL; \
|
||||
(l)->val++; \
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%union {
|
||||
struct node_s *node;
|
||||
const char *str;
|
||||
int val;
|
||||
}
|
||||
|
||||
%token '{' '}' '=' ':'
|
||||
%token <str>FSYM
|
||||
%token <str>SYM
|
||||
%token <str>MOD
|
||||
%token <str>NAME
|
||||
|
||||
%type <str>sym
|
||||
%type <val>name_prefix
|
||||
%type <node>name_opt
|
||||
%type <node>ent
|
||||
%type <node>sub_list
|
||||
%type <node>sub_item
|
||||
%type <node>list
|
||||
%type <node>item
|
||||
|
||||
%%
|
||||
|
||||
start: list { def_tree = $1; };
|
||||
|
||||
list:
|
||||
list item { LIST_ADD($1, $2); $$ = $1; } |
|
||||
/* empty */ { LIST_NEW($$); };
|
||||
|
||||
item:
|
||||
sym ':' { $$ = new_node(LABEL, 0, $1, NULL, NULL); } |
|
||||
sym '=' sym { $$ = new_node(MODIFIER, 0, $1, $3, NULL); } |
|
||||
ent { $$ = $1; }|
|
||||
'{' sub_list '}' { $$ = $2; };
|
||||
|
||||
sub_list:
|
||||
sub_list sub_item { LIST_ADD($1, $2); $$ = $1; } |
|
||||
/* empty */ { LIST_NEW($$); };
|
||||
|
||||
sub_item:
|
||||
sym '=' sym { $$ = new_node(MODIFIER, 0, $1, $3, NULL); }|
|
||||
ent { $$ = $1; } |
|
||||
'{' sub_list '}' { $$ = $2; };
|
||||
|
||||
ent : sym name_opt {
|
||||
$2->ptr1 = $1;
|
||||
/*
|
||||
if ($2->ptr2 == NULL) {
|
||||
$2->ptr2 = strdup($1);
|
||||
}
|
||||
touppers((char*)$2->ptr1);
|
||||
*/
|
||||
$$ = $2;
|
||||
};
|
||||
|
||||
name_opt:
|
||||
name_prefix NAME { $$ = new_node(ENTRY, $1, NULL, $2, NULL); } |
|
||||
name_prefix { $$ = new_node(ENTRY, $1, NULL, NULL, NULL); };
|
||||
|
||||
name_prefix:
|
||||
name_prefix '-' { $$ = $1 + 1; } |
|
||||
/* empty */ { $$ = 0; }
|
||||
|
||||
sym:
|
||||
FSYM { $$ = $1; } |
|
||||
SYM { $$ = $1; } |
|
||||
MOD { $$ = $1; };
|
||||
|
||||
%%
|
||||
|
||||
char*
|
||||
touppers(s)
|
||||
char *s;
|
||||
{
|
||||
char *p;
|
||||
|
||||
for (p = s; *p != '\0'; p++)
|
||||
*p = toupper(*p);
|
||||
return (s);
|
||||
}
|
||||
|
||||
void*
|
||||
mem_alloc(size)
|
||||
int size;
|
||||
{
|
||||
void *res;
|
||||
|
||||
if ((res = malloc(size)) == NULL) {
|
||||
fprintf(stderr, "memory allocation failed.\n");
|
||||
exit(1);
|
||||
}
|
||||
return (res);
|
||||
}
|
||||
|
||||
node_t*
|
||||
new_node(type, val, ptr1, ptr2, link)
|
||||
int type;
|
||||
int val;
|
||||
const void *ptr1, *ptr2;
|
||||
node_t *link;
|
||||
{
|
||||
node_t *res;
|
||||
|
||||
res = mem_alloc(sizeof(node_t));
|
||||
res->type = type;
|
||||
res->val = val;
|
||||
res->ptr1 = ptr1;
|
||||
res->ptr2 = ptr2;
|
||||
res->link = link;
|
||||
return (res);
|
||||
}
|
||||
|
||||
void
|
||||
dump_node(prefix, n)
|
||||
char *prefix;
|
||||
node_t* n;
|
||||
{
|
||||
char prefix2[1024];
|
||||
node_t *np;
|
||||
|
||||
sprintf(prefix2, "%s ", prefix);
|
||||
|
||||
switch (n->type) {
|
||||
case LABEL:
|
||||
printf("%s%s:\n", prefix, n->ptr1);
|
||||
break;
|
||||
case MODIFIER:
|
||||
printf("%s%s=%s\n", prefix, n->ptr1, n->ptr2);
|
||||
break;
|
||||
case ENTRY:
|
||||
if (n->val == 0)
|
||||
printf("%s%s(%s)\n", prefix, n->ptr1, n->ptr2);
|
||||
else
|
||||
printf("%s%s(-%d, %s)\n",
|
||||
prefix, n->ptr1, n->val, n->ptr2);
|
||||
break;
|
||||
case LIST:
|
||||
printf("%s{\n", prefix);
|
||||
for (np = (node_t*)n->ptr1; np; np = np->link) {
|
||||
dump_node(prefix2, np);
|
||||
}
|
||||
printf("%s}\n", prefix);
|
||||
break;
|
||||
default:
|
||||
printf("%s???\n", prefix);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
yyerror(s)
|
||||
const char *s;
|
||||
{
|
||||
extern int yyline;
|
||||
|
||||
fprintf(stderr, "%d: %s\n", yyline, s);
|
||||
}
|
463
sys/arch/hpc/hpc/platid_gen/platid_gen.c
Normal file
463
sys/arch/hpc/hpc/platid_gen/platid_gen.c
Normal file
@ -0,0 +1,463 @@
|
||||
/* $NetBSD: platid_gen.c,v 1.1 2001/01/28 02:52:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "platid_gen.h"
|
||||
|
||||
/*
|
||||
* constants
|
||||
*/
|
||||
#define SEARCH_IGNORECASE (1<<0)
|
||||
|
||||
#define NMODES 2
|
||||
#define MAXNEST 4
|
||||
#define MAXLEN 1024
|
||||
|
||||
enum { FORM_GENHDR, FORM_MASK_H, FORM_MASK_C, FORM_NAME_C };
|
||||
|
||||
/*
|
||||
* data type definitions
|
||||
*/
|
||||
struct genctx_t {
|
||||
int num;
|
||||
const char *alt;
|
||||
const char *node_name[2];
|
||||
char sym[MAXLEN];
|
||||
char name[MAXLEN];
|
||||
} genctx[NMODES][MAXNEST];
|
||||
|
||||
/*
|
||||
* function prototypes
|
||||
*/
|
||||
void gen_list __P((node_t*));
|
||||
void gen_output __P((void));
|
||||
void gen_header __P((void));
|
||||
void gen_mask_h __P((void));
|
||||
void gen_mask_c __P((void));
|
||||
void gen_name_c __P((void));
|
||||
void gen_comment __P((FILE *fp));
|
||||
void enter __P((void));
|
||||
void leave __P((void));
|
||||
|
||||
/*
|
||||
* global data
|
||||
*/
|
||||
node_t* def_tree;
|
||||
int nest;
|
||||
int mode;
|
||||
FILE *fp_out;
|
||||
int form;
|
||||
int count;
|
||||
|
||||
#define MODE_INVALID -1
|
||||
#define MODE_CPU 0
|
||||
#define MODE_MACHINE 1
|
||||
char* mode_names[] = {
|
||||
"CPU", "MACHINE", NULL
|
||||
};
|
||||
#define PREFIX "PLATID"
|
||||
char* prefix_names[] = {
|
||||
"CPU", "MACH",
|
||||
};
|
||||
char* shift_names[NMODES][MAXNEST] = {
|
||||
{
|
||||
"PLATID_CPU_ARCH_SHIFT",
|
||||
"PLATID_CPU_SERIES_SHIFT",
|
||||
"PLATID_CPU_MODEL_SHIFT",
|
||||
"PLATID_CPU_SUBMODEL_SHIFT",
|
||||
},
|
||||
{
|
||||
"PLATID_VENDOR_SHIFT",
|
||||
"PLATID_SERIES_SHIFT",
|
||||
"PLATID_MODEL_SHIFT",
|
||||
"PLATID_SUBMODEL_SHIFT",
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* program entry
|
||||
*/
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int i;
|
||||
|
||||
form = FORM_GENHDR;
|
||||
fp_out = stdout;
|
||||
count = 0;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-header") == 0) {
|
||||
form = FORM_GENHDR;
|
||||
} else
|
||||
if (strcmp(argv[i], "-mask_h") == 0) {
|
||||
form = FORM_MASK_H;
|
||||
} else
|
||||
if (strcmp(argv[i], "-mask_c") == 0) {
|
||||
form = FORM_MASK_C;
|
||||
} else
|
||||
if (strcmp(argv[i], "-name_c") == 0) {
|
||||
form = FORM_NAME_C;
|
||||
} else {
|
||||
usage:
|
||||
fprintf(stderr, "usage platid_gen <option>\n");
|
||||
fprintf(stderr, " option: -header\n");
|
||||
fprintf(stderr, " -mask_h\n");
|
||||
fprintf(stderr, " -mask_c\n");
|
||||
fprintf(stderr, " -name_c\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (read_def()) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
gen_comment(fp_out);
|
||||
switch (form) {
|
||||
case FORM_GENHDR:
|
||||
break;
|
||||
case FORM_MASK_H:
|
||||
break;
|
||||
case FORM_MASK_C:
|
||||
fprintf(fp_out, "#include <machine/platid.h>\n");
|
||||
fprintf(fp_out, "#include <machine/platid_mask.h>\n");
|
||||
break;
|
||||
case FORM_NAME_C:
|
||||
fprintf(fp_out, "#include <machine/platid.h>\n");
|
||||
fprintf(fp_out, "#include <machine/platid_mask.h>\n");
|
||||
fprintf(fp_out,"struct platid_name platid_name_table[] = {\n");
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
dump_node("", def_tree);
|
||||
#endif
|
||||
|
||||
nest = -1;
|
||||
enter(); /* XXX */
|
||||
mode = MODE_INVALID;
|
||||
genctx[MODE_CPU][nest].alt = NULL;
|
||||
genctx[MODE_MACHINE][nest].alt = NULL;
|
||||
gen_list((node_t*)def_tree->ptr1);
|
||||
|
||||
switch (form) {
|
||||
case FORM_GENHDR:
|
||||
case FORM_MASK_H:
|
||||
case FORM_MASK_C:
|
||||
break;
|
||||
case FORM_NAME_C:
|
||||
fprintf(fp_out, "};\n");
|
||||
fprintf(fp_out, "int platid_name_table_size = %d;\n", count);
|
||||
break;
|
||||
}
|
||||
fclose(fp_out);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int
|
||||
table_getnum(table, s, def, opt)
|
||||
char **table;
|
||||
char *s;
|
||||
int def;
|
||||
int opt;
|
||||
{
|
||||
int num;
|
||||
|
||||
num = 0;
|
||||
while (table[num]) {
|
||||
int diff;
|
||||
if (opt & SEARCH_IGNORECASE) {
|
||||
diff = strcmp(table[num], s);
|
||||
} else {
|
||||
diff = strcasecmp(table[num], s);
|
||||
}
|
||||
if (diff == 0) {
|
||||
return (num);
|
||||
}
|
||||
num++;
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
#define GET_MODE(s) \
|
||||
table_getnum(mode_names, (s), MODE_INVALID, SEARCH_IGNORECASE)
|
||||
#define GET_ALT(s) \
|
||||
table_getnum(mode_names, (s), MODE_INVALID, SEARCH_IGNORECASE)
|
||||
|
||||
void
|
||||
enter()
|
||||
{
|
||||
nest++;
|
||||
if (MAXNEST <= nest) {
|
||||
fprintf(stderr, "too much nest\n");
|
||||
exit(1);
|
||||
}
|
||||
genctx[mode][nest].num = 0;
|
||||
genctx[mode][nest].alt = NULL;
|
||||
genctx[mode][nest].node_name[0] = NULL;
|
||||
genctx[mode][nest].node_name[1] = NULL;
|
||||
if (0 < nest) {
|
||||
genctx[mode][nest].alt = genctx[mode][nest - 1].alt;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
leave()
|
||||
{
|
||||
nest--;
|
||||
if (nest < 0) {
|
||||
fprintf(stderr, "internal error (nest=%d)\n", nest);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gen_comment(fp)
|
||||
FILE *fp;
|
||||
{
|
||||
fprintf(fp, "/*\n");
|
||||
fprintf(fp, " * Do not edit.\n");
|
||||
fprintf(fp, " * This file is automatically generated by platid.awk.\n");
|
||||
fprintf(fp, " */\n");
|
||||
}
|
||||
|
||||
gen_name(buf, ctx, nest, name, punct, ignr)
|
||||
char *buf;
|
||||
struct genctx_t ctx[];
|
||||
int nest;
|
||||
int name;
|
||||
char *punct;
|
||||
int ignr;
|
||||
{
|
||||
int i;
|
||||
buf[0] = '\0';
|
||||
for (i = 0; i <= nest; i++) {
|
||||
if (!(ignr <= i && nest != i)) {
|
||||
if (i != 0) {
|
||||
strcat(buf, punct);
|
||||
}
|
||||
strcat(buf, ctx[i].node_name[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gen_list(np)
|
||||
node_t* np;
|
||||
{
|
||||
int i, t;
|
||||
|
||||
for ( ; np; np = np->link) {
|
||||
switch (np->type) {
|
||||
case LABEL:
|
||||
if ((mode = GET_MODE(np->ptr1)) == MODE_INVALID) {
|
||||
fprintf(stderr, "invalid mode '%s'\n",
|
||||
np->ptr1);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case MODIFIER:
|
||||
t = GET_ALT(np->ptr1);
|
||||
if (t == MODE_INVALID) {
|
||||
fprintf(stderr, "unknown alternater '%s'\n",
|
||||
np->ptr1);
|
||||
exit(1);
|
||||
}
|
||||
if (t == mode) {
|
||||
fprintf(stderr,
|
||||
"invalid alternater '%s' (ignored)\n",
|
||||
np->ptr1);
|
||||
exit(1);
|
||||
}
|
||||
genctx[mode][nest].alt = np->ptr2;
|
||||
break;
|
||||
case ENTRY:
|
||||
if (np->ptr2 == NULL) {
|
||||
char buf[MAXLEN];
|
||||
sprintf(buf, "%s%s",
|
||||
nest == 0 ? "" : " ",
|
||||
np->ptr1);
|
||||
np->ptr2 = strdup(buf);
|
||||
if (nest == 3)
|
||||
np->val = 1;
|
||||
}
|
||||
touppers((char*)np->ptr1);
|
||||
|
||||
genctx[mode][nest].num++;
|
||||
genctx[mode][nest].node_name[0] = np->ptr1;
|
||||
genctx[mode][nest].node_name[1] = np->ptr2;
|
||||
gen_name(genctx[mode][nest].sym, genctx[mode],
|
||||
nest, 0, "_", nest == 3 ? 2 : nest);
|
||||
gen_name(genctx[mode][nest].name, genctx[mode],
|
||||
nest, 1, "", nest - np->val);
|
||||
gen_output();
|
||||
break;
|
||||
case LIST:
|
||||
enter();
|
||||
gen_list((node_t*)np->ptr1);
|
||||
leave();
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "internal error (type=%d)\n", np->type);
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gen_output()
|
||||
{
|
||||
switch (form) {
|
||||
case FORM_GENHDR:
|
||||
gen_header();
|
||||
break;
|
||||
case FORM_MASK_H:
|
||||
gen_mask_h();
|
||||
break;
|
||||
case FORM_MASK_C:
|
||||
gen_mask_c();
|
||||
break;
|
||||
case FORM_NAME_C:
|
||||
gen_name_c();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* platid_generated.h
|
||||
*
|
||||
* #define PLATID_CPU_XXX_NUM 1
|
||||
* #define PLATID_CPU_XXX \
|
||||
* ((PLATID_CPU_XXX_NUM << PLATID_CPU_ARCH_SHIFT))
|
||||
* #define PLATID_CPU_XXX_YYY \
|
||||
* ((PLATID_CPU_XXX_YYY_NUM << PLATID_CPU_SERIES_SHIFT)| \
|
||||
* PLATID_CPU_XXX)
|
||||
*/
|
||||
void
|
||||
gen_header()
|
||||
{
|
||||
char *prefix = prefix_names[mode];
|
||||
char *name = genctx[mode][nest].sym;
|
||||
|
||||
fprintf(fp_out, "#define %s_%s_%s_NUM\t%d\n", PREFIX, prefix, name,
|
||||
genctx[mode][nest].num);
|
||||
fprintf(fp_out, "#define %s_%s_%s\t\\\n", PREFIX, prefix, name);
|
||||
fprintf(fp_out, " ((%s_%s_%s_NUM << %s)", PREFIX, prefix, name,
|
||||
shift_names[mode][nest]);
|
||||
if (0 < nest) {
|
||||
fprintf(fp_out, "| \\\n %s_%s_%s",
|
||||
PREFIX, prefix, genctx[mode][nest - 1].sym);
|
||||
}
|
||||
fprintf(fp_out, ")\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* platid_mask.h:
|
||||
*
|
||||
* extern platid_t platid_mask_CPU_MIPS;
|
||||
* #ifdef PLATID_DEFINE_MASK_NICKNAME
|
||||
* # define GENERIC_MIPS ((int)&platid_mask_CPU_MIPS)
|
||||
* #endif
|
||||
*/
|
||||
void
|
||||
gen_mask_h()
|
||||
{
|
||||
char *name = genctx[mode][nest].sym;
|
||||
|
||||
fprintf(fp_out, "extern platid_t platid_mask_%s_%s;\n",
|
||||
prefix_names[mode], name);
|
||||
fprintf(fp_out, "#ifdef PLATID_DEFINE_MASK_NICKNAME\n");
|
||||
fprintf(fp_out, "# define %s%s ((int)&platid_mask_%s_%s)\n",
|
||||
(mode == MODE_CPU)?"GENERIC_":"",
|
||||
name, prefix_names[mode], name);
|
||||
fprintf(fp_out, "#endif\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* platid_mask.c:
|
||||
*
|
||||
* platid_t platid_mask_CPU_MIPS = {{
|
||||
* PLATID_CPU_MIPS,
|
||||
* PLATID_WILD
|
||||
* }};
|
||||
*/
|
||||
void
|
||||
gen_mask_c()
|
||||
{
|
||||
char *name = genctx[mode][nest].sym;
|
||||
|
||||
fprintf(fp_out, "platid_t platid_mask_%s_%s = {{\n",
|
||||
prefix_names[mode], name);
|
||||
switch (mode) {
|
||||
case MODE_CPU:
|
||||
fprintf(fp_out, "\t%s_CPU_%s,\n", PREFIX, name);
|
||||
if (genctx[mode][nest].alt == NULL)
|
||||
fprintf(fp_out, "\t%s_WILD\n", PREFIX);
|
||||
else
|
||||
fprintf(fp_out, "\t%s_MACH_%s,\n", PREFIX,
|
||||
genctx[mode][nest].alt);
|
||||
break;
|
||||
case MODE_MACHINE:
|
||||
if (genctx[mode][nest].alt == NULL)
|
||||
fprintf(fp_out, "\t%s_WILD,\n", PREFIX);
|
||||
else
|
||||
fprintf(fp_out, "\t%s_CPU_%s,\n", PREFIX,
|
||||
genctx[mode][nest].alt);
|
||||
fprintf(fp_out, "\t%s_MACH_%s\n", PREFIX, name);
|
||||
break;
|
||||
}
|
||||
fprintf(fp_out, "}};\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* platid_name.c:
|
||||
*/
|
||||
void
|
||||
gen_name_c()
|
||||
{
|
||||
fprintf(fp_out, "\t{ &platid_mask_%s_%s,\n",
|
||||
prefix_names[mode], genctx[mode][nest].sym);
|
||||
fprintf(fp_out, "\t TEXT(\"%s\") },\n", genctx[mode][nest].name);
|
||||
count++;
|
||||
}
|
49
sys/arch/hpc/hpc/platid_gen/platid_gen.h
Normal file
49
sys/arch/hpc/hpc/platid_gen/platid_gen.h
Normal file
@ -0,0 +1,49 @@
|
||||
/* $NetBSD: platid_gen.h,v 1.1 2001/01/28 02:52:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
enum { LABEL, MODIFIER, ENTRY, LIST };
|
||||
typedef struct node_s {
|
||||
int type;
|
||||
int val;
|
||||
const void *ptr1, *ptr2;
|
||||
struct node_s *link;
|
||||
} node_t;
|
||||
|
||||
extern node_t* def_tree;
|
||||
|
||||
node_t* new_node __P((int, int, const void*, const void*, node_t*));
|
||||
void* mem_alloc __P((int size));
|
||||
void dump_node __P((char *prefix, node_t* n));
|
||||
char* touppers __P((char*));
|
111
sys/arch/hpc/hpc/platid_gen/scan.l
Normal file
111
sys/arch/hpc/hpc/platid_gen/scan.l
Normal file
@ -0,0 +1,111 @@
|
||||
%{
|
||||
/* $NetBSD: scan.l,v 1.1 2001/01/28 02:52:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <strings.h>
|
||||
#include "gram.h"
|
||||
|
||||
#include "platid_gen.h"
|
||||
|
||||
int yyline;
|
||||
char *getstr __P((char*));
|
||||
void getcomment __P((void));
|
||||
|
||||
#define yywrap() 1
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
\"([^"]|\\\")*\" { yylval.str = getstr(yytext); return NAME; }
|
||||
[a-zA-Z][0-9a-zA-Z]* { yylval.str = strdup(yytext); return FSYM; }
|
||||
[a-zA-Z][_0-9a-zA-Z]* { yylval.str = strdup(yytext); return MOD; }
|
||||
[0-9a-zA-Z]+ { yylval.str = strdup(yytext); return SYM; }
|
||||
\n { yyline++; }
|
||||
"/*" { getcomment(); }
|
||||
[ \t]+ { /* ignored */; }
|
||||
. { return yytext[0]; }
|
||||
|
||||
%%
|
||||
|
||||
char*
|
||||
getstr(char*s)
|
||||
{
|
||||
char *res, *p, *p2;
|
||||
res = strdup(s + 1);
|
||||
for (p = p2 = res; *p != '\"'; p++) {
|
||||
if (*p == '\\') {
|
||||
*p2++ = *++p;
|
||||
} else {
|
||||
*p2++ = *p;
|
||||
}
|
||||
}
|
||||
*p2 = '\0';
|
||||
return (res);
|
||||
}
|
||||
|
||||
void
|
||||
getcomment()
|
||||
{
|
||||
int c;
|
||||
|
||||
for ( ; ; ) {
|
||||
while ( (c = input()) != '*' && c != EOF ) {
|
||||
if (c == '\n') yyline++;
|
||||
}
|
||||
if (c == '\n') yyline++;
|
||||
|
||||
if ( c == '*' ) {
|
||||
while ( (c = input()) == '*' ) {
|
||||
if (c == '\n') yyline++;
|
||||
}
|
||||
if (c == '\n') yyline++;
|
||||
if ( c == '/' )
|
||||
break; /* found the end */
|
||||
}
|
||||
|
||||
if ( c == EOF ) {
|
||||
yyerror( "EOF in comment" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
read_def()
|
||||
{
|
||||
yyline = 1;
|
||||
def_tree = NULL;
|
||||
return yyparse();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: platid_test.c,v 1.2 2000/12/28 07:10:15 sato Exp $ */
|
||||
/* $NetBSD: platid_test.c,v 1.1 2001/01/28 02:52:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
5
sys/arch/hpcmips/conf/Makefile.platid
Normal file
5
sys/arch/hpcmips/conf/Makefile.platid
Normal file
@ -0,0 +1,5 @@
|
||||
# $NetBSD: Makefile.platid,v 1.1 2001/01/28 02:52:25 uch Exp $
|
||||
|
||||
SUBDIR= ../../hpc/hpc/platid_gen
|
||||
|
||||
.include <bsd.subdir.mk>
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.hpcmips,v 1.44 2001/01/21 14:00:32 takemura Exp $
|
||||
# $NetBSD: files.hpcmips,v 1.45 2001/01/28 02:52:26 uch Exp $
|
||||
|
||||
# maxpartitions must be first item in files.${ARCH}.
|
||||
maxpartitions 8
|
||||
@ -47,16 +47,16 @@ file arch/mips/mips/fp.S softfloat
|
||||
file arch/hpcmips/hpcmips/autoconf.c
|
||||
file arch/hpcmips/hpcmips/conf.c
|
||||
file arch/hpcmips/hpcmips/machdep.c
|
||||
file arch/hpcmips/hpcmips/platid.c
|
||||
file arch/hpcmips/hpcmips/platid_mask.c
|
||||
file arch/hpcmips/hpcmips/platid_name.c
|
||||
file arch/hpcmips/hpcmips/mainbus.c
|
||||
file arch/hpcmips/hpcmips/bus_space.c
|
||||
file arch/hpcmips/hpcmips/bus_dma.c
|
||||
file arch/hpcmips/hpcmips/disksubr.c disk
|
||||
file arch/hpcmips/hpcmips/config_hook.c
|
||||
file arch/hpcmips/hpcmips/procfs_machdep.c procfs
|
||||
|
||||
include "arch/hpc/conf/files.hpc"
|
||||
file arch/hpcmips/hpcmips/platid_mask.c
|
||||
file arch/hpcmips/hpcmips/platid_name.c
|
||||
|
||||
# Console autoconfiguration code: selects between a framebuffers
|
||||
file dev/cons.c
|
||||
file arch/hpcmips/dev/bicons.c
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* $NetBSD: platid.def,v 1.23 2000/10/21 07:30:34 takemura Exp $ */
|
||||
/* $NetBSD: platid.def,v 1.1 2001/01/28 02:52:26 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
@ -1,7 +1,7 @@
|
||||
/* $Id: platid_mask.c,v 1.26 2000/12/28 07:10:15 sato Exp $ */
|
||||
/* $NetBSD: platid_mask.c,v 1.27 2001/01/28 02:52:35 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* $Id: platid_name.c,v 1.11 2000/12/28 07:10:15 sato Exp $ */
|
||||
/* $NetBSD: platid_name.c,v 1.12 2001/01/28 02:52:35 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -41,228 +41,228 @@
|
||||
#include <machine/platid_mask.h>
|
||||
struct platid_name platid_name_table[] = {
|
||||
{ &platid_mask_CPU_MIPS,
|
||||
"MIPS" },
|
||||
TEXT("MIPS") },
|
||||
{ &platid_mask_CPU_MIPS_VR,
|
||||
"MIPS VR" },
|
||||
TEXT("MIPS VR") },
|
||||
{ &platid_mask_CPU_MIPS_VR_41XX,
|
||||
"MIPS VR 41XX" },
|
||||
TEXT("MIPS VR 41XX") },
|
||||
{ &platid_mask_CPU_MIPS_VR_4102,
|
||||
"MIPS VR 4102" },
|
||||
TEXT("MIPS VR 4102") },
|
||||
{ &platid_mask_CPU_MIPS_VR_4111,
|
||||
"MIPS VR 4111" },
|
||||
TEXT("MIPS VR 4111") },
|
||||
{ &platid_mask_CPU_MIPS_VR_4121,
|
||||
"MIPS VR 4121" },
|
||||
TEXT("MIPS VR 4121") },
|
||||
{ &platid_mask_CPU_MIPS_TX,
|
||||
"MIPS TX" },
|
||||
TEXT("MIPS TX") },
|
||||
{ &platid_mask_CPU_MIPS_TX_3900,
|
||||
"MIPS TX 3900" },
|
||||
TEXT("MIPS TX 3900") },
|
||||
{ &platid_mask_CPU_MIPS_TX_3911,
|
||||
"MIPS TX 3911" },
|
||||
TEXT("MIPS TX 3911") },
|
||||
{ &platid_mask_CPU_MIPS_TX_3912,
|
||||
"MIPS TX 3912" },
|
||||
TEXT("MIPS TX 3912") },
|
||||
{ &platid_mask_CPU_MIPS_TX_3920,
|
||||
"MIPS TX 3920" },
|
||||
TEXT("MIPS TX 3920") },
|
||||
{ &platid_mask_CPU_MIPS_TX_3922,
|
||||
"MIPS TX 3922" },
|
||||
TEXT("MIPS TX 3922") },
|
||||
{ &platid_mask_MACH_NEC,
|
||||
"NEC" },
|
||||
TEXT("NEC") },
|
||||
{ &platid_mask_MACH_NEC_MCCS,
|
||||
"NEC MC-CS" },
|
||||
TEXT("NEC MC-CS") },
|
||||
{ &platid_mask_MACH_NEC_MCCS_1X,
|
||||
"NEC MC-CS series" },
|
||||
TEXT("NEC MC-CS series") },
|
||||
{ &platid_mask_MACH_NEC_MCCS_11,
|
||||
"NEC MC-CS11" },
|
||||
TEXT("NEC MC-CS11") },
|
||||
{ &platid_mask_MACH_NEC_MCCS_12,
|
||||
"NEC MC-CS12" },
|
||||
TEXT("NEC MC-CS12") },
|
||||
{ &platid_mask_MACH_NEC_MCCS_13,
|
||||
"NEC MC-CS13" },
|
||||
TEXT("NEC MC-CS13") },
|
||||
{ &platid_mask_MACH_NEC_MCR,
|
||||
"NEC MC-R" },
|
||||
TEXT("NEC MC-R") },
|
||||
{ &platid_mask_MACH_NEC_MCR_3XX,
|
||||
"NEC MC-R300 series" },
|
||||
TEXT("NEC MC-R300 series") },
|
||||
{ &platid_mask_MACH_NEC_MCR_300,
|
||||
"NEC MC-R300" },
|
||||
TEXT("NEC MC-R300") },
|
||||
{ &platid_mask_MACH_NEC_MCR_320,
|
||||
"NEC MC-R320" },
|
||||
TEXT("NEC MC-R320") },
|
||||
{ &platid_mask_MACH_NEC_MCR_FORDOCOMO,
|
||||
"NEC MobileGearII for DoCoMo" },
|
||||
TEXT("NEC MobileGearII for DoCoMo") },
|
||||
{ &platid_mask_MACH_NEC_MCR_MPRO700,
|
||||
"NEC MobilePro 700" },
|
||||
TEXT("NEC MobilePro 700") },
|
||||
{ &platid_mask_MACH_NEC_MCR_330,
|
||||
"NEC MC-R330" },
|
||||
TEXT("NEC MC-R330") },
|
||||
{ &platid_mask_MACH_NEC_MCR_5XX,
|
||||
"NEC MC-R500 series" },
|
||||
TEXT("NEC MC-R500 series") },
|
||||
{ &platid_mask_MACH_NEC_MCR_500,
|
||||
"NEC MC-R500" },
|
||||
TEXT("NEC MC-R500") },
|
||||
{ &platid_mask_MACH_NEC_MCR_510,
|
||||
"NEC MC-R510" },
|
||||
TEXT("NEC MC-R510") },
|
||||
{ &platid_mask_MACH_NEC_MCR_520,
|
||||
"NEC MC-R520" },
|
||||
TEXT("NEC MC-R520") },
|
||||
{ &platid_mask_MACH_NEC_MCR_520A,
|
||||
"NEC MobilePro 770" },
|
||||
TEXT("NEC MobilePro 770") },
|
||||
{ &platid_mask_MACH_NEC_MCR_500A,
|
||||
"NEC MobilePro 750c" },
|
||||
TEXT("NEC MobilePro 750c") },
|
||||
{ &platid_mask_MACH_NEC_MCR_530,
|
||||
"NEC MC-R530" },
|
||||
TEXT("NEC MC-R530") },
|
||||
{ &platid_mask_MACH_NEC_MCR_430,
|
||||
"NEC MC-R430" },
|
||||
TEXT("NEC MC-R430") },
|
||||
{ &platid_mask_MACH_NEC_MCR_530A,
|
||||
"NEC MobilePro 780" },
|
||||
TEXT("NEC MobilePro 780") },
|
||||
{ &platid_mask_MACH_NEC_MCR_SIGMARION,
|
||||
"DoCoMo sigmarion" },
|
||||
TEXT("DoCoMo sigmarion") },
|
||||
{ &platid_mask_MACH_NEC_MCR_7XX,
|
||||
"NEC MC-R700 series" },
|
||||
TEXT("NEC MC-R700 series") },
|
||||
{ &platid_mask_MACH_NEC_MCR_700,
|
||||
"NEC MC-R700" },
|
||||
TEXT("NEC MC-R700") },
|
||||
{ &platid_mask_MACH_NEC_MCR_700A,
|
||||
"NEC MobilePro 800" },
|
||||
TEXT("NEC MobilePro 800") },
|
||||
{ &platid_mask_MACH_NEC_MCR_730,
|
||||
"NEC MC-R730" },
|
||||
TEXT("NEC MC-R730") },
|
||||
{ &platid_mask_MACH_NEC_MCR_730A,
|
||||
"NEC MobilePro 880" },
|
||||
TEXT("NEC MobilePro 880") },
|
||||
{ &platid_mask_MACH_EVEREX,
|
||||
"Everex" },
|
||||
TEXT("Everex") },
|
||||
{ &platid_mask_MACH_EVEREX_FREESTYLE,
|
||||
"Everex Freestyle" },
|
||||
TEXT("Everex Freestyle") },
|
||||
{ &platid_mask_MACH_EVEREX_FREESTYLE_AXX,
|
||||
"Everex Freestyle AXX" },
|
||||
TEXT("Everex Freestyle AXX") },
|
||||
{ &platid_mask_MACH_EVEREX_FREESTYLE_A10,
|
||||
"Everex Freestyle A10" },
|
||||
TEXT("Everex Freestyle A10") },
|
||||
{ &platid_mask_MACH_EVEREX_FREESTYLE_A15,
|
||||
"Everex Freestyle A15" },
|
||||
TEXT("Everex Freestyle A15") },
|
||||
{ &platid_mask_MACH_EVEREX_FREESTYLE_A20,
|
||||
"Everex Freestyle A20" },
|
||||
TEXT("Everex Freestyle A20") },
|
||||
{ &platid_mask_MACH_CASIO,
|
||||
"CASIO" },
|
||||
TEXT("CASIO") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE,
|
||||
"CASIO Cassiopeia" },
|
||||
TEXT("CASIO Cassiopeia") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_EXX,
|
||||
"CASIO Cassiopeia EXX" },
|
||||
TEXT("CASIO Cassiopeia EXX") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E10,
|
||||
"CASIO Cassiopeia E10" },
|
||||
TEXT("CASIO Cassiopeia E10") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E11,
|
||||
"CASIO Cassiopeia E11" },
|
||||
TEXT("CASIO Cassiopeia E11") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E15,
|
||||
"CASIO Cassiopeia E15" },
|
||||
TEXT("CASIO Cassiopeia E15") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E55,
|
||||
"CASIO Cassiopeia E-55" },
|
||||
TEXT("CASIO Cassiopeia E-55") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_FORDOCOMO,
|
||||
"CASIO Cassiopeia for DoCoMo" },
|
||||
TEXT("CASIO Cassiopeia for DoCoMo") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E65,
|
||||
"CASIO Cassiopeia E-65" },
|
||||
TEXT("CASIO Cassiopeia E-65") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_EXXX,
|
||||
"CASIO Cassiopeia EXXX" },
|
||||
TEXT("CASIO Cassiopeia EXXX") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E100,
|
||||
"CASIO Cassiopeia E100" },
|
||||
TEXT("CASIO Cassiopeia E100") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E105,
|
||||
"CASIO Cassiopeia E105" },
|
||||
TEXT("CASIO Cassiopeia E105") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E500,
|
||||
"CASIO Cassiopeia E500" },
|
||||
TEXT("CASIO Cassiopeia E500") },
|
||||
{ &platid_mask_MACH_CASIO_CASSIOPEIAE_E507,
|
||||
"CASIO Cassiopeia E507" },
|
||||
TEXT("CASIO Cassiopeia E507") },
|
||||
{ &platid_mask_MACH_SHARP,
|
||||
"Sharp" },
|
||||
TEXT("Sharp") },
|
||||
{ &platid_mask_MACH_SHARP_TRIPAD,
|
||||
"Sharp Tripad" },
|
||||
TEXT("Sharp Tripad") },
|
||||
{ &platid_mask_MACH_SHARP_TRIPAD_PV,
|
||||
"Sharp Tripad PV" },
|
||||
TEXT("Sharp Tripad PV") },
|
||||
{ &platid_mask_MACH_SHARP_TRIPAD_PV6000,
|
||||
"Sharp Tripad PV6000" },
|
||||
TEXT("Sharp Tripad PV6000") },
|
||||
{ &platid_mask_MACH_SHARP_TELIOS,
|
||||
"Sharp Telios" },
|
||||
TEXT("Sharp Telios") },
|
||||
{ &platid_mask_MACH_SHARP_TELIOS_HC,
|
||||
"Sharp Telios HC" },
|
||||
TEXT("Sharp Telios HC") },
|
||||
{ &platid_mask_MACH_SHARP_TELIOS_HCAJ1,
|
||||
"Sharp HC-AJ1/AJ2" },
|
||||
TEXT("Sharp HC-AJ1/AJ2") },
|
||||
{ &platid_mask_MACH_SHARP_TELIOS_HCVJ1C_JP,
|
||||
"Sharp HC-VJ1C (Japanese)" },
|
||||
TEXT("Sharp HC-VJ1C (Japanese)") },
|
||||
{ &platid_mask_MACH_SHARP_MOBILON,
|
||||
"Sharp Mobilon" },
|
||||
TEXT("Sharp Mobilon") },
|
||||
{ &platid_mask_MACH_SHARP_MOBILON_HC,
|
||||
"Sharp Mobilon HC" },
|
||||
TEXT("Sharp Mobilon HC") },
|
||||
{ &platid_mask_MACH_SHARP_MOBILON_HC4100,
|
||||
"Sharp Mobilon HC4100" },
|
||||
TEXT("Sharp Mobilon HC4100") },
|
||||
{ &platid_mask_MACH_SHARP_MOBILON_HC4500,
|
||||
"Sharp Mobilon HC4500" },
|
||||
TEXT("Sharp Mobilon HC4500") },
|
||||
{ &platid_mask_MACH_SHARP_MOBILON_HC1200,
|
||||
"Sharp Mobilon HC1200" },
|
||||
TEXT("Sharp Mobilon HC1200") },
|
||||
{ &platid_mask_MACH_FUJITSU,
|
||||
"Fujitsu" },
|
||||
TEXT("Fujitsu") },
|
||||
{ &platid_mask_MACH_FUJITSU_INTERTOP,
|
||||
"Fujitsu INTERTOP" },
|
||||
TEXT("Fujitsu INTERTOP") },
|
||||
{ &platid_mask_MACH_FUJITSU_INTERTOP_ITXXX,
|
||||
"Fujitsu INTERTOP ITXXX" },
|
||||
TEXT("Fujitsu INTERTOP ITXXX") },
|
||||
{ &platid_mask_MACH_FUJITSU_INTERTOP_IT300,
|
||||
"Fujitsu INTERTOP IT300" },
|
||||
TEXT("Fujitsu INTERTOP IT300") },
|
||||
{ &platid_mask_MACH_FUJITSU_INTERTOP_IT310,
|
||||
"Fujitsu INTERTOP IT310" },
|
||||
TEXT("Fujitsu INTERTOP IT310") },
|
||||
{ &platid_mask_MACH_PHILIPS,
|
||||
"Philips" },
|
||||
TEXT("Philips") },
|
||||
{ &platid_mask_MACH_PHILIPS_NINO,
|
||||
"Philips Nino" },
|
||||
TEXT("Philips Nino") },
|
||||
{ &platid_mask_MACH_PHILIPS_NINO_3XX,
|
||||
"Philips Nino 3XX" },
|
||||
TEXT("Philips Nino 3XX") },
|
||||
{ &platid_mask_MACH_PHILIPS_NINO_312,
|
||||
"Philips Nino 312" },
|
||||
TEXT("Philips Nino 312") },
|
||||
{ &platid_mask_MACH_COMPAQ,
|
||||
"Compaq" },
|
||||
TEXT("Compaq") },
|
||||
{ &platid_mask_MACH_COMPAQ_C,
|
||||
"Compaq C" },
|
||||
TEXT("Compaq C") },
|
||||
{ &platid_mask_MACH_COMPAQ_C_8XX,
|
||||
"Compaq C 8XX" },
|
||||
TEXT("Compaq C 8XX") },
|
||||
{ &platid_mask_MACH_COMPAQ_C_810,
|
||||
"Compaq C 810" },
|
||||
TEXT("Compaq C 810") },
|
||||
{ &platid_mask_MACH_COMPAQ_C_201X,
|
||||
"Compaq C 201X" },
|
||||
TEXT("Compaq C 201X") },
|
||||
{ &platid_mask_MACH_COMPAQ_C_2010,
|
||||
"Compaq C 2010" },
|
||||
TEXT("Compaq C 2010") },
|
||||
{ &platid_mask_MACH_COMPAQ_C_2015,
|
||||
"Compaq C 2015" },
|
||||
TEXT("Compaq C 2015") },
|
||||
{ &platid_mask_MACH_COMPAQ_AERO,
|
||||
"Compaq AERO" },
|
||||
TEXT("Compaq AERO") },
|
||||
{ &platid_mask_MACH_COMPAQ_AERO_15XX,
|
||||
"Compaq AERO 15XX" },
|
||||
TEXT("Compaq AERO 15XX") },
|
||||
{ &platid_mask_MACH_COMPAQ_AERO_1530,
|
||||
"Compaq AERO 1530" },
|
||||
TEXT("Compaq AERO 1530") },
|
||||
{ &platid_mask_MACH_COMPAQ_AERO_21XX,
|
||||
"Compaq AERO 21XX" },
|
||||
TEXT("Compaq AERO 21XX") },
|
||||
{ &platid_mask_MACH_COMPAQ_AERO_2110,
|
||||
"Compaq AERO 2110" },
|
||||
TEXT("Compaq AERO 2110") },
|
||||
{ &platid_mask_MACH_COMPAQ_AERO_2130,
|
||||
"Compaq AERO 2130" },
|
||||
TEXT("Compaq AERO 2130") },
|
||||
{ &platid_mask_MACH_COMPAQ_AERO_2140,
|
||||
"Compaq AERO 2140" },
|
||||
TEXT("Compaq AERO 2140") },
|
||||
{ &platid_mask_MACH_COMPAQ_PRESARIO,
|
||||
"Compaq PRESARIO" },
|
||||
TEXT("Compaq PRESARIO") },
|
||||
{ &platid_mask_MACH_COMPAQ_PRESARIO_21X,
|
||||
"Compaq PRESARIO 21X" },
|
||||
TEXT("Compaq PRESARIO 21X") },
|
||||
{ &platid_mask_MACH_COMPAQ_PRESARIO_213,
|
||||
"Compaq PRESARIO 213" },
|
||||
TEXT("Compaq PRESARIO 213") },
|
||||
{ &platid_mask_MACH_VICTOR,
|
||||
"Victor" },
|
||||
TEXT("Victor") },
|
||||
{ &platid_mask_MACH_VICTOR_INTERLINK,
|
||||
"Victor InterLink" },
|
||||
TEXT("Victor InterLink") },
|
||||
{ &platid_mask_MACH_VICTOR_INTERLINK_MP,
|
||||
"Victor InterLink MP" },
|
||||
TEXT("Victor InterLink MP") },
|
||||
{ &platid_mask_MACH_VICTOR_INTERLINK_MPC101,
|
||||
"Victor InterLink MPC101" },
|
||||
TEXT("Victor InterLink MPC101") },
|
||||
{ &platid_mask_MACH_IBM,
|
||||
"IBM" },
|
||||
TEXT("IBM") },
|
||||
{ &platid_mask_MACH_IBM_WORKPAD,
|
||||
"IBM WorkPad" },
|
||||
TEXT("IBM WorkPad") },
|
||||
{ &platid_mask_MACH_IBM_WORKPAD_Z50,
|
||||
"IBM WorkPad z50" },
|
||||
TEXT("IBM WorkPad z50") },
|
||||
{ &platid_mask_MACH_IBM_WORKPAD_26011AU,
|
||||
"IBM WorkPad z50 2601 1AU" },
|
||||
TEXT("IBM WorkPad z50 2601 1AU") },
|
||||
{ &platid_mask_MACH_VADEM,
|
||||
"VADEM" },
|
||||
TEXT("VADEM") },
|
||||
{ &platid_mask_MACH_VADEM_CLIO,
|
||||
"VADEM CLIO" },
|
||||
TEXT("VADEM CLIO") },
|
||||
{ &platid_mask_MACH_VADEM_CLIO_C,
|
||||
"VADEM CLIO C" },
|
||||
TEXT("VADEM CLIO C") },
|
||||
{ &platid_mask_MACH_VADEM_CLIO_C1000,
|
||||
"VADEM CLIO C-1000" },
|
||||
TEXT("VADEM CLIO C-1000") },
|
||||
{ &platid_mask_MACH_VADEM_CLIO_C1050,
|
||||
"VADEM CLIO C-1050" },
|
||||
TEXT("VADEM CLIO C-1050") },
|
||||
};
|
||||
int platid_name_table_size = 112;
|
||||
|
@ -1,94 +1,3 @@
|
||||
/* $NetBSD: bootinfo.h,v 1.3 2001/01/21 09:11:28 takemura Exp $ */
|
||||
/* $NetBSD: bootinfo.h,v 1.4 2001/01/28 02:52:37 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
struct bootinfo {
|
||||
short length;
|
||||
short reserved;
|
||||
int magic;
|
||||
void *fb_addr;
|
||||
short fb_line_bytes;
|
||||
short fb_width;
|
||||
short fb_height;
|
||||
short fb_type;
|
||||
|
||||
short bi_cnuse;
|
||||
unsigned long platid_cpu;
|
||||
unsigned long platid_machine;
|
||||
|
||||
long timezone;
|
||||
};
|
||||
|
||||
#define BI_CNUSE_BUILTIN (1<<0)
|
||||
#define BI_CNUSE_SERIAL (1<<1)
|
||||
|
||||
extern struct bootinfo *bootinfo;
|
||||
#define BOOTINFO_MAGIC 0x13536135
|
||||
|
||||
#define BIFB_D2_M2L_3 0
|
||||
#define BIFBN_D2_M2L_3 "D2_M2L_3"
|
||||
|
||||
#define BIFB_D2_M2L_3x2 1
|
||||
#define BIFBN_D2_M2L_3x2 "D2_M2L_3x2"
|
||||
|
||||
#define BIFB_D2_M2L_0 2
|
||||
#define BIFBN_D2_M2L_0 "D2_M2L_0"
|
||||
|
||||
#define BIFB_D8_00 3
|
||||
#define BIFBN_D8_00 "D8_00"
|
||||
|
||||
#define BIFB_D8_FF 4
|
||||
#define BIFBN_D8_FF "D8_FF"
|
||||
|
||||
#define BIFB_D16_0000 5
|
||||
#define BIFBN_D16_0000 "D16_0000"
|
||||
|
||||
#define BIFB_D16_FFFF 6
|
||||
#define BIFBN_D16_FFFF "D16_FFFF"
|
||||
|
||||
#define BIFB_D2_M2L_0x2 7
|
||||
#define BIFBN_D2_M2L_0x2 "D2_M2L_0x2"
|
||||
|
||||
#define BIFB_D4_M2L_F 8
|
||||
#define BIFBN_D4_M2L_F "D4_M2L_F"
|
||||
|
||||
#define BIFB_D4_M2L_Fx2 9
|
||||
#define BIFBN_D4_M2L_Fx2 "D4_M2L_Fx2"
|
||||
|
||||
#define BIFB_D4_M2L_0 10
|
||||
#define BIFBN_D4_M2L_0 "D4_M2L_0"
|
||||
|
||||
#define BIFB_D4_M2L_0x2 11
|
||||
#define BIFBN_D4_M2L_0x2 "D4_M2L_0x2"
|
||||
#include <hpc/hpc/bootinfo.h>
|
||||
|
@ -1,309 +1,3 @@
|
||||
/* $NetBSD: config_hook.h,v 1.13 2001/01/26 03:42:30 sato Exp $ */
|
||||
/* $NetBSD: config_hook.h,v 1.14 2001/01/28 02:52:37 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_HOOK_H_
|
||||
#define _CONFIG_HOOK_H_
|
||||
|
||||
enum config_hook_mode {
|
||||
CONFIG_HOOK_SHARE,
|
||||
CONFIG_HOOK_REPLACE,
|
||||
CONFIG_HOOK_EXCLUSIVE,
|
||||
};
|
||||
|
||||
typedef void *config_hook_tag;
|
||||
|
||||
void config_hook_init __P((void));
|
||||
config_hook_tag config_hook __P((int type, long id, enum config_hook_mode mode,
|
||||
int (*func) __P((void*, int, long, void*)),
|
||||
void *ctx));
|
||||
void config_unhook __P((config_hook_tag));
|
||||
int config_hook_call __P((int type, long id, void *msg));
|
||||
|
||||
/*
|
||||
* hook types and IDs
|
||||
*/
|
||||
/* apm releted events */
|
||||
#define CONFIG_HOOK_PMEVENT 0
|
||||
#define CONFIG_HOOK_PMEVENT_STANDBYREQ 0
|
||||
#define CONFIG_HOOK_PMEVENT_SUSPENDREQ 1
|
||||
#define CONFIG_HOOK_PMEVENT_HARDPOWER 2
|
||||
#define CONFIG_HOOK_PMEVENT_BATTERY 3
|
||||
#define CONFIG_HOOK_PMEVENT_AC 4
|
||||
|
||||
|
||||
/* get value */
|
||||
#define CONFIG_HOOK_GET 1
|
||||
/* set value and send event */
|
||||
#define CONFIG_HOOK_SET 2
|
||||
/* external event */
|
||||
#define CONFIG_HOOK_EVENT CONFIG_HOOK_SET
|
||||
|
||||
|
||||
/* CONFIG_HOOK_GET/CONFIG_HOOK_SET/CONFIG_HOOK_EVENT event id's */
|
||||
#define CONFIG_HOOK_POWER_COM0 0
|
||||
#define CONFIG_HOOK_POWER_COM1 1
|
||||
#define CONFIG_HOOK_POWER_COM2 2
|
||||
#define CONFIG_HOOK_POWER_COM3 3
|
||||
#define CONFIG_HOOK_POWER_LCDLIGHT 4
|
||||
#define CONFIG_HOOK_POWER_LCD 5
|
||||
#define CONFIG_HOOK_POWER_SPEAKER 6
|
||||
#define CONFIG_HOOK_BUTTON_POWER 7
|
||||
#define CONFIG_HOOK_BUTTON_OK 8
|
||||
#define CONFIG_HOOK_BUTTON_CANCEL 9
|
||||
#define CONFIG_HOOK_BUTTON_UP 10
|
||||
#define CONFIG_HOOK_BUTTON_DOWN 11
|
||||
#define CONFIG_HOOK_BUTTON_REC 12
|
||||
#define CONFIG_HOOK_BUTTON_COVER 13
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT 14
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST 15
|
||||
#define CONFIG_HOOK_BUTTON_APP0 16
|
||||
#define CONFIG_HOOK_BUTTON_APP1 17
|
||||
#define CONFIG_HOOK_BUTTON_APP2 18
|
||||
#define CONFIG_HOOK_BUTTON_APP3 19
|
||||
#define CONFIG_HOOK_BUTTON_LEFT 20
|
||||
#define CONFIG_HOOK_BUTTON_RIGHT 21
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST_UP 22
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST_DOWN 23
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT_UP 24
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT_DOWN 25
|
||||
#define CONFIG_HOOK_LED 26
|
||||
#define CONFIG_HOOK_LED_MAX 27
|
||||
#define CONFIG_HOOK_CONTRAST 28
|
||||
#define CONFIG_HOOK_CONTRAST_MAX 29
|
||||
#define CONFIG_HOOK_BRIGHTNESS 30
|
||||
#define CONFIG_HOOK_BRIGHTNESS_MAX 31
|
||||
#define CONFIG_HOOK_COM0_CTS 32
|
||||
#define CONFIG_HOOK_COM1_CTS 33
|
||||
#define CONFIG_HOOK_COM2_CTS 34
|
||||
#define CONFIG_HOOK_COM3_CTS 35
|
||||
#define CONFIG_HOOK_COM0_DCD 36
|
||||
#define CONFIG_HOOK_COM1_DCD 37
|
||||
#define CONFIG_HOOK_COM2_DCD 38
|
||||
#define CONFIG_HOOK_COM3_DCD 39
|
||||
#define CONFIG_HOOK_COM0_RTS 40
|
||||
#define CONFIG_HOOK_COM1_RTS 41
|
||||
#define CONFIG_HOOK_COM2_RTS 42
|
||||
#define CONFIG_HOOK_COM3_RTS 43
|
||||
#define CONFIG_HOOK_COM0_DTR 44
|
||||
#define CONFIG_HOOK_COM1_DTR 45
|
||||
#define CONFIG_HOOK_COM2_DTR 46
|
||||
#define CONFIG_HOOK_COM3_DTR 47
|
||||
#define CONFIG_HOOK_BATTERYVAL 48
|
||||
#define CONFIG_HOOK_ACADAPTER 49
|
||||
#define CONFIG_HOOK_CHARGE 50
|
||||
|
||||
#define CONFIG_HOOK_MAX_ID CONFIG_HOOK_CHARGE
|
||||
|
||||
/* old type events */
|
||||
|
||||
#define CONFIG_HOOK_POWERCONTROL 3
|
||||
#define CONFIG_HOOK_POWERCONTROL_COM0 CONFIG_HOOK_POWER_COM0
|
||||
#define CONFIG_HOOK_POWERCONTROL_COM1 CONFIG_HOOK_POWER_COM1
|
||||
#define CONFIG_HOOK_POWERCONTROL_COM2 CONFIG_HOOK_POWER_COM2
|
||||
#define CONFIG_HOOK_POWERCONTROL_COM3 CONFIG_HOOK_POWER_COM3
|
||||
#define CONFIG_HOOK_POWERCONTROL_LCDLIGHT CONFIG_HOOK_POWER_LCDLIGHT
|
||||
#define CONFIG_HOOK_POWERCONTROL_LCD CONFIG_HOOK_POWER_LCD
|
||||
#define CONFIG_HOOK_POWERCONTROL_SPEAKER CONFIG_HOOK_POWER_SPEAKER
|
||||
#define CONFIG_HOOK_POWERCONTROL_LED CONFIG_HOOK_LED
|
||||
|
||||
#define CONFIG_HOOK_BUTTONEVENT 4
|
||||
#define CONFIG_HOOK_BUTTONEVENT_POWER CONFIG_HOOK_BUTTON_POWER
|
||||
#define CONFIG_HOOK_BUTTONEVENT_OK CONFIG_HOOK_BUTTON_OK
|
||||
#define CONFIG_HOOK_BUTTONEVENT_CANCEL CONFIG_HOOK_BUTTON_CANCEL
|
||||
#define CONFIG_HOOK_BUTTONEVENT_UP CONFIG_HOOK_BUTTON_UP
|
||||
#define CONFIG_HOOK_BUTTONEVENT_DOWN CONFIG_HOOK_BUTTON_DOWN
|
||||
#define CONFIG_HOOK_BUTTONEVENT_REC CONFIG_HOOK_BUTTON_REC
|
||||
#define CONFIG_HOOK_BUTTONEVENT_COVER CONFIG_HOOK_BUTTON_COVER
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LIGHT CONFIG_HOOK_BUTTON_LIGHT
|
||||
#define CONFIG_HOOK_BUTTONEVENT_CONTRAST CONFIG_HOOK_BUTTON_CONTRAST
|
||||
#define CONFIG_HOOK_BUTTONEVENT_APP0 CONFIG_HOOK_BUTTON_APP0
|
||||
#define CONFIG_HOOK_BUTTONEVENT_APP1 CONFIG_HOOK_BUTTON_APP1
|
||||
#define CONFIG_HOOK_BUTTONEVENT_APP2 CONFIG_HOOK_BUTTON_APP2
|
||||
#define CONFIG_HOOK_BUTTONEVENT_APP3 CONFIG_HOOK_BUTTON_APP3
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LEFT CONFIG_HOOK_BUTTON_LEFT
|
||||
#define CONFIG_HOOK_BUTTONEVENT_RIGHT CONFIG_HOOK_BUTTON_RIGHT
|
||||
#define CONFIG_HOOK_BUTTONEVENT_CONTRAST_UP CONFIG_HOOK_BUTTON_CONTRAST_UP
|
||||
#define CONFIG_HOOK_BUTTONEVENT_CONTRAST_DOWN CONFIG_HOOK_BUTTON_CONTRAST_DOWN
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LIGHT_UP CONFIG_HOOK_BUTTON_LIGHT_UP
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LIGHT_DOWN CONFIG_HOOK_BUTTON_LIGHT_DOWN
|
||||
|
||||
#define CONFIG_HOOK_NTYPES 5
|
||||
|
||||
/*
|
||||
* nicknames for including from configration file.
|
||||
*/
|
||||
#ifdef CONFIG_HOOK_DEFINE_NICKNAME
|
||||
#define PMEVENT CONFIG_HOOK_PMEVENT
|
||||
#define SET CONFIG_HOOK_SET
|
||||
#define EVENT CONFIG_HOOK_EVENT
|
||||
#define GET CONFIG_HOOK_GET
|
||||
/* old event type */
|
||||
#define POWER CONFIG_HOOK_POWERCONTROL
|
||||
#define BUTTON CONFIG_HOOK_BUTTONEVENT
|
||||
|
||||
#define PWCTL_COM0 CONFIG_HOOK_POWER_COM0
|
||||
#define PWCTL_COM1 CONFIG_HOOK_POWER_COM1
|
||||
#define PWCTL_COM2 CONFIG_HOOK_POWER_COM2
|
||||
#define PWCTL_COM3 CONFIG_HOOK_POWER_COM3
|
||||
#define PWCTL_LCDLIGHT CONFIG_HOOK_POWER_LCDLIGHT
|
||||
#define PWCTL_LCD CONFIG_HOOK_POWER_LCD
|
||||
#define PWCTL_SPEAKER CONFIG_HOOK_POWER_SPEAKER
|
||||
#define PWCTL_LED CONFIG_HOOK_LED
|
||||
#define BTN_POWER CONFIG_HOOK_BUTTON_POWER
|
||||
#define BTN_OK CONFIG_HOOK_BUTTON_OK
|
||||
#define BTN_CANCEL CONFIG_HOOK_BUTTON_CANCEL
|
||||
#define BTN_UP CONFIG_HOOK_BUTTON_UP
|
||||
#define BTN_DOWN CONFIG_HOOK_BUTTON_DOWN
|
||||
#define BTN_REC CONFIG_HOOK_BUTTON_REC
|
||||
#define BTN_COVER CONFIG_HOOK_BUTTON_COVER
|
||||
#define BTN_LIGHT CONFIG_HOOK_BUTTON_LIGHT
|
||||
#define BTN_CONTRAST CONFIG_HOOK_BUTTON_CONTRAST
|
||||
#define BTN_APP0 CONFIG_HOOK_BUTTON_APP0
|
||||
#define BTN_APP1 CONFIG_HOOK_BUTTON_APP1
|
||||
#define BTN_APP2 CONFIG_HOOK_BUTTON_APP2
|
||||
#define BTN_APP3 CONFIG_HOOK_BUTTON_APP3
|
||||
#define BTN_LEFT CONFIG_HOOK_BUTTON_LEFT
|
||||
#define BTN_RIGHT CONFIG_HOOK_BUTTON_RIGHT
|
||||
#define BTN_CONTRAST_UP CONFIG_HOOK_BUTTON_CONTRAST_UP
|
||||
#define BTN_CONTRAST_DN CONFIG_HOOK_BUTTON_CONTRAST_DOWN
|
||||
#define BTN_LIGHT_UP CONFIG_HOOK_BUTTON_LIGHT_UP
|
||||
#define BTN_LIGHT_DN CONFIG_HOOK_BUTTON_LIGHT_DOWN
|
||||
/* PMEVENT */
|
||||
#define PME_STANBY CONFIG_HOOK_PMEVENT_STANDBYREQ
|
||||
#define PME_SUSPEND CONFIG_HOOK_PMEVENT_SUSPENDREQ
|
||||
#define PME_HARDPOWER CONFIG_HOOK_PMEVENT_HARDPOWER
|
||||
#define PME_BATTERY CONFIG_HOOK_PMEVENT_BATTERY
|
||||
#define PME_AC CONFIG_HOOK_PMEVENT_AC
|
||||
/* new one */
|
||||
#define POWER_COM0 CONFIG_HOOK_POWER_COM0
|
||||
#define POWER_COM1 CONFIG_HOOK_POWER_COM1
|
||||
#define POWER_COM2 CONFIG_HOOK_POWER_COM2
|
||||
#define POWER_COM3 CONFIG_HOOK_POWER_COM3
|
||||
#define POWER_LCDLIGHT CONFIG_HOOK_POWER_LCDLIGHT
|
||||
#define POWER_LCD CONFIG_HOOK_POWER_LCD
|
||||
#define POWER_SPEAKER CONFIG_HOOK_POWER_SPEAKER
|
||||
#define BUTTON_POWER CONFIG_HOOK_BUTTON_POWER
|
||||
#define BUTTON_OK CONFIG_HOOK_BUTTON_OK
|
||||
#define BUTTON_CANCEL CONFIG_HOOK_BUTTON_CANCEL
|
||||
#define BUTTON_UP CONFIG_HOOK_BUTTON_UP
|
||||
#define BUTTON_DOWN CONFIG_HOOK_BUTTON_DOWN
|
||||
#define BUTTON_REC CONFIG_HOOK_BUTTON_REC
|
||||
#define BUTTON_COVER CONFIG_HOOK_BUTTON_COVER
|
||||
#define BUTTON_LIGHT CONFIG_HOOK_BUTTON_LIGHT
|
||||
#define BUTTON_CONTRAST CONFIG_HOOK_BUTTON_CONTRAST
|
||||
#define BUTTON_APP0 CONFIG_HOOK_BUTTON_APP0
|
||||
#define BUTTON_APP1 CONFIG_HOOK_BUTTON_APP1
|
||||
#define BUTTON_APP2 CONFIG_HOOK_BUTTON_APP2
|
||||
#define BUTTON_APP3 CONFIG_HOOK_BUTTON_APP3
|
||||
#define BUTTON_LEFT CONFIG_HOOK_BUTTON_LEFT
|
||||
#define BUTTON_RIGHT CONFIG_HOOK_BUTTON_RIGHT
|
||||
#define BUTTON_CONTRAST_UP CONFIG_HOOK_BUTTON_CONTRAST_UP
|
||||
#define BUTTON_CONTRAST_DOWN CONFIG_HOOK_BUTTON_CONTRAST_DOWN
|
||||
#define BUTTON_LIFHT_UP CONFIG_HOOK_BUTTON_LIGHT_UP
|
||||
#define BUTTON_LIFHT_DOWN CONFIG_HOOK_BUTTON_LIGHT_DOWN
|
||||
#define LED CONFIG_HOOK_LED
|
||||
#define LED_MAX CONFIG_HOOK_LED_MAX
|
||||
#define CONTRAST CONFIG_HOOK_CONTRAST
|
||||
#define CONTRAST_MAX CONFIG_HOOK_CONTRAST_MAX
|
||||
#define BRIGHTNESS CONFIG_HOOK_BRIGHTNESS
|
||||
#define BRIGHTNESS_MAX CONFIG_HOOK_BRIGHTNESS_MAX
|
||||
#define COM0_CTS CONFIG_HOOK_COM0_CTS
|
||||
#define COM1_CTS CONFIG_HOOK_COM1_CTS
|
||||
#define COM2_CTS CONFIG_HOOK_COM2_CTS
|
||||
#define COM3_CTS CONFIG_HOOK_COM3_CTS
|
||||
#define COM0_DCD CONFIG_HOOK_COM0_DCD
|
||||
#define COM1_DCD CONFIG_HOOK_COM1_DCD
|
||||
#define COM2_DCD CONFIG_HOOK_COM2_DCD
|
||||
#define COM3_DCD CONFIG_HOOK_COM3_DCD
|
||||
#define COM0_RTS CONFIG_HOOK_COM0_RTS
|
||||
#define COM1_RTS CONFIG_HOOK_COM1_RTS
|
||||
#define COM2_RTS CONFIG_HOOK_COM2_RTS
|
||||
#define COM3_RTS CONFIG_HOOK_COM3_RTS
|
||||
#define COM0_DTR CONFIG_HOOK_COM0_DTR
|
||||
#define COM1_DTR CONFIG_HOOK_COM1_DTR
|
||||
#define COM2_DTR CONFIG_HOOK_COM2_DTR
|
||||
#define COM3_DTR CONFIG_HOOK_COM3_DTR
|
||||
#define BATTERYVAL CONFIG_HOOK_BATTERYVAL
|
||||
#define ACADAPTER CONFIG_HOOK_ACADAPTER
|
||||
#define CHARGE CONFIG_HOOK_CHARGE
|
||||
#endif /* CONFIG_HOOK_DEFINE_NICKNAME */
|
||||
|
||||
#define CONFIG_HOOK_MAXVALUE 1 /* max value, check in this file */
|
||||
#define CONFIG_HOOK_VALUEP(p) ((int)(p)>= 0 && (int)(p)<= CONFIG_HOOK_MAXVALUE)
|
||||
#define CONFIG_HOOK_PTRP(p) (!CONFIG_HOOK_VALUEP(p))
|
||||
|
||||
/*
|
||||
* POWERCONTROL value
|
||||
*/
|
||||
#define PWCTL_ON ((void *)1)
|
||||
#define PWCTL_OFF ((void *)0)
|
||||
|
||||
/* CONFIG_HOOK typical value */
|
||||
#define CONFIG_HOOK_ON 1
|
||||
#define CONFIG_HOOK_OFF 0
|
||||
|
||||
/*
|
||||
* CONFIG_HOOK_LED value
|
||||
*/
|
||||
#define CONFIG_HOOK_LED_ON 0
|
||||
#define CONFIG_HOOK_LED_OFF 1
|
||||
#define CONFIG_HOOK_LED_FLASH 2 /* flash 100msec */
|
||||
#define CONFIG_HOOK_LED_FLASH2 3 /* flash 200msec */
|
||||
#define CONFIG_HOOK_LED_FLASH5 4 /* flash 500msec */
|
||||
#define CONFIG_HOOK_LED_BLINK 5 /* blink 1sec interval */
|
||||
#define CONFIG_HOOK_LED_BLINK2 6 /* blink 2sec interval */
|
||||
|
||||
/*
|
||||
* CONFIG_HOOK_AC event value
|
||||
*/
|
||||
#define CONFIG_HOOK_AC_OFF 0
|
||||
#define CONFIG_HOOK_AC_ON_CHARGE 1
|
||||
#define CONFIG_HOOK_AC_ON_NOCHARGE 2
|
||||
#define CONFIG_HOOK_AC_UNKNOWN 3
|
||||
|
||||
/*
|
||||
* CONFIG_HOOK_BATTERY event value
|
||||
*/
|
||||
#define CONFIG_HOOK_BATT_CRITICAL 0
|
||||
#define CONFIG_HOOK_BATT_20P 1
|
||||
#define CONFIG_HOOK_BATT_LOW 2
|
||||
#define CONFIG_HOOK_BATT_50P 3
|
||||
#define CONFIG_HOOK_BATT_HIGH 4
|
||||
#define CONFIG_HOOK_BATT_80P 5
|
||||
#define CONFIG_HOOK_BATT_100P 6
|
||||
#define CONFIG_HOOK_BATT_UNKNOWN 7
|
||||
#define CONFIG_HOOK_BATT_NO_SYSTEM_BATTERY 8
|
||||
#endif /* _CONFIG_HOOK_H_ */
|
||||
#include <hpc/hpc/config_hook.h>
|
||||
|
@ -1,133 +1,3 @@
|
||||
/* $NetBSD: platid.h,v 1.3 2000/12/28 07:10:15 sato Exp $ */
|
||||
/* $NetBSD: platid.h,v 1.4 2001/01/28 02:52:37 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the PocketBSD project
|
||||
* and its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#define PLATID_FLAGS_BITS 8
|
||||
#define PLATID_CPU_SUBMODEL_BITS 6
|
||||
#define PLATID_CPU_MODEL_BITS 6
|
||||
#define PLATID_CPU_SERIES_BITS 6
|
||||
#define PLATID_CPU_ARCH_BITS 6
|
||||
|
||||
#define PLATID_SUBMODEL_BITS 8
|
||||
#define PLATID_MODEL_BITS 8
|
||||
#define PLATID_SERIES_BITS 6
|
||||
#define PLATID_VENDOR_BITS 10
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
unsigned long dw0, dw1;
|
||||
} dw;
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
struct platid {
|
||||
unsigned int flags :PLATID_FLAGS_BITS;
|
||||
unsigned int cpu_submodel :PLATID_CPU_SUBMODEL_BITS;
|
||||
unsigned int cpu_model :PLATID_CPU_MODEL_BITS;
|
||||
unsigned int cpu_series :PLATID_CPU_SERIES_BITS;
|
||||
unsigned int cpu_arch :PLATID_CPU_ARCH_BITS;
|
||||
|
||||
unsigned int submodel :PLATID_SUBMODEL_BITS;
|
||||
unsigned int model :PLATID_MODEL_BITS;
|
||||
unsigned int series :PLATID_SERIES_BITS;
|
||||
unsigned int vendor :PLATID_VENDOR_BITS;
|
||||
} s;
|
||||
#else
|
||||
#error BYTE_ORDER != LITTLE_ENDIAN
|
||||
#endif
|
||||
} platid_t;
|
||||
|
||||
typedef platid_t platid_mask_t;
|
||||
|
||||
struct platid_name {
|
||||
platid_mask_t *mask;
|
||||
char *name;
|
||||
};
|
||||
|
||||
struct platid_data {
|
||||
platid_mask_t *mask;
|
||||
void *data;
|
||||
};
|
||||
|
||||
#define PLATID_FLAGS_SHIFT 0
|
||||
#define PLATID_CPU_SUBMODEL_SHIFT 8
|
||||
#define PLATID_CPU_MODEL_SHIFT 14
|
||||
#define PLATID_CPU_SERIES_SHIFT 20
|
||||
#define PLATID_CPU_ARCH_SHIFT 26
|
||||
|
||||
#define PLATID_SUBMODEL_SHIFT 0
|
||||
#define PLATID_MODEL_SHIFT 8
|
||||
#define PLATID_SERIES_SHIFT 16
|
||||
#define PLATID_VENDOR_SHIFT 22
|
||||
|
||||
#define PLATID_FLAGS_MASK \
|
||||
(((1 << PLATID_FLAGS_BITS) - 1) << PLATID_FLAGS_SHIFT)
|
||||
#define PLATID_CPU_SUBMODEL_MASK \
|
||||
(((1 << PLATID_CPU_SUBMODEL_BITS) - 1) << PLATID_CPU_SUBMODEL_SHIFT)
|
||||
#define PLATID_CPU_MODEL_MASK \
|
||||
(((1 << PLATID_CPU_MODEL_BITS) - 1) << PLATID_CPU_MODEL_SHIFT)
|
||||
#define PLATID_CPU_SERIES_MASK \
|
||||
(((1 << PLATID_CPU_SERIES_BITS) - 1) << PLATID_CPU_SERIES_SHIFT)
|
||||
#define PLATID_CPU_ARCH_MASK \
|
||||
(((1 << PLATID_CPU_ARCH_BITS) - 1) << PLATID_CPU_ARCH_SHIFT)
|
||||
|
||||
#define PLATID_SUBMODEL_MASK \
|
||||
(((1 << PLATID_SUBMODEL_BITS) - 1) << PLATID_SUBMODEL_SHIFT)
|
||||
#define PLATID_MODEL_MASK \
|
||||
(((1 << PLATID_MODEL_BITS) - 1) << PLATID_MODEL_SHIFT)
|
||||
#define PLATID_SERIES_MASK \
|
||||
(((1 << PLATID_SERIES_BITS) - 1) << PLATID_SERIES_SHIFT)
|
||||
#define PLATID_VENDOR_MASK \
|
||||
(((1 << PLATID_VENDOR_BITS) - 1) << PLATID_VENDOR_SHIFT)
|
||||
|
||||
#define PLATID_UNKNOWN 0
|
||||
#define PLATID_WILD PLATID_UNKNOWN
|
||||
|
||||
extern platid_t platid_unknown;
|
||||
extern platid_t platid_wild;
|
||||
extern platid_t platid;
|
||||
extern struct platid_name platid_name_table[];
|
||||
extern int platid_name_table_size;
|
||||
|
||||
void platid_ntoh(platid_t *pid);
|
||||
void platid_hton(platid_t *pid);
|
||||
void platid_dump(char *name, void* pxx);
|
||||
int platid_match(platid_t *platid, platid_mask_t *mask);
|
||||
int platid_match_sub(platid_t*, platid_mask_t*, int);
|
||||
char* platid_name(platid_t *platid);
|
||||
struct platid_data *platid_search(platid_t *platid, struct platid_data *datap);
|
||||
|
||||
#define PLATID_DEREFP(pp) ((platid_t*)(pp))
|
||||
#define PLATID_DEREF(pp) (*PLATID_DEREFP(pp))
|
||||
|
||||
#include "platid_generated.h"
|
||||
#include <hpc/hpc/platid.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* $Id: platid_generated.h,v 1.24 2000/12/28 07:10:15 sato Exp $ */
|
||||
/* $NetBSD: platid_generated.h,v 1.25 2001/01/28 02:52:38 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* $Id: platid_mask.h,v 1.24 2000/12/28 07:10:15 sato Exp $ */
|
||||
/* $NetBSD: platid_mask.h,v 1.25 2001/01/28 02:52:39 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1 +1 @@
|
||||
#include "../../../include/bootinfo.h"
|
||||
#include "../../../../hpc/hpc/bootinfo.h"
|
||||
|
@ -1 +1 @@
|
||||
#include "../../../include/platid.h"
|
||||
#include "../../../../hpc/hpc/platid.h"
|
||||
|
@ -0,0 +1 @@
|
||||
#include "../../../include/platid_generated.h"
|
@ -1,2 +1,3 @@
|
||||
#include <stand.h>
|
||||
#include "../../hpcmips/platid.c"
|
||||
#include <stand.h>
|
||||
|
||||
#include "../../../hpc/hpc/platid.c"
|
||||
|
Loading…
Reference in New Issue
Block a user