code
stringlengths
4
1.01M
language
stringclasses
2 values
{% extends 'application_portal/base.html' %} {% block title %}Contact Form{% endblock %} {% block content %} <div class="container-fluid"> <div class="row-fluid"> <div class="span3"> <div class="well sidebar-nav"> <li class="nav-header">Important links</li> <ul class="nav nav-list"> <li><a href="/ladm/search/">View Parcel map</a> </li> <li><a href="/ladm/apply/">Submit applications</a> </li> </ul> </div> </div> <div class="span9"> <h2>Contact Form</h2> <p>To send us a message fill out the below form.</p> {% if errors %} <ul> {% for error in errors %} <li>{{ error }}</li> {% endfor %} </ul> {% endif %} <form action="/ladm/contact/" method="post"> {% csrf_token %} <div class="fieldWrapper"> <label>Subject:</label> <input type="text" name="subject"> </div> <br> <div class="fieldWrapper"> <label>Your e-mail (optional):</label> <input type="text" name="email"> </div> <br> <div class="fieldWrapper"> <label>Message: </label> <textarea name="message" class="input-block-level" rows="10" cols="100"></textarea> </div> <br> <input type="submit" name="submit" class="btn btn-primary" value="Submit"> </form> </div> </div> </div> {% endblock %}
Java
/* $Id: capi.c,v 1.1.1.1 2007-05-25 06:50:09 bruce Exp $ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * CAPI encoder/decoder * * Author Fritz Elfert * Copyright by Fritz Elfert <fritz@isdn4linux.de> * * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. * * Thanks to Friedemann Baitinger and IBM Germany * */ #include "act2000.h" #include "capi.h" static actcapi_msgdsc valid_msg[] = { {{ 0x86, 0x02}, "DATA_B3_IND"}, /* DATA_B3_IND/CONF must be first because of speed!!! */ {{ 0x86, 0x01}, "DATA_B3_CONF"}, {{ 0x02, 0x01}, "CONNECT_CONF"}, {{ 0x02, 0x02}, "CONNECT_IND"}, {{ 0x09, 0x01}, "CONNECT_INFO_CONF"}, {{ 0x03, 0x02}, "CONNECT_ACTIVE_IND"}, {{ 0x04, 0x01}, "DISCONNECT_CONF"}, {{ 0x04, 0x02}, "DISCONNECT_IND"}, {{ 0x05, 0x01}, "LISTEN_CONF"}, {{ 0x06, 0x01}, "GET_PARAMS_CONF"}, {{ 0x07, 0x01}, "INFO_CONF"}, {{ 0x07, 0x02}, "INFO_IND"}, {{ 0x08, 0x01}, "DATA_CONF"}, {{ 0x08, 0x02}, "DATA_IND"}, {{ 0x40, 0x01}, "SELECT_B2_PROTOCOL_CONF"}, {{ 0x80, 0x01}, "SELECT_B3_PROTOCOL_CONF"}, {{ 0x81, 0x01}, "LISTEN_B3_CONF"}, {{ 0x82, 0x01}, "CONNECT_B3_CONF"}, {{ 0x82, 0x02}, "CONNECT_B3_IND"}, {{ 0x83, 0x02}, "CONNECT_B3_ACTIVE_IND"}, {{ 0x84, 0x01}, "DISCONNECT_B3_CONF"}, {{ 0x84, 0x02}, "DISCONNECT_B3_IND"}, {{ 0x85, 0x01}, "GET_B3_PARAMS_CONF"}, {{ 0x01, 0x01}, "RESET_B3_CONF"}, {{ 0x01, 0x02}, "RESET_B3_IND"}, /* {{ 0x87, 0x02, "HANDSET_IND"}, not implemented */ {{ 0xff, 0x01}, "MANUFACTURER_CONF"}, {{ 0xff, 0x02}, "MANUFACTURER_IND"}, #ifdef DEBUG_MSG /* Requests */ {{ 0x01, 0x00}, "RESET_B3_REQ"}, {{ 0x02, 0x00}, "CONNECT_REQ"}, {{ 0x04, 0x00}, "DISCONNECT_REQ"}, {{ 0x05, 0x00}, "LISTEN_REQ"}, {{ 0x06, 0x00}, "GET_PARAMS_REQ"}, {{ 0x07, 0x00}, "INFO_REQ"}, {{ 0x08, 0x00}, "DATA_REQ"}, {{ 0x09, 0x00}, "CONNECT_INFO_REQ"}, {{ 0x40, 0x00}, "SELECT_B2_PROTOCOL_REQ"}, {{ 0x80, 0x00}, "SELECT_B3_PROTOCOL_REQ"}, {{ 0x81, 0x00}, "LISTEN_B3_REQ"}, {{ 0x82, 0x00}, "CONNECT_B3_REQ"}, {{ 0x84, 0x00}, "DISCONNECT_B3_REQ"}, {{ 0x85, 0x00}, "GET_B3_PARAMS_REQ"}, {{ 0x86, 0x00}, "DATA_B3_REQ"}, {{ 0xff, 0x00}, "MANUFACTURER_REQ"}, /* Responses */ {{ 0x01, 0x03}, "RESET_B3_RESP"}, {{ 0x02, 0x03}, "CONNECT_RESP"}, {{ 0x03, 0x03}, "CONNECT_ACTIVE_RESP"}, {{ 0x04, 0x03}, "DISCONNECT_RESP"}, {{ 0x07, 0x03}, "INFO_RESP"}, {{ 0x08, 0x03}, "DATA_RESP"}, {{ 0x82, 0x03}, "CONNECT_B3_RESP"}, {{ 0x83, 0x03}, "CONNECT_B3_ACTIVE_RESP"}, {{ 0x84, 0x03}, "DISCONNECT_B3_RESP"}, {{ 0x86, 0x03}, "DATA_B3_RESP"}, {{ 0xff, 0x03}, "MANUFACTURER_RESP"}, #endif {{ 0x00, 0x00}, NULL}, }; #define num_valid_msg (sizeof(valid_msg)/sizeof(actcapi_msgdsc)) #define num_valid_imsg 27 /* MANUFACTURER_IND */ /* * Check for a valid incoming CAPI message. * Return: * 0 = Invalid message * 1 = Valid message, no B-Channel-data * 2 = Valid message, B-Channel-data */ int actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr) { int i; if (hdr->applicationID != 1) return 0; if (hdr->len < 9) return 0; for (i = 0; i < num_valid_imsg; i++) if ((hdr->cmd.cmd == valid_msg[i].cmd.cmd) && (hdr->cmd.subcmd == valid_msg[i].cmd.subcmd)) { return (i?1:2); } return 0; } #define ACTCAPI_MKHDR(l, c, s) { \ skb = alloc_skb(l + 8, GFP_ATOMIC); \ if (skb) { \ m = (actcapi_msg *)skb_put(skb, l + 8); \ m->hdr.len = l + 8; \ m->hdr.applicationID = 1; \ m->hdr.cmd.cmd = c; \ m->hdr.cmd.subcmd = s; \ m->hdr.msgnum = actcapi_nextsmsg(card); \ } else m = NULL;\ } #define ACTCAPI_CHKSKB if (!skb) { \ printk(KERN_WARNING "actcapi: alloc_skb failed\n"); \ return; \ } #define ACTCAPI_QUEUE_TX { \ actcapi_debug_msg(skb, 1); \ skb_queue_tail(&card->sndq, skb); \ act2000_schedule_tx(card); \ } int actcapi_listen_req(act2000_card *card) { __u16 eazmask = 0; int i; actcapi_msg *m; struct sk_buff *skb; for (i = 0; i < ACT2000_BCH; i++) eazmask |= card->bch[i].eazmask; ACTCAPI_MKHDR(9, 0x05, 0x00); if (!skb) { printk(KERN_WARNING "actcapi: alloc_skb failed\n"); return -ENOMEM; } m->msg.listen_req.controller = 0; m->msg.listen_req.infomask = 0x3f; /* All information */ m->msg.listen_req.eazmask = eazmask; m->msg.listen_req.simask = (eazmask)?0x86:0; /* All SI's */ ACTCAPI_QUEUE_TX; return 0; } int actcapi_connect_req(act2000_card *card, act2000_chan *chan, char *phone, char eaz, int si1, int si2) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR((11 + strlen(phone)), 0x02, 0x00); if (!skb) { printk(KERN_WARNING "actcapi: alloc_skb failed\n"); chan->fsm_state = ACT2000_STATE_NULL; return -ENOMEM; } m->msg.connect_req.controller = 0; m->msg.connect_req.bchan = 0x83; m->msg.connect_req.infomask = 0x3f; m->msg.connect_req.si1 = si1; m->msg.connect_req.si2 = si2; m->msg.connect_req.eaz = eaz?eaz:'0'; m->msg.connect_req.addr.len = strlen(phone) + 1; m->msg.connect_req.addr.tnp = 0x81; memcpy(m->msg.connect_req.addr.num, phone, strlen(phone)); chan->callref = m->hdr.msgnum; ACTCAPI_QUEUE_TX; return 0; } static void actcapi_connect_b3_req(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(17, 0x82, 0x00); ACTCAPI_CHKSKB; m->msg.connect_b3_req.plci = chan->plci; memset(&m->msg.connect_b3_req.ncpi, 0, sizeof(m->msg.connect_b3_req.ncpi)); m->msg.connect_b3_req.ncpi.len = 13; m->msg.connect_b3_req.ncpi.modulo = 8; ACTCAPI_QUEUE_TX; } /* * Set net type (1TR6) or (EDSS1) */ int actcapi_manufacturer_req_net(act2000_card *card) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(5, 0xff, 0x00); if (!skb) { printk(KERN_WARNING "actcapi: alloc_skb failed\n"); return -ENOMEM; } m->msg.manufacturer_req_net.manuf_msg = 0x11; m->msg.manufacturer_req_net.controller = 1; m->msg.manufacturer_req_net.nettype = (card->ptype == ISDN_PTYPE_EURO)?1:0; ACTCAPI_QUEUE_TX; printk(KERN_INFO "act2000 %s: D-channel protocol now %s\n", card->interface.id, (card->ptype == ISDN_PTYPE_EURO)?"euro":"1tr6"); card->interface.features &= ~(ISDN_FEATURE_P_UNKNOWN | ISDN_FEATURE_P_EURO | ISDN_FEATURE_P_1TR6); card->interface.features |= ((card->ptype == ISDN_PTYPE_EURO)?ISDN_FEATURE_P_EURO:ISDN_FEATURE_P_1TR6); return 0; } /* * Switch V.42 on or off */ #if 0 int actcapi_manufacturer_req_v42(act2000_card *card, ulong arg) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(8, 0xff, 0x00); if (!skb) { printk(KERN_WARNING "actcapi: alloc_skb failed\n"); return -ENOMEM; } m->msg.manufacturer_req_v42.manuf_msg = 0x10; m->msg.manufacturer_req_v42.controller = 0; m->msg.manufacturer_req_v42.v42control = (arg?1:0); ACTCAPI_QUEUE_TX; return 0; } #endif /* 0 */ /* * Set error-handler */ int actcapi_manufacturer_req_errh(act2000_card *card) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(4, 0xff, 0x00); if (!skb) { printk(KERN_WARNING "actcapi: alloc_skb failed\n"); return -ENOMEM; } m->msg.manufacturer_req_err.manuf_msg = 0x03; m->msg.manufacturer_req_err.controller = 0; ACTCAPI_QUEUE_TX; return 0; } /* * Set MSN-Mapping. */ int actcapi_manufacturer_req_msn(act2000_card *card) { msn_entry *p = card->msn_list; actcapi_msg *m; struct sk_buff *skb; int len; while (p) { int i; len = strlen(p->msn); for (i = 0; i < 2; i++) { ACTCAPI_MKHDR(6 + len, 0xff, 0x00); if (!skb) { printk(KERN_WARNING "actcapi: alloc_skb failed\n"); return -ENOMEM; } m->msg.manufacturer_req_msn.manuf_msg = 0x13 + i; m->msg.manufacturer_req_msn.controller = 0; m->msg.manufacturer_req_msn.msnmap.eaz = p->eaz; m->msg.manufacturer_req_msn.msnmap.len = len; memcpy(m->msg.manufacturer_req_msn.msnmap.msn, p->msn, len); ACTCAPI_QUEUE_TX; } p = p->next; } return 0; } void actcapi_select_b2_protocol_req(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(10, 0x40, 0x00); ACTCAPI_CHKSKB; m->msg.select_b2_protocol_req.plci = chan->plci; memset(&m->msg.select_b2_protocol_req.dlpd, 0, sizeof(m->msg.select_b2_protocol_req.dlpd)); m->msg.select_b2_protocol_req.dlpd.len = 6; switch (chan->l2prot) { case ISDN_PROTO_L2_TRANS: m->msg.select_b2_protocol_req.protocol = 0x03; m->msg.select_b2_protocol_req.dlpd.dlen = 4000; break; case ISDN_PROTO_L2_HDLC: m->msg.select_b2_protocol_req.protocol = 0x02; m->msg.select_b2_protocol_req.dlpd.dlen = 4000; break; case ISDN_PROTO_L2_X75I: case ISDN_PROTO_L2_X75UI: case ISDN_PROTO_L2_X75BUI: m->msg.select_b2_protocol_req.protocol = 0x01; m->msg.select_b2_protocol_req.dlpd.dlen = 4000; m->msg.select_b2_protocol_req.dlpd.laa = 3; m->msg.select_b2_protocol_req.dlpd.lab = 1; m->msg.select_b2_protocol_req.dlpd.win = 7; m->msg.select_b2_protocol_req.dlpd.modulo = 8; break; } ACTCAPI_QUEUE_TX; } static void actcapi_select_b3_protocol_req(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(17, 0x80, 0x00); ACTCAPI_CHKSKB; m->msg.select_b3_protocol_req.plci = chan->plci; memset(&m->msg.select_b3_protocol_req.ncpd, 0, sizeof(m->msg.select_b3_protocol_req.ncpd)); switch (chan->l3prot) { case ISDN_PROTO_L3_TRANS: m->msg.select_b3_protocol_req.protocol = 0x04; m->msg.select_b3_protocol_req.ncpd.len = 13; m->msg.select_b3_protocol_req.ncpd.modulo = 8; break; } ACTCAPI_QUEUE_TX; } static void actcapi_listen_b3_req(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(2, 0x81, 0x00); ACTCAPI_CHKSKB; m->msg.listen_b3_req.plci = chan->plci; ACTCAPI_QUEUE_TX; } static void actcapi_disconnect_req(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(3, 0x04, 0x00); ACTCAPI_CHKSKB; m->msg.disconnect_req.plci = chan->plci; m->msg.disconnect_req.cause = 0; ACTCAPI_QUEUE_TX; } void actcapi_disconnect_b3_req(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(17, 0x84, 0x00); ACTCAPI_CHKSKB; m->msg.disconnect_b3_req.ncci = chan->ncci; memset(&m->msg.disconnect_b3_req.ncpi, 0, sizeof(m->msg.disconnect_b3_req.ncpi)); m->msg.disconnect_b3_req.ncpi.len = 13; m->msg.disconnect_b3_req.ncpi.modulo = 8; chan->fsm_state = ACT2000_STATE_BHWAIT; ACTCAPI_QUEUE_TX; } void actcapi_connect_resp(act2000_card *card, act2000_chan *chan, __u8 cause) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(3, 0x02, 0x03); ACTCAPI_CHKSKB; m->msg.connect_resp.plci = chan->plci; m->msg.connect_resp.rejectcause = cause; if (cause) { chan->fsm_state = ACT2000_STATE_NULL; chan->plci = 0x8000; } else chan->fsm_state = ACT2000_STATE_IWAIT; ACTCAPI_QUEUE_TX; } static void actcapi_connect_active_resp(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(2, 0x03, 0x03); ACTCAPI_CHKSKB; m->msg.connect_resp.plci = chan->plci; if (chan->fsm_state == ACT2000_STATE_IWAIT) chan->fsm_state = ACT2000_STATE_IBWAIT; ACTCAPI_QUEUE_TX; } static void actcapi_connect_b3_resp(act2000_card *card, act2000_chan *chan, __u8 rejectcause) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR((rejectcause?3:17), 0x82, 0x03); ACTCAPI_CHKSKB; m->msg.connect_b3_resp.ncci = chan->ncci; m->msg.connect_b3_resp.rejectcause = rejectcause; if (!rejectcause) { memset(&m->msg.connect_b3_resp.ncpi, 0, sizeof(m->msg.connect_b3_resp.ncpi)); m->msg.connect_b3_resp.ncpi.len = 13; m->msg.connect_b3_resp.ncpi.modulo = 8; chan->fsm_state = ACT2000_STATE_BWAIT; } ACTCAPI_QUEUE_TX; } static void actcapi_connect_b3_active_resp(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(2, 0x83, 0x03); ACTCAPI_CHKSKB; m->msg.connect_b3_active_resp.ncci = chan->ncci; chan->fsm_state = ACT2000_STATE_ACTIVE; ACTCAPI_QUEUE_TX; } static void actcapi_info_resp(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(2, 0x07, 0x03); ACTCAPI_CHKSKB; m->msg.info_resp.plci = chan->plci; ACTCAPI_QUEUE_TX; } static void actcapi_disconnect_b3_resp(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(2, 0x84, 0x03); ACTCAPI_CHKSKB; m->msg.disconnect_b3_resp.ncci = chan->ncci; chan->ncci = 0x8000; chan->queued = 0; ACTCAPI_QUEUE_TX; } static void actcapi_disconnect_resp(act2000_card *card, act2000_chan *chan) { actcapi_msg *m; struct sk_buff *skb; ACTCAPI_MKHDR(2, 0x04, 0x03); ACTCAPI_CHKSKB; m->msg.disconnect_resp.plci = chan->plci; chan->plci = 0x8000; ACTCAPI_QUEUE_TX; } static int new_plci(act2000_card *card, __u16 plci) { int i; for (i = 0; i < ACT2000_BCH; i++) if (card->bch[i].plci == 0x8000) { card->bch[i].plci = plci; return i; } return -1; } static int find_plci(act2000_card *card, __u16 plci) { int i; for (i = 0; i < ACT2000_BCH; i++) if (card->bch[i].plci == plci) return i; return -1; } static int find_ncci(act2000_card *card, __u16 ncci) { int i; for (i = 0; i < ACT2000_BCH; i++) if (card->bch[i].ncci == ncci) return i; return -1; } static int find_dialing(act2000_card *card, __u16 callref) { int i; for (i = 0; i < ACT2000_BCH; i++) if ((card->bch[i].callref == callref) && (card->bch[i].fsm_state == ACT2000_STATE_OCALL)) return i; return -1; } static int actcapi_data_b3_ind(act2000_card *card, struct sk_buff *skb) { __u16 plci; __u16 ncci; __u16 controller; __u8 blocknr; int chan; actcapi_msg *msg = (actcapi_msg *)skb->data; EVAL_NCCI(msg->msg.data_b3_ind.fakencci, plci, controller, ncci); chan = find_ncci(card, ncci); if (chan < 0) return 0; if (card->bch[chan].fsm_state != ACT2000_STATE_ACTIVE) return 0; if (card->bch[chan].plci != plci) return 0; blocknr = msg->msg.data_b3_ind.blocknr; skb_pull(skb, 19); card->interface.rcvcallb_skb(card->myid, chan, skb); if (!(skb = alloc_skb(11, GFP_ATOMIC))) { printk(KERN_WARNING "actcapi: alloc_skb failed\n"); return 1; } msg = (actcapi_msg *)skb_put(skb, 11); msg->hdr.len = 11; msg->hdr.applicationID = 1; msg->hdr.cmd.cmd = 0x86; msg->hdr.cmd.subcmd = 0x03; msg->hdr.msgnum = actcapi_nextsmsg(card); msg->msg.data_b3_resp.ncci = ncci; msg->msg.data_b3_resp.blocknr = blocknr; ACTCAPI_QUEUE_TX; return 1; } /* * Walk over ackq, unlink DATA_B3_REQ from it, if * ncci and blocknr are matching. * Decrement queued-bytes counter. */ static int handle_ack(act2000_card *card, act2000_chan *chan, __u8 blocknr) { unsigned long flags; struct sk_buff *skb; struct sk_buff *tmp; struct actcapi_msg *m; int ret = 0; spin_lock_irqsave(&card->lock, flags); skb = skb_peek(&card->ackq); spin_unlock_irqrestore(&card->lock, flags); if (!skb) { printk(KERN_WARNING "act2000: handle_ack nothing found!\n"); return 0; } tmp = skb; while (1) { m = (actcapi_msg *)tmp->data; if ((((m->msg.data_b3_req.fakencci >> 8) & 0xff) == chan->ncci) && (m->msg.data_b3_req.blocknr == blocknr)) { /* found corresponding DATA_B3_REQ */ skb_unlink(tmp, &card->ackq); chan->queued -= m->msg.data_b3_req.datalen; if (m->msg.data_b3_req.flags) ret = m->msg.data_b3_req.datalen; dev_kfree_skb(tmp); if (chan->queued < 0) chan->queued = 0; return ret; } spin_lock_irqsave(&card->lock, flags); tmp = skb_peek((struct sk_buff_head *)tmp); spin_unlock_irqrestore(&card->lock, flags); if ((tmp == skb) || (tmp == NULL)) { /* reached end of queue */ printk(KERN_WARNING "act2000: handle_ack nothing found!\n"); return 0; } } } void actcapi_dispatch(struct work_struct *work) { struct act2000_card *card = container_of(work, struct act2000_card, rcv_tq); struct sk_buff *skb; actcapi_msg *msg; __u16 ccmd; int chan; int len; act2000_chan *ctmp; isdn_ctrl cmd; char tmp[170]; while ((skb = skb_dequeue(&card->rcvq))) { actcapi_debug_msg(skb, 0); msg = (actcapi_msg *)skb->data; ccmd = ((msg->hdr.cmd.cmd << 8) | msg->hdr.cmd.subcmd); switch (ccmd) { case 0x8602: /* DATA_B3_IND */ if (actcapi_data_b3_ind(card, skb)) return; break; case 0x8601: /* DATA_B3_CONF */ chan = find_ncci(card, msg->msg.data_b3_conf.ncci); if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_ACTIVE)) { if (msg->msg.data_b3_conf.info != 0) printk(KERN_WARNING "act2000: DATA_B3_CONF: %04x\n", msg->msg.data_b3_conf.info); len = handle_ack(card, &card->bch[chan], msg->msg.data_b3_conf.blocknr); if (len) { cmd.driver = card->myid; cmd.command = ISDN_STAT_BSENT; cmd.arg = chan; cmd.parm.length = len; card->interface.statcallb(&cmd); } } break; case 0x0201: /* CONNECT_CONF */ chan = find_dialing(card, msg->hdr.msgnum); if (chan >= 0) { if (msg->msg.connect_conf.info) { card->bch[chan].fsm_state = ACT2000_STATE_NULL; cmd.driver = card->myid; cmd.command = ISDN_STAT_DHUP; cmd.arg = chan; card->interface.statcallb(&cmd); } else { card->bch[chan].fsm_state = ACT2000_STATE_OWAIT; card->bch[chan].plci = msg->msg.connect_conf.plci; } } break; case 0x0202: /* CONNECT_IND */ chan = new_plci(card, msg->msg.connect_ind.plci); if (chan < 0) { ctmp = (act2000_chan *)tmp; ctmp->plci = msg->msg.connect_ind.plci; actcapi_connect_resp(card, ctmp, 0x11); /* All Card-Cannels busy */ } else { card->bch[chan].fsm_state = ACT2000_STATE_ICALL; cmd.driver = card->myid; cmd.command = ISDN_STAT_ICALL; cmd.arg = chan; cmd.parm.setup.si1 = msg->msg.connect_ind.si1; cmd.parm.setup.si2 = msg->msg.connect_ind.si2; if (card->ptype == ISDN_PTYPE_EURO) strcpy(cmd.parm.setup.eazmsn, act2000_find_eaz(card, msg->msg.connect_ind.eaz)); else { cmd.parm.setup.eazmsn[0] = msg->msg.connect_ind.eaz; cmd.parm.setup.eazmsn[1] = 0; } memset(cmd.parm.setup.phone, 0, sizeof(cmd.parm.setup.phone)); memcpy(cmd.parm.setup.phone, msg->msg.connect_ind.addr.num, msg->msg.connect_ind.addr.len - 1); cmd.parm.setup.plan = msg->msg.connect_ind.addr.tnp; cmd.parm.setup.screen = 0; if (card->interface.statcallb(&cmd) == 2) actcapi_connect_resp(card, &card->bch[chan], 0x15); /* Reject Call */ } break; case 0x0302: /* CONNECT_ACTIVE_IND */ chan = find_plci(card, msg->msg.connect_active_ind.plci); if (chan >= 0) switch (card->bch[chan].fsm_state) { case ACT2000_STATE_IWAIT: actcapi_connect_active_resp(card, &card->bch[chan]); break; case ACT2000_STATE_OWAIT: actcapi_connect_active_resp(card, &card->bch[chan]); actcapi_select_b2_protocol_req(card, &card->bch[chan]); break; } break; case 0x8202: /* CONNECT_B3_IND */ chan = find_plci(card, msg->msg.connect_b3_ind.plci); if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_IBWAIT)) { card->bch[chan].ncci = msg->msg.connect_b3_ind.ncci; actcapi_connect_b3_resp(card, &card->bch[chan], 0); } else { ctmp = (act2000_chan *)tmp; ctmp->ncci = msg->msg.connect_b3_ind.ncci; actcapi_connect_b3_resp(card, ctmp, 0x11); /* All Card-Cannels busy */ } break; case 0x8302: /* CONNECT_B3_ACTIVE_IND */ chan = find_ncci(card, msg->msg.connect_b3_active_ind.ncci); if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_BWAIT)) { actcapi_connect_b3_active_resp(card, &card->bch[chan]); cmd.driver = card->myid; cmd.command = ISDN_STAT_BCONN; cmd.arg = chan; card->interface.statcallb(&cmd); } break; case 0x8402: /* DISCONNECT_B3_IND */ chan = find_ncci(card, msg->msg.disconnect_b3_ind.ncci); if (chan >= 0) { ctmp = &card->bch[chan]; actcapi_disconnect_b3_resp(card, ctmp); switch (ctmp->fsm_state) { case ACT2000_STATE_ACTIVE: ctmp->fsm_state = ACT2000_STATE_DHWAIT2; cmd.driver = card->myid; cmd.command = ISDN_STAT_BHUP; cmd.arg = chan; card->interface.statcallb(&cmd); break; case ACT2000_STATE_BHWAIT2: actcapi_disconnect_req(card, ctmp); ctmp->fsm_state = ACT2000_STATE_DHWAIT; cmd.driver = card->myid; cmd.command = ISDN_STAT_BHUP; cmd.arg = chan; card->interface.statcallb(&cmd); break; } } break; case 0x0402: /* DISCONNECT_IND */ chan = find_plci(card, msg->msg.disconnect_ind.plci); if (chan >= 0) { ctmp = &card->bch[chan]; actcapi_disconnect_resp(card, ctmp); ctmp->fsm_state = ACT2000_STATE_NULL; cmd.driver = card->myid; cmd.command = ISDN_STAT_DHUP; cmd.arg = chan; card->interface.statcallb(&cmd); } else { ctmp = (act2000_chan *)tmp; ctmp->plci = msg->msg.disconnect_ind.plci; actcapi_disconnect_resp(card, ctmp); } break; case 0x4001: /* SELECT_B2_PROTOCOL_CONF */ chan = find_plci(card, msg->msg.select_b2_protocol_conf.plci); if (chan >= 0) switch (card->bch[chan].fsm_state) { case ACT2000_STATE_ICALL: case ACT2000_STATE_OWAIT: ctmp = &card->bch[chan]; if (msg->msg.select_b2_protocol_conf.info == 0) actcapi_select_b3_protocol_req(card, ctmp); else { ctmp->fsm_state = ACT2000_STATE_NULL; cmd.driver = card->myid; cmd.command = ISDN_STAT_DHUP; cmd.arg = chan; card->interface.statcallb(&cmd); } break; } break; case 0x8001: /* SELECT_B3_PROTOCOL_CONF */ chan = find_plci(card, msg->msg.select_b3_protocol_conf.plci); if (chan >= 0) switch (card->bch[chan].fsm_state) { case ACT2000_STATE_ICALL: case ACT2000_STATE_OWAIT: ctmp = &card->bch[chan]; if (msg->msg.select_b3_protocol_conf.info == 0) actcapi_listen_b3_req(card, ctmp); else { ctmp->fsm_state = ACT2000_STATE_NULL; cmd.driver = card->myid; cmd.command = ISDN_STAT_DHUP; cmd.arg = chan; card->interface.statcallb(&cmd); } } break; case 0x8101: /* LISTEN_B3_CONF */ chan = find_plci(card, msg->msg.listen_b3_conf.plci); if (chan >= 0) switch (card->bch[chan].fsm_state) { case ACT2000_STATE_ICALL: ctmp = &card->bch[chan]; if (msg->msg.listen_b3_conf.info == 0) actcapi_connect_resp(card, ctmp, 0); else { ctmp->fsm_state = ACT2000_STATE_NULL; cmd.driver = card->myid; cmd.command = ISDN_STAT_DHUP; cmd.arg = chan; card->interface.statcallb(&cmd); } break; case ACT2000_STATE_OWAIT: ctmp = &card->bch[chan]; if (msg->msg.listen_b3_conf.info == 0) { actcapi_connect_b3_req(card, ctmp); ctmp->fsm_state = ACT2000_STATE_OBWAIT; cmd.driver = card->myid; cmd.command = ISDN_STAT_DCONN; cmd.arg = chan; card->interface.statcallb(&cmd); } else { ctmp->fsm_state = ACT2000_STATE_NULL; cmd.driver = card->myid; cmd.command = ISDN_STAT_DHUP; cmd.arg = chan; card->interface.statcallb(&cmd); } break; } break; case 0x8201: /* CONNECT_B3_CONF */ chan = find_plci(card, msg->msg.connect_b3_conf.plci); if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_OBWAIT)) { ctmp = &card->bch[chan]; if (msg->msg.connect_b3_conf.info) { ctmp->fsm_state = ACT2000_STATE_NULL; cmd.driver = card->myid; cmd.command = ISDN_STAT_DHUP; cmd.arg = chan; card->interface.statcallb(&cmd); } else { ctmp->ncci = msg->msg.connect_b3_conf.ncci; ctmp->fsm_state = ACT2000_STATE_BWAIT; } } break; case 0x8401: /* DISCONNECT_B3_CONF */ chan = find_ncci(card, msg->msg.disconnect_b3_conf.ncci); if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_BHWAIT)) card->bch[chan].fsm_state = ACT2000_STATE_BHWAIT2; break; case 0x0702: /* INFO_IND */ chan = find_plci(card, msg->msg.info_ind.plci); if (chan >= 0) /* TODO: Eval Charging info / cause */ actcapi_info_resp(card, &card->bch[chan]); break; case 0x0401: /* LISTEN_CONF */ case 0x0501: /* LISTEN_CONF */ case 0xff01: /* MANUFACTURER_CONF */ break; case 0xff02: /* MANUFACTURER_IND */ if (msg->msg.manuf_msg == 3) { memset(tmp, 0, sizeof(tmp)); strncpy(tmp, &msg->msg.manufacturer_ind_err.errstring, msg->hdr.len - 16); if (msg->msg.manufacturer_ind_err.errcode) printk(KERN_WARNING "act2000: %s\n", tmp); else { printk(KERN_DEBUG "act2000: %s\n", tmp); if ((!strncmp(tmp, "INFO: Trace buffer con", 22)) || (!strncmp(tmp, "INFO: Compile Date/Tim", 22))) { card->flags |= ACT2000_FLAGS_RUNNING; cmd.command = ISDN_STAT_RUN; cmd.driver = card->myid; cmd.arg = 0; actcapi_manufacturer_req_net(card); actcapi_manufacturer_req_msn(card); actcapi_listen_req(card); card->interface.statcallb(&cmd); } } } break; default: printk(KERN_WARNING "act2000: UNHANDLED Message %04x\n", ccmd); break; } dev_kfree_skb(skb); } } #ifdef DEBUG_MSG static void actcapi_debug_caddr(actcapi_addr *addr) { char tmp[30]; printk(KERN_DEBUG " Alen = %d\n", addr->len); if (addr->len > 0) printk(KERN_DEBUG " Atnp = 0x%02x\n", addr->tnp); if (addr->len > 1) { memset(tmp, 0, 30); memcpy(tmp, addr->num, addr->len - 1); printk(KERN_DEBUG " Anum = '%s'\n", tmp); } } static void actcapi_debug_ncpi(actcapi_ncpi *ncpi) { printk(KERN_DEBUG " ncpi.len = %d\n", ncpi->len); if (ncpi->len >= 2) printk(KERN_DEBUG " ncpi.lic = 0x%04x\n", ncpi->lic); if (ncpi->len >= 4) printk(KERN_DEBUG " ncpi.hic = 0x%04x\n", ncpi->hic); if (ncpi->len >= 6) printk(KERN_DEBUG " ncpi.ltc = 0x%04x\n", ncpi->ltc); if (ncpi->len >= 8) printk(KERN_DEBUG " ncpi.htc = 0x%04x\n", ncpi->htc); if (ncpi->len >= 10) printk(KERN_DEBUG " ncpi.loc = 0x%04x\n", ncpi->loc); if (ncpi->len >= 12) printk(KERN_DEBUG " ncpi.hoc = 0x%04x\n", ncpi->hoc); if (ncpi->len >= 13) printk(KERN_DEBUG " ncpi.mod = %d\n", ncpi->modulo); } static void actcapi_debug_dlpd(actcapi_dlpd *dlpd) { printk(KERN_DEBUG " dlpd.len = %d\n", dlpd->len); if (dlpd->len >= 2) printk(KERN_DEBUG " dlpd.dlen = 0x%04x\n", dlpd->dlen); if (dlpd->len >= 3) printk(KERN_DEBUG " dlpd.laa = 0x%02x\n", dlpd->laa); if (dlpd->len >= 4) printk(KERN_DEBUG " dlpd.lab = 0x%02x\n", dlpd->lab); if (dlpd->len >= 5) printk(KERN_DEBUG " dlpd.modulo = %d\n", dlpd->modulo); if (dlpd->len >= 6) printk(KERN_DEBUG " dlpd.win = %d\n", dlpd->win); } #ifdef DEBUG_DUMP_SKB static void dump_skb(struct sk_buff *skb) { char tmp[80]; char *p = skb->data; char *t = tmp; int i; for (i = 0; i < skb->len; i++) { t += sprintf(t, "%02x ", *p++ & 0xff); if ((i & 0x0f) == 8) { printk(KERN_DEBUG "dump: %s\n", tmp); t = tmp; } } if (i & 0x07) printk(KERN_DEBUG "dump: %s\n", tmp); } #endif void actcapi_debug_msg(struct sk_buff *skb, int direction) { actcapi_msg *msg = (actcapi_msg *)skb->data; char *descr; int i; char tmp[170]; #ifndef DEBUG_DATA_MSG if (msg->hdr.cmd.cmd == 0x86) return; #endif descr = "INVALID"; #ifdef DEBUG_DUMP_SKB dump_skb(skb); #endif for (i = 0; i < num_valid_msg; i++) if ((msg->hdr.cmd.cmd == valid_msg[i].cmd.cmd) && (msg->hdr.cmd.subcmd == valid_msg[i].cmd.subcmd)) { descr = valid_msg[i].description; break; } printk(KERN_DEBUG "%s %s msg\n", direction?"Outgoing":"Incoming", descr); printk(KERN_DEBUG " ApplID = %d\n", msg->hdr.applicationID); printk(KERN_DEBUG " Len = %d\n", msg->hdr.len); printk(KERN_DEBUG " MsgNum = 0x%04x\n", msg->hdr.msgnum); printk(KERN_DEBUG " Cmd = 0x%02x\n", msg->hdr.cmd.cmd); printk(KERN_DEBUG " SubCmd = 0x%02x\n", msg->hdr.cmd.subcmd); switch (i) { case 0: /* DATA B3 IND */ printk(KERN_DEBUG " BLOCK = 0x%02x\n", msg->msg.data_b3_ind.blocknr); break; case 2: /* CONNECT CONF */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.connect_conf.plci); printk(KERN_DEBUG " Info = 0x%04x\n", msg->msg.connect_conf.info); break; case 3: /* CONNECT IND */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.connect_ind.plci); printk(KERN_DEBUG " Contr = %d\n", msg->msg.connect_ind.controller); printk(KERN_DEBUG " SI1 = %d\n", msg->msg.connect_ind.si1); printk(KERN_DEBUG " SI2 = %d\n", msg->msg.connect_ind.si2); printk(KERN_DEBUG " EAZ = '%c'\n", msg->msg.connect_ind.eaz); actcapi_debug_caddr(&msg->msg.connect_ind.addr); break; case 5: /* CONNECT ACTIVE IND */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.connect_active_ind.plci); actcapi_debug_caddr(&msg->msg.connect_active_ind.addr); break; case 8: /* LISTEN CONF */ printk(KERN_DEBUG " Contr = %d\n", msg->msg.listen_conf.controller); printk(KERN_DEBUG " Info = 0x%04x\n", msg->msg.listen_conf.info); break; case 11: /* INFO IND */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.info_ind.plci); printk(KERN_DEBUG " Imsk = 0x%04x\n", msg->msg.info_ind.nr.mask); if (msg->hdr.len > 12) { int l = msg->hdr.len - 12; int j; char *p = tmp; for (j = 0; j < l ; j++) p += sprintf(p, "%02x ", msg->msg.info_ind.el.display[j]); printk(KERN_DEBUG " D = '%s'\n", tmp); } break; case 14: /* SELECT B2 PROTOCOL CONF */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.select_b2_protocol_conf.plci); printk(KERN_DEBUG " Info = 0x%04x\n", msg->msg.select_b2_protocol_conf.info); break; case 15: /* SELECT B3 PROTOCOL CONF */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.select_b3_protocol_conf.plci); printk(KERN_DEBUG " Info = 0x%04x\n", msg->msg.select_b3_protocol_conf.info); break; case 16: /* LISTEN B3 CONF */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.listen_b3_conf.plci); printk(KERN_DEBUG " Info = 0x%04x\n", msg->msg.listen_b3_conf.info); break; case 18: /* CONNECT B3 IND */ printk(KERN_DEBUG " NCCI = 0x%04x\n", msg->msg.connect_b3_ind.ncci); printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.connect_b3_ind.plci); actcapi_debug_ncpi(&msg->msg.connect_b3_ind.ncpi); break; case 19: /* CONNECT B3 ACTIVE IND */ printk(KERN_DEBUG " NCCI = 0x%04x\n", msg->msg.connect_b3_active_ind.ncci); actcapi_debug_ncpi(&msg->msg.connect_b3_active_ind.ncpi); break; case 26: /* MANUFACTURER IND */ printk(KERN_DEBUG " Mmsg = 0x%02x\n", msg->msg.manufacturer_ind_err.manuf_msg); switch (msg->msg.manufacturer_ind_err.manuf_msg) { case 3: printk(KERN_DEBUG " Contr = %d\n", msg->msg.manufacturer_ind_err.controller); printk(KERN_DEBUG " Code = 0x%08x\n", msg->msg.manufacturer_ind_err.errcode); memset(tmp, 0, sizeof(tmp)); strncpy(tmp, &msg->msg.manufacturer_ind_err.errstring, msg->hdr.len - 16); printk(KERN_DEBUG " Emsg = '%s'\n", tmp); break; } break; case 30: /* LISTEN REQ */ printk(KERN_DEBUG " Imsk = 0x%08x\n", msg->msg.listen_req.infomask); printk(KERN_DEBUG " Emsk = 0x%04x\n", msg->msg.listen_req.eazmask); printk(KERN_DEBUG " Smsk = 0x%04x\n", msg->msg.listen_req.simask); break; case 35: /* SELECT_B2_PROTOCOL_REQ */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.select_b2_protocol_req.plci); printk(KERN_DEBUG " prot = 0x%02x\n", msg->msg.select_b2_protocol_req.protocol); if (msg->hdr.len >= 11) printk(KERN_DEBUG "No dlpd\n"); else actcapi_debug_dlpd(&msg->msg.select_b2_protocol_req.dlpd); break; case 44: /* CONNECT RESP */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.connect_resp.plci); printk(KERN_DEBUG " CAUSE = 0x%02x\n", msg->msg.connect_resp.rejectcause); break; case 45: /* CONNECT ACTIVE RESP */ printk(KERN_DEBUG " PLCI = 0x%04x\n", msg->msg.connect_active_resp.plci); break; } } #endif
Java
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Object struct Object_t; // System.Runtime.Remoting.Messaging.Header[] struct HeaderU5BU5D_t1378; // System.IAsyncResult struct IAsyncResult_t47; // System.AsyncCallback struct AsyncCallback_t48; #include "mscorlib_System_MulticastDelegate.h" // System.Runtime.Remoting.Messaging.HeaderHandler struct HeaderHandler_t1377 : public MulticastDelegate_t46 { };
Java
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants import UrbanSimLength, UrbanSimLengthConstants from numpy import array class is_near_arterial(Variable): """Boolean indicating if this gridcell is near an arterial, as specified by the arterial threshold (a constant). Distance is assumed to be measured from the "border" of the gridcell.""" distance_to_arterial = "distance_to_arterial" def dependencies(self): return [my_attribute_label(self.distance_to_arterial)] def compute(self, dataset_pool): return get_is_near_arterial(self.get_dataset().get_attribute(self.distance_to_arterial), dataset_pool.get_dataset('urbansim_constant')) def post_check(self, values, dataset_pool): self.do_check("x == False or x == True", values) def get_is_near_arterial(distance, urbansim_constant): length = UrbanSimLength(distance, urbansim_constant["gridcell_width"].units) return length.less_than(urbansim_constant["near_arterial_threshold_unit"]) from opus_core.tests import opus_unittest from opus_core.tests.utils.variable_tester import VariableTester from numpy import array class Tests(opus_unittest.OpusTestCase): def test_my_inputs( self ): # Assumes distance is measured from the gridcell border to the arterial. tester = VariableTester( __file__, package_order=['urbansim'], test_data={ 'gridcell':{ 'grid_id': array([1,2,3,4,5,6]), 'distance_to_arterial': array([0.0, 50.0, 99.0, 100.0, 101.0, 200.0]), }, 'urbansim_constant':{ 'cell_size': array([150]), 'near_arterial_threshold': array([100]), 'units': array(['meters']), } } ) should_be = array( [True, True, True, False, False, False] ) tester.test_is_equal_for_variable_defined_by_this_module(self, should_be) if __name__=='__main__': opus_unittest.main()
Java
<?php /** * Nooku Framework - http://nooku.org/framework * * @copyright Copyright (C) 2007 - 2014 Johan Janssens and Timble CVBA. (http://www.timble.net) * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link https://github.com/nooku/nooku-framework for the canonical source repository */ /** * Object Mixable Interface * * @author Johan Janssens <https://github.com/johanjanssens> * @package Koowa\Library\Object */ interface KObjectMixable { /** * Mixin an object * * When using mixin(), the calling object inherits the methods of the mixed in objects, in a LIFO order. * * @param mixed $identifier An KObjectIdentifier, identifier string or object implementing KObjectMixinInterface * @param array $config An optional associative array of configuration options * @return KObjectMixinInterface * @throws KObjectExceptionInvalidIdentifier If the identifier is not valid * @throws UnexpectedValueException If the mixin does not implement the KObjectMixinInterface */ public function mixin($identifier, $config = array()); /** * Checks if the object or one of it's mixin's inherits from a class. * * @param string|object $class The class to check * @return bool Returns TRUE if the object inherits from the class */ public function inherits($class); /** * Get a list of all the available methods * * This function returns an array of all the methods, both native and mixed in * * @return array An array */ public function getMethods(); }
Java
/* arch/arm/mach-msm/cpufreq.c * * MSM architecture cpufreq driver * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved. * Author: Mike A. Chan <mikechan@google.com> * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/earlysuspend.h> #include <linux/init.h> #include <linux/cpufreq.h> #include <linux/workqueue.h> #include <linux/completion.h> #include <linux/cpu.h> #include <linux/cpumask.h> #include <linux/sched.h> #include <linux/suspend.h> #include <mach/socinfo.h> #include "acpuclock.h" #ifdef CONFIG_SMP struct cpufreq_work_struct { struct work_struct work; struct cpufreq_policy *policy; struct completion complete; int frequency; int status; }; static DEFINE_PER_CPU(struct cpufreq_work_struct, cpufreq_work); static struct workqueue_struct *msm_cpufreq_wq; #endif struct cpufreq_suspend_t { struct mutex suspend_mutex; int device_suspended; }; static DEFINE_PER_CPU(struct cpufreq_suspend_t, cpufreq_suspend); static int override_cpu; static int set_cpu_freq(struct cpufreq_policy *policy, unsigned int new_freq) { int ret = 0; struct cpufreq_freqs freqs; freqs.old = policy->cur; if (override_cpu) { if (policy->cur == policy->max) return 0; else freqs.new = policy->max; } else freqs.new = new_freq; freqs.cpu = policy->cpu; cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); ret = acpuclk_set_rate(policy->cpu, new_freq, SETRATE_CPUFREQ); if (!ret) cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); return ret; } #ifdef CONFIG_SMP static void set_cpu_work(struct work_struct *work) { struct cpufreq_work_struct *cpu_work = container_of(work, struct cpufreq_work_struct, work); cpu_work->status = set_cpu_freq(cpu_work->policy, cpu_work->frequency); complete(&cpu_work->complete); } #endif static int msm_cpufreq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { int ret = -EFAULT; int index; struct cpufreq_frequency_table *table; #ifdef CONFIG_SMP struct cpufreq_work_struct *cpu_work = NULL; cpumask_var_t mask; if (!cpu_active(policy->cpu)) { pr_info("cpufreq: cpu %d is not active.\n", policy->cpu); return -ENODEV; } if (!alloc_cpumask_var(&mask, GFP_KERNEL)) return -ENOMEM; #endif mutex_lock(&per_cpu(cpufreq_suspend, policy->cpu).suspend_mutex); if (per_cpu(cpufreq_suspend, policy->cpu).device_suspended) { pr_debug("cpufreq: cpu%d scheduling frequency change " "in suspend.\n", policy->cpu); ret = -EFAULT; goto done; } table = cpufreq_frequency_get_table(policy->cpu); if (cpufreq_frequency_table_target(policy, table, target_freq, relation, &index)) { pr_err("cpufreq: invalid target_freq: %d\n", target_freq); ret = -EINVAL; goto done; } #ifdef CONFIG_CPU_FREQ_DEBUG pr_debug("CPU[%d] target %d relation %d (%d-%d) selected %d\n", policy->cpu, target_freq, relation, policy->min, policy->max, table[index].frequency); #endif #ifdef CONFIG_SMP cpu_work = &per_cpu(cpufreq_work, policy->cpu); cpu_work->policy = policy; cpu_work->frequency = table[index].frequency; cpu_work->status = -ENODEV; cpumask_clear(mask); cpumask_set_cpu(policy->cpu, mask); if (cpumask_equal(mask, &current->cpus_allowed)) { ret = set_cpu_freq(cpu_work->policy, cpu_work->frequency); goto done; } else { cancel_work_sync(&cpu_work->work); INIT_COMPLETION(cpu_work->complete); queue_work_on(policy->cpu, msm_cpufreq_wq, &cpu_work->work); wait_for_completion(&cpu_work->complete); } ret = cpu_work->status; #else ret = set_cpu_freq(policy, table[index].frequency); #endif done: #ifdef CONFIG_SMP free_cpumask_var(mask); #endif mutex_unlock(&per_cpu(cpufreq_suspend, policy->cpu).suspend_mutex); return ret; } static int msm_cpufreq_verify(struct cpufreq_policy *policy) { cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); return 0; } static int __cpuinit msm_cpufreq_init(struct cpufreq_policy *policy) { int cur_freq; int index; struct cpufreq_frequency_table *table; #ifdef CONFIG_SMP struct cpufreq_work_struct *cpu_work = NULL; #endif if (cpu_is_apq8064()) return -ENODEV; table = cpufreq_frequency_get_table(policy->cpu); if (cpufreq_frequency_table_cpuinfo(policy, table)) { #ifdef CONFIG_MSM_CPU_FREQ_SET_MIN_MAX policy->cpuinfo.min_freq = CONFIG_MSM_CPU_FREQ_MIN; policy->cpuinfo.max_freq = CONFIG_MSM_CPU_FREQ_MAX; #endif } #ifdef CONFIG_MSM_CPU_FREQ_SET_MIN_MAX policy->min = CONFIG_MSM_CPU_FREQ_MIN; policy->max = CONFIG_MSM_CPU_FREQ_MAX; #endif cur_freq = acpuclk_get_rate(policy->cpu); if (cpufreq_frequency_table_target(policy, table, cur_freq, CPUFREQ_RELATION_H, &index) && cpufreq_frequency_table_target(policy, table, cur_freq, CPUFREQ_RELATION_L, &index)) { pr_info("cpufreq: cpu%d at invalid freq: %d\n", policy->cpu, cur_freq); return -EINVAL; } if (cur_freq != table[index].frequency) { int ret = 0; ret = acpuclk_set_rate(policy->cpu, table[index].frequency, SETRATE_CPUFREQ); if (ret) return ret; pr_info("cpufreq: cpu%d init at %d switching to %d\n", policy->cpu, cur_freq, table[index].frequency); cur_freq = table[index].frequency; } policy->cur = cur_freq; policy->cpuinfo.transition_latency = acpuclk_get_switch_time() * NSEC_PER_USEC; #ifdef CONFIG_SMP cpu_work = &per_cpu(cpufreq_work, policy->cpu); INIT_WORK(&cpu_work->work, set_cpu_work); init_completion(&cpu_work->complete); #endif return 0; } static int msm_cpufreq_suspend(struct cpufreq_policy *policy) { int cpu; for_each_possible_cpu(cpu) { per_cpu(cpufreq_suspend, cpu).device_suspended = 1; } return 0; } static int msm_cpufreq_resume(struct cpufreq_policy *policy) { int cpu; for_each_possible_cpu(cpu) { per_cpu(cpufreq_suspend, cpu).device_suspended = 0; } return 0; } static ssize_t store_mfreq(struct sysdev_class *class, struct sysdev_class_attribute *attr, const char *buf, size_t count) { u64 val; if (strict_strtoull(buf, 0, &val) < 0) { pr_err("Invalid parameter to mfreq\n"); return 0; } if (val) override_cpu = 1; else override_cpu = 0; return count; } static SYSDEV_CLASS_ATTR(mfreq, 0200, NULL, store_mfreq); static struct freq_attr *msm_freq_attr[] = { &cpufreq_freq_attr_scaling_available_freqs, NULL, }; static struct cpufreq_driver msm_cpufreq_driver = { /* lps calculations are handled here. */ .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS, .init = msm_cpufreq_init, .verify = msm_cpufreq_verify, .target = msm_cpufreq_target, .suspend = msm_cpufreq_suspend, .resume = msm_cpufreq_resume, .name = "msm", .attr = msm_freq_attr, }; static int __init msm_cpufreq_register(void) { int cpu; int err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, &attr_mfreq.attr); if (err) pr_err("Failed to create sysfs mfreq\n"); for_each_possible_cpu(cpu) { mutex_init(&(per_cpu(cpufreq_suspend, cpu).suspend_mutex)); per_cpu(cpufreq_suspend, cpu).device_suspended = 0; } #ifdef CONFIG_SMP msm_cpufreq_wq = create_workqueue("msm-cpufreq"); #endif return cpufreq_register_driver(&msm_cpufreq_driver); } late_initcall(msm_cpufreq_register);
Java
/** * \file drawMath.c * \brief outputs the math of a model as a dot graph * \author Sarah Keating * * This file is part of libSBML. Please visit http://sbml.org for more * information about SBML, and the latest version of libSBML. */ #include <stdio.h> #include <stdlib.h> #include <sbml/util/util.h> #include <sbml/SBMLTypes.h> #include "FormulaGraphvizFormatter.h" static int noClusters = 0; FILE * fout; /** * @return the given formula AST as a directed graph. The caller * owns the returned string and is responsible for freeing it. */ char * SBML_formulaToDot (const ASTNode_t *tree) { StringBuffer_t *sb = StringBuffer_create(128); char *name; char *s; if (FormulaGraphvizFormatter_isFunction(tree) || ASTNode_isOperator(tree)) { FormulaGraphvizFormatter_visit(NULL, tree, sb); } else { name = FormulaGraphvizFormatter_format(tree); StringBuffer_append(sb, name); } StringBuffer_append(sb, "}\n"); s = StringBuffer_getBuffer(sb); free(sb); return s; } /** * @return true (non-zero) if the given ASTNode is to formatted as a * function. */ int FormulaGraphvizFormatter_isFunction (const ASTNode_t *node) { return ASTNode_isFunction (node) || ASTNode_isLambda (node) || ASTNode_isLogical (node) || ASTNode_isRelational(node); } /** * Formats the given ASTNode as a directed graph token and returns the result as * a string. */ char * FormulaGraphvizFormatter_format (const ASTNode_t *node) { StringBuffer_t *p = StringBuffer_create(128); char *s = NULL; if (ASTNode_isOperator(node)) { s = FormulaGraphvizFormatter_formatOperator(node); } else if (ASTNode_isFunction(node)) { s = FormulaGraphvizFormatter_formatFunction(node); } else if (ASTNode_isInteger(node)) { StringBuffer_appendInt(p, ASTNode_getInteger(node)); s = StringBuffer_toString(p); } else if (ASTNode_isRational(node)) { s = FormulaGraphvizFormatter_formatRational(node); } else if (ASTNode_isReal(node)) { s = FormulaGraphvizFormatter_formatReal(node); } else if ( !ASTNode_isUnknown(node) ) { if (ASTNode_getName(node) == NULL) { StringBuffer_append(p, "unknown"); } else { StringBuffer_append(p, ASTNode_getName(node)); } s = StringBuffer_toString(p); } free(p); return s; } /** * Since graphviz will interpret identical names as referring to * the same node presentation-wise it is better if each function node * has a unique name. * * Returns the name with the name of the first child * prepended * * THIS COULD BE DONE BETTER */ char * FormulaGraphvizFormatter_getUniqueName (const ASTNode_t *node) { StringBuffer_t *p = StringBuffer_create(128); char *s = NULL; if (ASTNode_isOperator(node)) { s = FormulaGraphvizFormatter_OperatorGetUniqueName(node); } else if (ASTNode_isFunction(node)) { s = FormulaGraphvizFormatter_FunctionGetUniqueName(node); } else if (ASTNode_isInteger(node)) { StringBuffer_appendInt(p, ASTNode_getInteger(node)); s = StringBuffer_toString(p); } else if (ASTNode_isRational(node)) { s = FormulaGraphvizFormatter_formatRational(node); } else if (ASTNode_isReal(node)) { s = FormulaGraphvizFormatter_formatReal(node); } else if ( !ASTNode_isUnknown(node) ) { StringBuffer_append(p, ASTNode_getName(node)); s = StringBuffer_toString(p); } free(p); return s; } /** * Formats the given ASTNode as a directed graph function name and returns the * result as a string. */ char * FormulaGraphvizFormatter_formatFunction (const ASTNode_t *node) { char *s; StringBuffer_t *p = StringBuffer_create(128); ASTNodeType_t type = ASTNode_getType(node); switch (type) { case AST_FUNCTION_ARCCOS: s = "acos"; break; case AST_FUNCTION_ARCSIN: s = "asin"; break; case AST_FUNCTION_ARCTAN: s = "atan"; break; case AST_FUNCTION_CEILING: s = "ceil"; break; case AST_FUNCTION_LN: s = "log"; break; case AST_FUNCTION_POWER: s = "pow"; break; default: if (ASTNode_getName(node) == NULL) { StringBuffer_append(p, "unknown"); } else { StringBuffer_append(p, ASTNode_getName(node)); } s = StringBuffer_toString(p); break; } free(p); return s; } /** * Since graphviz will interpret identical names as referring to * the same node presentation-wise it is better if each function node * has a unique name. * * Returns the name of the function with the name of the first child * prepended * * THIS COULD BE DONE BETTER */ char * FormulaGraphvizFormatter_FunctionGetUniqueName (const ASTNode_t *node) { char *s; StringBuffer_t *p = StringBuffer_create(128); ASTNodeType_t type = ASTNode_getType(node); if (ASTNode_getNumChildren(node) != 0) { const char* name = ASTNode_getName(ASTNode_getChild(node,0)); if (name != NULL) StringBuffer_append(p, name); } else { StringBuffer_append(p, "unknown"); } switch (type) { case AST_FUNCTION_ARCCOS: StringBuffer_append(p, "acos"); break; case AST_FUNCTION_ARCSIN: StringBuffer_append(p, "asin"); break; case AST_FUNCTION_ARCTAN: StringBuffer_append(p, "atan"); break; case AST_FUNCTION_CEILING: StringBuffer_append(p, "ceil"); break; case AST_FUNCTION_LN: StringBuffer_append(p, "log"); break; case AST_FUNCTION_POWER: StringBuffer_append(p, "pow"); break; default: if (ASTNode_getName(node) != NULL) { StringBuffer_append(p, ASTNode_getName(node)); } break; } s = StringBuffer_toString(p); free(p); return s; } /** * Formats the given ASTNode as a directed graph operator and returns the result * as a string. */ char * FormulaGraphvizFormatter_formatOperator (const ASTNode_t *node) { char *s; ASTNodeType_t type = ASTNode_getType(node); StringBuffer_t *p = StringBuffer_create(128); switch (type) { case AST_TIMES: s = "times"; break; case AST_DIVIDE: s = "divide"; break; case AST_PLUS: s = "plus"; break; case AST_MINUS: s = "minus"; break; case AST_POWER: s = "power"; break; default: StringBuffer_appendChar(p, ASTNode_getCharacter(node)); s = StringBuffer_toString(p); break; } free(p); return s; } /** * Since graphviz will interpret identical names as referring to * the same node presentation-wise it is better if each function node * has a unique name. * * Returns the name of the operator with the name of the first child * prepended * * THIS COULD BE DONE BETTER */ char * FormulaGraphvizFormatter_OperatorGetUniqueName (const ASTNode_t *node) { char *s; char number[10]; StringBuffer_t *p = StringBuffer_create(128); ASTNodeType_t type = ASTNode_getType(node); if (FormulaGraphvizFormatter_isFunction(ASTNode_getChild(node,0)) || ASTNode_isOperator(ASTNode_getChild(node,0))) { StringBuffer_append(p, "func"); } else { if (ASTNode_isInteger(ASTNode_getChild(node, 0))) { sprintf(number, "%d", (int)ASTNode_getInteger(ASTNode_getChild(node, 0))); StringBuffer_append(p, number); } else if (ASTNode_isReal(ASTNode_getChild(node, 0))) { sprintf(number, "%ld", ASTNode_getNumerator(ASTNode_getChild(node, 0))); StringBuffer_append(p, number); } else { StringBuffer_append(p, ASTNode_getName(ASTNode_getChild(node,0))); } } switch (type) { case AST_TIMES: StringBuffer_append(p, "times"); break; case AST_DIVIDE: StringBuffer_append(p, "divide"); break; case AST_PLUS: StringBuffer_append(p, "plus"); break; case AST_MINUS: StringBuffer_append(p, "minus"); break; case AST_POWER: StringBuffer_append(p, "power"); break; default: StringBuffer_appendChar(p, ASTNode_getCharacter(node)); break; } s = StringBuffer_toString(p); free(p); return s; } /** * Formats the given ASTNode as a rational number and returns the result as * a string. This amounts to: * * "(numerator/denominator)" */ char * FormulaGraphvizFormatter_formatRational (const ASTNode_t *node) { char *s; StringBuffer_t *p = StringBuffer_create(128); StringBuffer_appendChar( p, '('); StringBuffer_appendInt ( p, ASTNode_getNumerator(node) ); StringBuffer_appendChar( p, '/'); StringBuffer_appendInt ( p, ASTNode_getDenominator(node) ); StringBuffer_appendChar( p, ')'); s = StringBuffer_toString(p); free(p); return s; } /** * Formats the given ASTNode as a real number and returns the result as * a string. */ char * FormulaGraphvizFormatter_formatReal (const ASTNode_t *node) { StringBuffer_t *p = StringBuffer_create(128); double value = ASTNode_getReal(node); int sign; char *s; if (util_isNaN(value)) { s = "NaN"; } else if ((sign = util_isInf(value)) != 0) { if (sign == -1) { s = "-INF"; } else { s = "INF"; } } else if (util_isNegZero(value)) { s = "-0"; } else { StringBuffer_appendReal(p, value); s = StringBuffer_toString(p); } free(p); return s; } /** * Visits the given ASTNode node. This function is really just a * dispatcher to either FormulaGraphvizFormatter_visitFunction() or * FormulaGraphvizFormatter_visitOther(). */ void FormulaGraphvizFormatter_visit (const ASTNode_t *parent, const ASTNode_t *node, StringBuffer_t *sb ) { if (ASTNode_isLog10(node)) { FormulaGraphvizFormatter_visitLog10(parent, node, sb); } else if (ASTNode_isSqrt(node)) { FormulaGraphvizFormatter_visitSqrt(parent, node, sb); } else if (FormulaGraphvizFormatter_isFunction(node)) { FormulaGraphvizFormatter_visitFunction(parent, node, sb); } else if (ASTNode_isUMinus(node)) { FormulaGraphvizFormatter_visitUMinus(parent, node, sb); } else { FormulaGraphvizFormatter_visitOther(parent, node, sb); } } /** * Visits the given ASTNode as a function. For this node only the * traversal is preorder. * Writes the function as a directed graph and appends the result * to the StringBuffer. */ void FormulaGraphvizFormatter_visitFunction (const ASTNode_t *parent, const ASTNode_t *node, StringBuffer_t *sb ) { unsigned int numChildren = ASTNode_getNumChildren(node); unsigned int n; char *name; char *uniqueName; uniqueName = FormulaGraphvizFormatter_getUniqueName(node); name = FormulaGraphvizFormatter_format(node); StringBuffer_append(sb, uniqueName); StringBuffer_append(sb, " [shape=box, label="); StringBuffer_append(sb, name); StringBuffer_append(sb, "];\n"); if (parent != NULL) { name = FormulaGraphvizFormatter_getUniqueName(node); uniqueName = FormulaGraphvizFormatter_getUniqueName(parent); if(strcmp(name, uniqueName)) { StringBuffer_append(sb, uniqueName); StringBuffer_append(sb, " -> "); StringBuffer_append(sb, name); StringBuffer_append(sb, ";\n"); } } if (numChildren > 0) { FormulaGraphvizFormatter_visit( node, ASTNode_getChild(node, 0), sb ); } for (n = 1; n < numChildren; n++) { FormulaGraphvizFormatter_visit( node, ASTNode_getChild(node, n), sb ); } } /** * Visits the given ASTNode as the function "log(10, x)" and in doing so, * formats it as "log10(x)" (where x is any subexpression). * Writes the function as a directed graph and appends the result * to the StringBuffer. * * A seperate function may not be strictly speaking necessary for graphs */ void FormulaGraphvizFormatter_visitLog10 (const ASTNode_t *parent, const ASTNode_t *node, StringBuffer_t *sb ) { char *uniqueName = FormulaGraphvizFormatter_getUniqueName(node); char *name = FormulaGraphvizFormatter_format(node); StringBuffer_append(sb, uniqueName); StringBuffer_append(sb, " [shape=box, label="); StringBuffer_append(sb, name); StringBuffer_append(sb, "];\n"); FormulaGraphvizFormatter_visit(node, ASTNode_getChild(node, 1), sb); } /** * Visits the given ASTNode as the function "root(2, x)" and in doing so, * formats it as "sqrt(x)" (where x is any subexpression). * Writes the function as a directed graph and appends the result * to the StringBuffer. * * A seperate function may not be strictly speaking necessary for graphs */ void FormulaGraphvizFormatter_visitSqrt (const ASTNode_t *parent, const ASTNode_t *node, StringBuffer_t *sb ) { char *uniqueName = FormulaGraphvizFormatter_getUniqueName(node); char *name = FormulaGraphvizFormatter_format(node); StringBuffer_append(sb, uniqueName); StringBuffer_append(sb, " [shape=box, label="); StringBuffer_append(sb, name); StringBuffer_append(sb, "];\n"); FormulaGraphvizFormatter_visit(node, ASTNode_getChild(node, 1), sb); } /** * Visits the given ASTNode as a unary minus. For this node only the * traversal is preorder. * Writes the function as a directed graph and appends the result * to the StringBuffer. */ void FormulaGraphvizFormatter_visitUMinus (const ASTNode_t *parent, const ASTNode_t *node, StringBuffer_t *sb ) { char *uniqueName = FormulaGraphvizFormatter_getUniqueName(node); char *name = FormulaGraphvizFormatter_format(node); StringBuffer_append(sb, uniqueName); StringBuffer_append(sb, " [shape=box, label="); StringBuffer_append(sb, name); StringBuffer_append(sb, "];\n"); if (parent != NULL) { uniqueName = FormulaGraphvizFormatter_getUniqueName(parent); name = FormulaGraphvizFormatter_getUniqueName(node); if(strcmp(name, uniqueName)) { StringBuffer_append(sb, uniqueName); StringBuffer_append(sb, " -> "); StringBuffer_append(sb, name); StringBuffer_append(sb, ";\n"); } } FormulaGraphvizFormatter_visit ( node, ASTNode_getLeftChild(node), sb ); } /** * Visits the given ASTNode and continues the inorder traversal. * Writes the function as a directed graph and appends the result * to the StringBuffer. */ void FormulaGraphvizFormatter_visitOther (const ASTNode_t *parent, const ASTNode_t *node, StringBuffer_t *sb ) { unsigned int numChildren = ASTNode_getNumChildren(node); char *name; char *uniqueName; if (numChildren > 0) { uniqueName = FormulaGraphvizFormatter_getUniqueName(node); name = FormulaGraphvizFormatter_format(node); StringBuffer_append(sb, uniqueName); StringBuffer_append(sb, " [shape=box, label="); StringBuffer_append(sb, name); StringBuffer_append(sb, "];\n"); FormulaGraphvizFormatter_visit( node, ASTNode_getLeftChild(node), sb ); } if (parent != NULL) { name = FormulaGraphvizFormatter_getUniqueName(node); uniqueName = FormulaGraphvizFormatter_getUniqueName(parent); if(strcmp(name, uniqueName)) { StringBuffer_append(sb, uniqueName); StringBuffer_append(sb, " -> "); StringBuffer_append(sb, name); StringBuffer_append(sb, ";\n"); } } if (numChildren > 1) { FormulaGraphvizFormatter_visit( node, ASTNode_getRightChild(node), sb ); } } void printFunctionDefinition (unsigned int n, FunctionDefinition_t *fd) { const ASTNode_t *math; char *formula; if ( FunctionDefinition_isSetMath(fd) ) { math = FunctionDefinition_getMath(fd); /* Print function body. */ if (ASTNode_getNumChildren(math) == 0) { printf("(no body defined)"); } else { math = ASTNode_getChild(math, ASTNode_getNumChildren(math) - 1); formula = SBML_formulaToDot(math); fprintf(fout, "subgraph cluster%u {\n", noClusters); fprintf(fout, "label=\"FunctionDefinition: %s\";\n%s\n", FunctionDefinition_getId(fd), formula); free(formula); noClusters++; } } } void printRuleMath (unsigned int n, Rule_t *r) { char *formula; if ( Rule_isSetMath(r) ) { formula = SBML_formulaToDot( Rule_getMath(r)); fprintf(fout, "subgraph cluster%u {\n", noClusters); fprintf(fout, "label=\"Rule: %u\";\n%s\n", n, formula); free(formula); noClusters++; } } void printReactionMath (unsigned int n, Reaction_t *r) { char *formula; KineticLaw_t *kl; if (Reaction_isSetKineticLaw(r)) { kl = Reaction_getKineticLaw(r); if ( KineticLaw_isSetMath(kl) ) { formula = SBML_formulaToDot( KineticLaw_getMath(kl) ); fprintf(fout, "subgraph cluster%u {\n", noClusters); fprintf(fout, "label=\"Reaction: %s\";\n%s\n", Reaction_getId(r), formula); free(formula); noClusters++; } } } void printEventAssignmentMath (unsigned int n, EventAssignment_t *ea) { const char *variable; char *formula; if ( EventAssignment_isSetMath(ea) ) { variable = EventAssignment_getVariable(ea); formula = SBML_formulaToDot( EventAssignment_getMath(ea) ); fprintf(fout, "subgraph cluster%u {\n", noClusters); fprintf(fout, "label=\"EventAssignment: %u\";\n", n); fprintf(fout, "%s [shape=box];\n%s -> %s\n", variable, variable, formula); noClusters++; free(formula); } } void printEventMath (unsigned int n, Event_t *e) { char *formula; unsigned int i; if ( Event_isSetDelay(e) ) { formula = SBML_formulaToDot( Delay_getMath(Event_getDelay(e)) ); fprintf(fout, "subgraph cluster%u {\n", noClusters); fprintf(fout, "label=\"Event %s delay:\";\n%s\n", Event_getId(e), formula); free(formula); noClusters++; } if ( Event_isSetTrigger(e) ) { formula = SBML_formulaToDot( Trigger_getMath(Event_getTrigger(e)) ); fprintf(fout, "subgraph cluster%u {\n", noClusters); fprintf(fout, "label=\"Event %s trigger:\";\n%s\n", Event_getId(e), formula); noClusters++; free(formula); } for (i = 0; i < Event_getNumEventAssignments(e); ++i) { printEventAssignmentMath(i + 1, Event_getEventAssignment(e, i)); } } void printMath (Model_t *m) { unsigned int n; /* a digraph must have a name thus * need to check that Model_getId does not return NULL * and provide a name if it does */ if (Model_getId(m) != NULL) { fprintf(fout, "digraph %s {\n", Model_getId(m)); } else { fprintf(fout, "digraph example {\n"); } fprintf(fout, "compound=true;\n"); for (n = 0; n < Model_getNumFunctionDefinitions(m); ++n) { printFunctionDefinition(n + 1, Model_getFunctionDefinition(m, n)); } for (n = 0; n < Model_getNumRules(m); ++n) { printRuleMath(n + 1, Model_getRule(m, n)); } printf("\n"); for (n = 0; n < Model_getNumReactions(m); ++n) { printReactionMath(n + 1, Model_getReaction(m, n)); } printf("\n"); for (n = 0; n < Model_getNumEvents(m); ++n) { printEventMath(n + 1, Model_getEvent(m, n)); } fprintf(fout, "}\n"); } int main (int argc, char *argv[]) { SBMLDocument_t *d; Model_t *m; if (argc != 3) { printf("\n usage: drawMath <sbml filename> <output dot filename>\n\n"); return 1; } d = readSBML(argv[1]); m = SBMLDocument_getModel(d); SBMLDocument_printErrors(d, stdout); if ((fout = fopen( argv[2], "w" )) == NULL ) { printf( "The output file was not opened\n" ); } else { printMath(m); fclose(fout); } SBMLDocument_free(d); return 0; }
Java
/* * Copyright (C) 2008, 2009, 2010 Apple Inc. All Rights Reserved. * Copyright (C) 2009 Jan Michael Alonzo * * 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. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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 "config.h" #include "AccessibilityController.h" #if HAVE(ACCESSIBILITY) #include "AccessibilityCallbacks.h" #include "AccessibilityUIElement.h" #include "DumpRenderTree.h" #include <atk/atk.h> bool loggingAccessibilityEvents = false; AccessibilityController::AccessibilityController() : m_globalNotificationHandler(nullptr) { } AccessibilityController::~AccessibilityController() { } AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y) { // FIXME: implement return nullptr; } void AccessibilityController::platformResetToConsistentState() { } void AccessibilityController::setLogFocusEvents(bool) { } void AccessibilityController::setLogScrollingStartEvents(bool) { } void AccessibilityController::setLogValueChangeEvents(bool) { } void AccessibilityController::setLogAccessibilityEvents(bool logAccessibilityEvents) { if (logAccessibilityEvents == loggingAccessibilityEvents) return; if (!logAccessibilityEvents) { loggingAccessibilityEvents = false; disconnectAccessibilityCallbacks(); return; } connectAccessibilityCallbacks(); loggingAccessibilityEvents = true; } bool AccessibilityController::addNotificationListener(JSObjectRef functionCallback) { if (!functionCallback) return false; // Only one global notification listener. if (m_globalNotificationHandler) return false; m_globalNotificationHandler = AccessibilityNotificationHandler::create(); m_globalNotificationHandler->setNotificationFunctionCallback(functionCallback); return true; } void AccessibilityController::removeNotificationListener() { // Programmers should not be trying to remove a listener that's already removed. ASSERT(m_globalNotificationHandler); m_globalNotificationHandler = nullptr; } JSRetainPtr<JSStringRef> AccessibilityController::platformName() const { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("atk")); return platformName; } AtkObject* AccessibilityController::childElementById(AtkObject* parent, const char* id) { if (!ATK_IS_OBJECT(parent)) return nullptr; bool parentFound = false; AtkAttributeSet* attributeSet(atk_object_get_attributes(parent)); for (AtkAttributeSet* attributes = attributeSet; attributes; attributes = attributes->next) { AtkAttribute* attribute = static_cast<AtkAttribute*>(attributes->data); if (!strcmp(attribute->name, "html-id")) { if (!strcmp(attribute->value, id)) parentFound = true; break; } } atk_attribute_set_free(attributeSet); if (parentFound) return parent; int childCount = atk_object_get_n_accessible_children(parent); for (int i = 0; i < childCount; i++) { AtkObject* result = childElementById(atk_object_ref_accessible_child(parent, i), id); if (ATK_IS_OBJECT(result)) return result; } return nullptr; } #endif
Java
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/slab.h> #include <linux/kthread.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/uaccess.h> #include <linux/wait.h> #include <linux/mutex.h> #include <linux/msm_audio_ion.h> #include <asm/mach-types.h> #include <mach/qdsp6v2/rtac.h> #include <mach/socinfo.h> #include <mach/qdsp6v2/apr_tal.h> #include "sound/apr_audio-v2.h" #include "sound/q6afe-v2.h" #include "audio_acdb.h" #include "q6voice.h" #define TIMEOUT_MS 500 #define CMD_STATUS_SUCCESS 0 #define CMD_STATUS_FAIL 1 /* CVP CAL Size: 245760 = 240 * 1024 */ #define CVP_CAL_SIZE 245760 /* CVS CAL Size: 49152 = 48 * 1024 */ #define CVS_CAL_SIZE 49152 enum { VOC_TOKEN_NONE, VOIP_MEM_MAP_TOKEN, VOC_CAL_MEM_MAP_TOKEN, }; static struct common_data common; static int voice_send_enable_vocproc_cmd(struct voice_data *v); static int voice_send_netid_timing_cmd(struct voice_data *v); static int voice_send_attach_vocproc_cmd(struct voice_data *v); static int voice_send_set_device_cmd(struct voice_data *v); static int voice_send_disable_vocproc_cmd(struct voice_data *v); static int voice_send_vol_index_cmd(struct voice_data *v); static int voice_send_mvm_unmap_memory_physical_cmd(struct voice_data *v, uint32_t mem_handle); static int voice_send_mvm_cal_network_cmd(struct voice_data *v); static int voice_send_mvm_media_type_cmd(struct voice_data *v); static int voice_send_cvs_data_exchange_mode_cmd(struct voice_data *v); static int voice_send_cvs_packet_exchange_config_cmd(struct voice_data *v); static int voice_set_packet_exchange_mode_and_config(uint32_t session_id, uint32_t mode); static int voice_send_cvs_register_cal_cmd(struct voice_data *v); static int voice_send_cvs_deregister_cal_cmd(struct voice_data *v); static int voice_send_cvp_register_dev_cfg_cmd(struct voice_data *v); static int voice_send_cvp_deregister_dev_cfg_cmd(struct voice_data *v); static int voice_send_cvp_register_cal_cmd(struct voice_data *v); static int voice_send_cvp_deregister_cal_cmd(struct voice_data *v); static int voice_send_cvp_register_vol_cal_cmd(struct voice_data *v); static int voice_send_cvp_deregister_vol_cal_cmd(struct voice_data *v); static int voice_cvs_stop_playback(struct voice_data *v); static int voice_cvs_start_playback(struct voice_data *v); static int voice_cvs_start_record(struct voice_data *v, uint32_t rec_mode); static int voice_cvs_stop_record(struct voice_data *v); static int32_t qdsp_mvm_callback(struct apr_client_data *data, void *priv); static int32_t qdsp_cvs_callback(struct apr_client_data *data, void *priv); static int32_t qdsp_cvp_callback(struct apr_client_data *data, void *priv); static int voice_send_set_pp_enable_cmd(struct voice_data *v, uint32_t module_id, int enable); static struct voice_data *voice_get_session_by_idx(int idx); static u16 voice_get_mvm_handle(struct voice_data *v) { if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return 0; } pr_debug("%s: mvm_handle %d\n", __func__, v->mvm_handle); return v->mvm_handle; } static void voice_set_mvm_handle(struct voice_data *v, u16 mvm_handle) { pr_debug("%s: mvm_handle %d\n", __func__, mvm_handle); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return; } v->mvm_handle = mvm_handle; } static u16 voice_get_cvs_handle(struct voice_data *v) { if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return 0; } pr_debug("%s: cvs_handle %d\n", __func__, v->cvs_handle); return v->cvs_handle; } static void voice_set_cvs_handle(struct voice_data *v, u16 cvs_handle) { pr_debug("%s: cvs_handle %d\n", __func__, cvs_handle); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return; } v->cvs_handle = cvs_handle; } static u16 voice_get_cvp_handle(struct voice_data *v) { if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return 0; } pr_debug("%s: cvp_handle %d\n", __func__, v->cvp_handle); return v->cvp_handle; } static void voice_set_cvp_handle(struct voice_data *v, u16 cvp_handle) { pr_debug("%s: cvp_handle %d\n", __func__, cvp_handle); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return; } v->cvp_handle = cvp_handle; } char *voc_get_session_name(u32 session_id) { char *session_name = NULL; if (session_id == common.voice[VOC_PATH_PASSIVE].session_id) { session_name = VOICE_SESSION_NAME; } else if (session_id == common.voice[VOC_PATH_VOLTE_PASSIVE].session_id) { session_name = VOLTE_SESSION_NAME; } else if (session_id == common.voice[VOC_PATH_FULL].session_id) { session_name = VOIP_SESSION_NAME; } return session_name; } uint32_t voc_get_session_id(char *name) { u32 session_id = 0; if (name != NULL) { if (!strncmp(name, "Voice session", 13)) session_id = common.voice[VOC_PATH_PASSIVE].session_id; else if (!strncmp(name, "Voice2 session", 14)) session_id = common.voice[VOC_PATH_VOICE2_PASSIVE].session_id; else if (!strncmp(name, "VoLTE session", 13)) session_id = common.voice[VOC_PATH_VOLTE_PASSIVE].session_id; else session_id = common.voice[VOC_PATH_FULL].session_id; pr_debug("%s: %s has session id 0x%x\n", __func__, name, session_id); } return session_id; } static struct voice_data *voice_get_session(u32 session_id) { struct voice_data *v = NULL; switch (session_id) { case VOICE_SESSION_VSID: v = &common.voice[VOC_PATH_PASSIVE]; break; case VOICE2_SESSION_VSID: v = &common.voice[VOC_PATH_VOICE2_PASSIVE]; break; case VOLTE_SESSION_VSID: v = &common.voice[VOC_PATH_VOLTE_PASSIVE]; break; case VOIP_SESSION_VSID: v = &common.voice[VOC_PATH_FULL]; break; case ALL_SESSION_VSID: break; default: pr_err("%s: Invalid session_id : %x\n", __func__, session_id); break; } pr_debug("%s:session_id 0x%x session handle 0x%x\n", __func__, session_id, (unsigned int)v); return v; } int voice_get_idx_for_session(u32 session_id) { int idx = 0; switch (session_id) { case VOICE_SESSION_VSID: idx = VOC_PATH_PASSIVE; break; case VOICE2_SESSION_VSID: idx = VOC_PATH_VOICE2_PASSIVE; break; case VOLTE_SESSION_VSID: idx = VOC_PATH_VOLTE_PASSIVE; break; case VOIP_SESSION_VSID: idx = VOC_PATH_FULL; break; case ALL_SESSION_VSID: idx = MAX_VOC_SESSIONS - 1; break; default: pr_err("%s: Invalid session_id : %x\n", __func__, session_id); break; } return idx; } static struct voice_data *voice_get_session_by_idx(int idx) { return ((idx < 0 || idx >= MAX_VOC_SESSIONS) ? NULL : &common.voice[idx]); } static bool is_voice_session(u32 session_id) { return (session_id == common.voice[VOC_PATH_PASSIVE].session_id); } static bool is_voip_session(u32 session_id) { return (session_id == common.voice[VOC_PATH_FULL].session_id); } static bool is_volte_session(u32 session_id) { return (session_id == common.voice[VOC_PATH_VOLTE_PASSIVE].session_id); } static bool is_voice2_session(u32 session_id) { return (session_id == common.voice[VOC_PATH_VOICE2_PASSIVE].session_id); } static bool is_voc_state_active(int voc_state) { if ((voc_state == VOC_RUN) || (voc_state == VOC_CHANGE) || (voc_state == VOC_STANDBY)) return true; return false; } static void voc_set_error_state(uint16_t reset_proc) { struct voice_data *v = NULL; int i; for (i = 0; i < MAX_VOC_SESSIONS; i++) { if (reset_proc == APR_DEST_MODEM && i == VOC_PATH_FULL) continue; v = &common.voice[i]; if (v != NULL) v->voc_state = VOC_ERROR; } } static bool is_other_session_active(u32 session_id) { int i; bool ret = false; /* Check if there is other active session except the input one */ for (i = 0; i < MAX_VOC_SESSIONS; i++) { if (common.voice[i].session_id == session_id) continue; if ((common.voice[i].voc_state == VOC_RUN) || (common.voice[i].voc_state == VOC_CHANGE) || (common.voice[i].voc_state == VOC_STANDBY)) { ret = true; break; } } pr_debug("%s: ret %d\n", __func__, ret); return ret; } static void init_session_id(void) { common.voice[VOC_PATH_PASSIVE].session_id = VOICE_SESSION_VSID; common.voice[VOC_PATH_VOLTE_PASSIVE].session_id = VOLTE_SESSION_VSID; common.voice[VOC_PATH_VOICE2_PASSIVE].session_id = VOICE2_SESSION_VSID; common.voice[VOC_PATH_FULL].session_id = VOIP_SESSION_VSID; } static int voice_apr_register(void) { void *modem_mvm, *modem_cvs, *modem_cvp; pr_debug("%s\n", __func__); mutex_lock(&common.common_lock); /* register callback to APR */ if (common.apr_q6_mvm == NULL) { pr_debug("%s: Start to register MVM callback\n", __func__); common.apr_q6_mvm = apr_register("ADSP", "MVM", qdsp_mvm_callback, 0xFFFFFFFF, &common); if (common.apr_q6_mvm == NULL) { pr_err("%s: Unable to register MVM\n", __func__); goto err; } /* * Register with modem for SSR callback. The APR handle * is not stored since it is used only to receive notifications * and not for communication */ modem_mvm = apr_register("MODEM", "MVM", qdsp_mvm_callback, 0xFFFFFFFF, &common); if (modem_mvm == NULL) pr_err("%s: Unable to register MVM for MODEM\n", __func__); } if (common.apr_q6_cvs == NULL) { pr_debug("%s: Start to register CVS callback\n", __func__); common.apr_q6_cvs = apr_register("ADSP", "CVS", qdsp_cvs_callback, 0xFFFFFFFF, &common); if (common.apr_q6_cvs == NULL) { pr_err("%s: Unable to register CVS\n", __func__); goto err; } rtac_set_voice_handle(RTAC_CVS, common.apr_q6_cvs); /* * Register with modem for SSR callback. The APR handle * is not stored since it is used only to receive notifications * and not for communication */ modem_cvs = apr_register("MODEM", "CVS", qdsp_cvs_callback, 0xFFFFFFFF, &common); if (modem_cvs == NULL) pr_err("%s: Unable to register CVS for MODEM\n", __func__); } if (common.apr_q6_cvp == NULL) { pr_debug("%s: Start to register CVP callback\n", __func__); common.apr_q6_cvp = apr_register("ADSP", "CVP", qdsp_cvp_callback, 0xFFFFFFFF, &common); if (common.apr_q6_cvp == NULL) { pr_err("%s: Unable to register CVP\n", __func__); goto err; } rtac_set_voice_handle(RTAC_CVP, common.apr_q6_cvp); /* * Register with modem for SSR callback. The APR handle * is not stored since it is used only to receive notifications * and not for communication */ modem_cvp = apr_register("MODEM", "CVP", qdsp_cvp_callback, 0xFFFFFFFF, &common); if (modem_cvp == NULL) pr_err("%s: Unable to register CVP for MODEM\n", __func__); } mutex_unlock(&common.common_lock); return 0; err: if (common.apr_q6_cvs != NULL) { apr_deregister(common.apr_q6_cvs); common.apr_q6_cvs = NULL; rtac_set_voice_handle(RTAC_CVS, NULL); } if (common.apr_q6_mvm != NULL) { apr_deregister(common.apr_q6_mvm); common.apr_q6_mvm = NULL; } mutex_unlock(&common.common_lock); return -ENODEV; } static int voice_send_dual_control_cmd(struct voice_data *v) { int ret = 0; struct mvm_modem_dual_control_session_cmd mvm_voice_ctl_cmd; void *apr_mvm; u16 mvm_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } pr_debug("%s: VoLTE command to MVM\n", __func__); if (is_volte_session(v->session_id) || is_voice_session(v->session_id) || is_voice2_session(v->session_id)) { mvm_handle = voice_get_mvm_handle(v); mvm_voice_ctl_cmd.hdr.hdr_field = APR_HDR_FIELD( APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_voice_ctl_cmd.hdr.pkt_size = APR_PKT_SIZE( APR_HDR_SIZE, sizeof(mvm_voice_ctl_cmd) - APR_HDR_SIZE); pr_debug("%s: send mvm Voice Ctl pkt size = %d\n", __func__, mvm_voice_ctl_cmd.hdr.pkt_size); mvm_voice_ctl_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_voice_ctl_cmd.hdr.dest_port = mvm_handle; mvm_voice_ctl_cmd.hdr.token = 0; mvm_voice_ctl_cmd.hdr.opcode = VSS_IMVM_CMD_SET_POLICY_DUAL_CONTROL; mvm_voice_ctl_cmd.voice_ctl.enable_flag = true; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_voice_ctl_cmd); if (ret < 0) { pr_err("%s: Error sending MVM Voice CTL CMD\n", __func__); ret = -EINVAL; goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); ret = -EINVAL; goto fail; } } ret = 0; fail: return ret; } static int voice_create_mvm_cvs_session(struct voice_data *v) { int ret = 0; struct mvm_create_ctl_session_cmd mvm_session_cmd; struct cvs_create_passive_ctl_session_cmd cvs_session_cmd; struct cvs_create_full_ctl_session_cmd cvs_full_ctl_cmd; struct mvm_attach_stream_cmd attach_stream_cmd; void *apr_mvm, *apr_cvs, *apr_cvp; u16 mvm_handle, cvs_handle, cvp_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; apr_cvs = common.apr_q6_cvs; apr_cvp = common.apr_q6_cvp; if (!apr_mvm || !apr_cvs || !apr_cvp) { pr_err("%s: apr_mvm or apr_cvs or apr_cvp is NULL\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); cvs_handle = voice_get_cvs_handle(v); cvp_handle = voice_get_cvp_handle(v); pr_debug("%s: mvm_hdl=%d, cvs_hdl=%d\n", __func__, mvm_handle, cvs_handle); /* send cmd to create mvm session and wait for response */ if (!mvm_handle) { if (is_voice_session(v->session_id) || is_volte_session(v->session_id) || is_voice2_session(v->session_id)) { mvm_session_cmd.hdr.hdr_field = APR_HDR_FIELD( APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_session_cmd.hdr.pkt_size = APR_PKT_SIZE( APR_HDR_SIZE, sizeof(mvm_session_cmd) - APR_HDR_SIZE); pr_debug("%s: send mvm create session pkt size = %d\n", __func__, mvm_session_cmd.hdr.pkt_size); mvm_session_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_session_cmd.hdr.dest_port = 0; mvm_session_cmd.hdr.token = 0; mvm_session_cmd.hdr.opcode = VSS_IMVM_CMD_CREATE_PASSIVE_CONTROL_SESSION; if (is_volte_session(v->session_id)) { strlcpy(mvm_session_cmd.mvm_session.name, "default volte voice", sizeof(mvm_session_cmd.mvm_session.name)); } else if (is_voice2_session(v->session_id)) { strlcpy(mvm_session_cmd.mvm_session.name, VOICE2_SESSION_VSID_STR, sizeof(mvm_session_cmd.mvm_session.name)); } else { strlcpy(mvm_session_cmd.mvm_session.name, "default modem voice", sizeof(mvm_session_cmd.mvm_session.name)); } v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_session_cmd); if (ret < 0) { pr_err("%s: Error sending MVM_CONTROL_SESSION\n", __func__); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } } else { pr_debug("%s: creating MVM full ctrl\n", __func__); mvm_session_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_session_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_session_cmd) - APR_HDR_SIZE); mvm_session_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_session_cmd.hdr.dest_port = 0; mvm_session_cmd.hdr.token = 0; mvm_session_cmd.hdr.opcode = VSS_IMVM_CMD_CREATE_FULL_CONTROL_SESSION; strlcpy(mvm_session_cmd.mvm_session.name, "default voip", sizeof(mvm_session_cmd.mvm_session.name)); v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_session_cmd); if (ret < 0) { pr_err("Fail in sending MVM_CONTROL_SESSION\n"); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } } /* Get the created MVM handle. */ mvm_handle = voice_get_mvm_handle(v); } /* send cmd to create cvs session */ if (!cvs_handle) { if (is_voice_session(v->session_id) || is_volte_session(v->session_id) || is_voice2_session(v->session_id)) { pr_debug("%s: creating CVS passive session\n", __func__); cvs_session_cmd.hdr.hdr_field = APR_HDR_FIELD( APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_session_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_session_cmd) - APR_HDR_SIZE); cvs_session_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_session_cmd.hdr.dest_port = 0; cvs_session_cmd.hdr.token = 0; cvs_session_cmd.hdr.opcode = VSS_ISTREAM_CMD_CREATE_PASSIVE_CONTROL_SESSION; if (is_volte_session(v->session_id)) { strlcpy(cvs_session_cmd.cvs_session.name, "default volte voice", sizeof(cvs_session_cmd.cvs_session.name)); } else if (is_voice2_session(v->session_id)) { strlcpy(cvs_session_cmd.cvs_session.name, VOICE2_SESSION_VSID_STR, sizeof(cvs_session_cmd.cvs_session.name)); } else { strlcpy(cvs_session_cmd.cvs_session.name, "default modem voice", sizeof(cvs_session_cmd.cvs_session.name)); } v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_session_cmd); if (ret < 0) { pr_err("Fail in sending STREAM_CONTROL_SESSION\n"); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } /* Get the created CVS handle. */ cvs_handle = voice_get_cvs_handle(v); } else { pr_debug("%s: creating CVS full session\n", __func__); cvs_full_ctl_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_full_ctl_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_full_ctl_cmd) - APR_HDR_SIZE); cvs_full_ctl_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_full_ctl_cmd.hdr.dest_port = 0; cvs_full_ctl_cmd.hdr.token = 0; cvs_full_ctl_cmd.hdr.opcode = VSS_ISTREAM_CMD_CREATE_FULL_CONTROL_SESSION; cvs_full_ctl_cmd.cvs_session.direction = 2; cvs_full_ctl_cmd.cvs_session.enc_media_type = common.mvs_info.media_type; cvs_full_ctl_cmd.cvs_session.dec_media_type = common.mvs_info.media_type; cvs_full_ctl_cmd.cvs_session.network_id = common.mvs_info.network_type; strlcpy(cvs_full_ctl_cmd.cvs_session.name, "default q6 voice", sizeof(cvs_full_ctl_cmd.cvs_session.name)); v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_full_ctl_cmd); if (ret < 0) { pr_err("%s: Err %d sending CREATE_FULL_CTRL\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } /* Get the created CVS handle. */ cvs_handle = voice_get_cvs_handle(v); /* Attach MVM to CVS. */ pr_debug("%s: Attach MVM to stream\n", __func__); attach_stream_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); attach_stream_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(attach_stream_cmd) - APR_HDR_SIZE); attach_stream_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); attach_stream_cmd.hdr.dest_port = mvm_handle; attach_stream_cmd.hdr.token = 0; attach_stream_cmd.hdr.opcode = VSS_IMVM_CMD_ATTACH_STREAM; attach_stream_cmd.attach_stream.handle = cvs_handle; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &attach_stream_cmd); if (ret < 0) { pr_err("%s: Error %d sending ATTACH_STREAM\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } } } return 0; fail: return -EINVAL; } static int voice_destroy_mvm_cvs_session(struct voice_data *v) { int ret = 0; struct mvm_detach_stream_cmd detach_stream; struct apr_hdr mvm_destroy; struct apr_hdr cvs_destroy; void *apr_mvm, *apr_cvs; u16 mvm_handle, cvs_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; apr_cvs = common.apr_q6_cvs; if (!apr_mvm || !apr_cvs) { pr_err("%s: apr_mvm or apr_cvs is NULL\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); cvs_handle = voice_get_cvs_handle(v); /* MVM, CVS sessions are destroyed only for Full control sessions. */ if (is_voip_session(v->session_id)) { pr_debug("%s: MVM detach stream, VOC_STATE: %d\n", __func__, v->voc_state); /* Detach voice stream. */ detach_stream.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); detach_stream.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(detach_stream) - APR_HDR_SIZE); detach_stream.hdr.src_port = voice_get_idx_for_session(v->session_id); detach_stream.hdr.dest_port = mvm_handle; detach_stream.hdr.token = 0; detach_stream.hdr.opcode = VSS_IMVM_CMD_DETACH_STREAM; detach_stream.detach_stream.handle = cvs_handle; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &detach_stream); if (ret < 0) { pr_err("%s: Error %d sending DETACH_STREAM\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait event timeout\n", __func__); goto fail; } /* Unmap memory */ if (v->shmem_info.mem_handle != 0) { ret = voice_send_mvm_unmap_memory_physical_cmd(v, v->shmem_info.mem_handle); if (ret < 0) { pr_err("%s Memory_unmap for voip failed %d\n", __func__, ret); goto fail; } v->shmem_info.mem_handle = 0; } } if (is_voip_session(v->session_id) || v->voc_state == VOC_ERROR) { /* Destroy CVS. */ pr_debug("%s: CVS destroy session\n", __func__); cvs_destroy.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_destroy.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_destroy) - APR_HDR_SIZE); cvs_destroy.src_port = voice_get_idx_for_session(v->session_id); cvs_destroy.dest_port = cvs_handle; cvs_destroy.token = 0; cvs_destroy.opcode = APRV2_IBASIC_CMD_DESTROY_SESSION; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_destroy); if (ret < 0) { pr_err("%s: Error %d sending CVS DESTROY\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait event timeout\n", __func__); goto fail; } cvs_handle = 0; voice_set_cvs_handle(v, cvs_handle); /* Unmap physical memory for calibration */ pr_debug("%s: cal_mem_handle %d\n", __func__, common.cal_mem_handle); if (!is_other_session_active(v->session_id) && (common.cal_mem_handle != 0)) { ret = voice_send_mvm_unmap_memory_physical_cmd(v, common.cal_mem_handle); if (ret < 0) { pr_err("%s Fail at cal mem unmap %d\n", __func__, ret); goto fail; } common.cal_mem_handle = 0; } /* Destroy MVM. */ pr_debug("MVM destroy session\n"); mvm_destroy.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_destroy.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_destroy) - APR_HDR_SIZE); mvm_destroy.src_port = voice_get_idx_for_session(v->session_id); mvm_destroy.dest_port = mvm_handle; mvm_destroy.token = 0; mvm_destroy.opcode = APRV2_IBASIC_CMD_DESTROY_SESSION; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_destroy); if (ret < 0) { pr_err("%s: Error %d sending MVM DESTROY\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait event timeout\n", __func__); goto fail; } mvm_handle = 0; voice_set_mvm_handle(v, mvm_handle); } return 0; fail: return -EINVAL; } static int voice_send_tty_mode_cmd(struct voice_data *v) { int ret = 0; struct mvm_set_tty_mode_cmd mvm_tty_mode_cmd; void *apr_mvm; u16 mvm_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); if (v->tty_mode) { /* send tty mode cmd to mvm */ mvm_tty_mode_cmd.hdr.hdr_field = APR_HDR_FIELD( APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_tty_mode_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_tty_mode_cmd) - APR_HDR_SIZE); pr_debug("%s: pkt size = %d\n", __func__, mvm_tty_mode_cmd.hdr.pkt_size); mvm_tty_mode_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_tty_mode_cmd.hdr.dest_port = mvm_handle; mvm_tty_mode_cmd.hdr.token = 0; mvm_tty_mode_cmd.hdr.opcode = VSS_ISTREAM_CMD_SET_TTY_MODE; mvm_tty_mode_cmd.tty_mode.mode = v->tty_mode; pr_debug("tty mode =%d\n", mvm_tty_mode_cmd.tty_mode.mode); v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_tty_mode_cmd); if (ret < 0) { pr_err("%s: Error %d sending SET_TTY_MODE\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } } return 0; fail: return -EINVAL; } static int voice_send_set_pp_enable_cmd(struct voice_data *v, uint32_t module_id, int enable) { struct cvs_set_pp_enable_cmd cvs_set_pp_cmd; int ret = 0; void *apr_cvs; u16 cvs_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); cvs_set_pp_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_set_pp_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_set_pp_cmd) - APR_HDR_SIZE); cvs_set_pp_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_set_pp_cmd.hdr.dest_port = cvs_handle; cvs_set_pp_cmd.hdr.token = 0; cvs_set_pp_cmd.hdr.opcode = VSS_ICOMMON_CMD_SET_UI_PROPERTY; cvs_set_pp_cmd.vss_set_pp.module_id = module_id; cvs_set_pp_cmd.vss_set_pp.param_id = VOICE_PARAM_MOD_ENABLE; cvs_set_pp_cmd.vss_set_pp.param_size = MOD_ENABLE_PARAM_LEN; cvs_set_pp_cmd.vss_set_pp.reserved = 0; cvs_set_pp_cmd.vss_set_pp.enable = enable; cvs_set_pp_cmd.vss_set_pp.reserved_field = 0; pr_debug("voice_send_set_pp_enable_cmd, module_id=%d, enable=%d\n", module_id, enable); v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_set_pp_cmd); if (ret < 0) { pr_err("Fail: sending cvs set pp enable,\n"); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_set_dtx(struct voice_data *v) { int ret = 0; void *apr_cvs; u16 cvs_handle; struct cvs_set_enc_dtx_mode_cmd cvs_set_dtx; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); /* Set DTX */ cvs_set_dtx.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_set_dtx.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_set_dtx) - APR_HDR_SIZE); cvs_set_dtx.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_set_dtx.hdr.dest_port = cvs_handle; cvs_set_dtx.hdr.token = 0; cvs_set_dtx.hdr.opcode = VSS_ISTREAM_CMD_SET_ENC_DTX_MODE; cvs_set_dtx.dtx_mode.enable = common.mvs_info.dtx_mode; pr_debug("%s: Setting DTX %d\n", __func__, common.mvs_info.dtx_mode); v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_set_dtx); if (ret < 0) { pr_err("%s: Error %d sending SET_DTX\n", __func__, ret); return -EINVAL; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); return -EINVAL; } return 0; } static int voice_send_mvm_media_type_cmd(struct voice_data *v) { struct vss_imvm_cmd_set_cal_media_type_t mvm_set_cal_media_type; int ret = 0; void *apr_mvm; u16 mvm_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); mvm_set_cal_media_type.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_set_cal_media_type.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_set_cal_media_type) - APR_HDR_SIZE); mvm_set_cal_media_type.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_set_cal_media_type.hdr.dest_port = mvm_handle; mvm_set_cal_media_type.hdr.token = 0; mvm_set_cal_media_type.hdr.opcode = VSS_IMVM_CMD_SET_CAL_MEDIA_TYPE; mvm_set_cal_media_type.media_id = common.mvs_info.media_type; pr_debug("%s: setting media_id as %x\n", __func__ , mvm_set_cal_media_type.media_id); v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_set_cal_media_type); if (ret < 0) { pr_err("%s: Error %d sending media type\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout %d\n", __func__, ret); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_dtmf_rx_detection_cmd(struct voice_data *v, uint32_t enable) { int ret = 0; void *apr_cvs; u16 cvs_handle; struct cvs_set_rx_dtmf_detection_cmd cvs_dtmf_rx_detection; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); /* Set SET_DTMF_RX_DETECTION */ cvs_dtmf_rx_detection.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_dtmf_rx_detection.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_dtmf_rx_detection) - APR_HDR_SIZE); cvs_dtmf_rx_detection.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_dtmf_rx_detection.hdr.dest_port = cvs_handle; cvs_dtmf_rx_detection.hdr.token = 0; cvs_dtmf_rx_detection.hdr.opcode = VSS_ISTREAM_CMD_SET_RX_DTMF_DETECTION; cvs_dtmf_rx_detection.cvs_dtmf_det.enable = enable; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_dtmf_rx_detection); if (ret < 0) { pr_err("%s: Error %d sending SET_DTMF_RX_DETECTION\n", __func__, ret); return -EINVAL; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); return -EINVAL; } return ret; } void voc_disable_dtmf_det_on_active_sessions(void) { struct voice_data *v = NULL; int i; for (i = 0; i < MAX_VOC_SESSIONS; i++) { v = &common.voice[i]; if ((v->dtmf_rx_detect_en) && ((v->voc_state == VOC_RUN) || (v->voc_state == VOC_CHANGE) || (v->voc_state == VOC_STANDBY))) { pr_debug("disable dtmf det on ses_id=%d\n", v->session_id); voice_send_dtmf_rx_detection_cmd(v, 0); } } } int voc_enable_dtmf_rx_detection(uint32_t session_id, uint32_t enable) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); v->dtmf_rx_detect_en = enable; if ((v->voc_state == VOC_RUN) || (v->voc_state == VOC_CHANGE) || (v->voc_state == VOC_STANDBY)) ret = voice_send_dtmf_rx_detection_cmd(v, v->dtmf_rx_detect_en); mutex_unlock(&v->lock); return ret; } static int voice_config_cvs_vocoder(struct voice_data *v) { int ret = 0; void *apr_cvs; u16 cvs_handle; /* Set media type. */ struct cvs_set_media_type_cmd cvs_set_media_cmd; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); cvs_set_media_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_set_media_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_set_media_cmd) - APR_HDR_SIZE); cvs_set_media_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_set_media_cmd.hdr.dest_port = cvs_handle; cvs_set_media_cmd.hdr.token = 0; cvs_set_media_cmd.hdr.opcode = VSS_ISTREAM_CMD_SET_MEDIA_TYPE; cvs_set_media_cmd.media_type.tx_media_id = common.mvs_info.media_type; cvs_set_media_cmd.media_type.rx_media_id = common.mvs_info.media_type; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_set_media_cmd); if (ret < 0) { pr_err("%s: Error %d sending SET_MEDIA_TYPE\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } /* Set encoder properties. */ switch (common.mvs_info.media_type) { case VSS_MEDIA_ID_EVRC_MODEM: case VSS_MEDIA_ID_4GV_NB_MODEM: case VSS_MEDIA_ID_4GV_WB_MODEM: { struct cvs_set_cdma_enc_minmax_rate_cmd cvs_set_cdma_rate; pr_debug("Setting EVRC min-max rate\n"); cvs_set_cdma_rate.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_set_cdma_rate.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_set_cdma_rate) - APR_HDR_SIZE); cvs_set_cdma_rate.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_set_cdma_rate.hdr.dest_port = cvs_handle; cvs_set_cdma_rate.hdr.token = 0; cvs_set_cdma_rate.hdr.opcode = VSS_ISTREAM_CMD_CDMA_SET_ENC_MINMAX_RATE; cvs_set_cdma_rate.cdma_rate.min_rate = common.mvs_info.rate; cvs_set_cdma_rate.cdma_rate.max_rate = common.mvs_info.rate; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_set_cdma_rate); if (ret < 0) { pr_err("%s: Error %d sending SET_EVRC_MINMAX_RATE\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } break; } case VSS_MEDIA_ID_AMR_NB_MODEM: { struct cvs_set_amr_enc_rate_cmd cvs_set_amr_rate; pr_debug("Setting AMR rate\n"); cvs_set_amr_rate.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_set_amr_rate.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_set_amr_rate) - APR_HDR_SIZE); cvs_set_amr_rate.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_set_amr_rate.hdr.dest_port = cvs_handle; cvs_set_amr_rate.hdr.token = 0; cvs_set_amr_rate.hdr.opcode = VSS_ISTREAM_CMD_VOC_AMR_SET_ENC_RATE; cvs_set_amr_rate.amr_rate.mode = common.mvs_info.rate; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_set_amr_rate); if (ret < 0) { pr_err("%s: Error %d sending SET_AMR_RATE\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } ret = voice_set_dtx(v); if (ret < 0) goto fail; break; } case VSS_MEDIA_ID_AMR_WB_MODEM: { struct cvs_set_amrwb_enc_rate_cmd cvs_set_amrwb_rate; pr_debug("Setting AMR WB rate\n"); cvs_set_amrwb_rate.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_set_amrwb_rate.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_set_amrwb_rate) - APR_HDR_SIZE); cvs_set_amrwb_rate.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_set_amrwb_rate.hdr.dest_port = cvs_handle; cvs_set_amrwb_rate.hdr.token = 0; cvs_set_amrwb_rate.hdr.opcode = VSS_ISTREAM_CMD_VOC_AMRWB_SET_ENC_RATE; cvs_set_amrwb_rate.amrwb_rate.mode = common.mvs_info.rate; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_set_amrwb_rate); if (ret < 0) { pr_err("%s: Error %d sending SET_AMRWB_RATE\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } ret = voice_set_dtx(v); if (ret < 0) goto fail; break; } case VSS_MEDIA_ID_G729: case VSS_MEDIA_ID_G711_ALAW: case VSS_MEDIA_ID_G711_MULAW: { ret = voice_set_dtx(v); break; } default: /* Do nothing. */ break; } return 0; fail: return -EINVAL; } static int voice_send_start_voice_cmd(struct voice_data *v) { struct apr_hdr mvm_start_voice_cmd; int ret = 0; void *apr_mvm; u16 mvm_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); mvm_start_voice_cmd.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_start_voice_cmd.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_start_voice_cmd) - APR_HDR_SIZE); pr_debug("send mvm_start_voice_cmd pkt size = %d\n", mvm_start_voice_cmd.pkt_size); mvm_start_voice_cmd.src_port = voice_get_idx_for_session(v->session_id); mvm_start_voice_cmd.dest_port = mvm_handle; mvm_start_voice_cmd.token = 0; mvm_start_voice_cmd.opcode = VSS_IMVM_CMD_START_VOICE; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_start_voice_cmd); if (ret < 0) { pr_err("Fail in sending VSS_IMVM_CMD_START_VOICE\n"); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_disable_vocproc_cmd(struct voice_data *v) { struct apr_hdr cvp_disable_cmd; int ret = 0; void *apr_cvp; u16 cvp_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvp = common.apr_q6_cvp; if (!apr_cvp) { pr_err("%s: apr regist failed\n", __func__); return -EINVAL; } cvp_handle = voice_get_cvp_handle(v); /* disable vocproc and wait for respose */ cvp_disable_cmd.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_disable_cmd.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_disable_cmd) - APR_HDR_SIZE); pr_debug("cvp_disable_cmd pkt size = %d, cvp_handle=%d\n", cvp_disable_cmd.pkt_size, cvp_handle); cvp_disable_cmd.src_port = voice_get_idx_for_session(v->session_id); cvp_disable_cmd.dest_port = cvp_handle; cvp_disable_cmd.token = 0; cvp_disable_cmd.opcode = VSS_IVOCPROC_CMD_DISABLE; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvp, (uint32_t *) &cvp_disable_cmd); if (ret < 0) { pr_err("Fail in sending VSS_IVOCPROC_CMD_DISABLE\n"); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static void voc_get_tx_rx_topology(struct voice_data *v, uint32_t *tx_topology_id, uint32_t *rx_topology_id) { uint32_t tx_id = 0; uint32_t rx_id = 0; if (v->lch_mode == VOICE_LCH_START) { pr_debug("%s: Setting TX and RX topology to NONE for LCH\n", __func__); tx_id = VSS_IVOCPROC_TOPOLOGY_ID_NONE; rx_id = VSS_IVOCPROC_TOPOLOGY_ID_NONE; } else { /* Use default topology if invalid value in ACDB */ tx_id = get_voice_tx_topology(); if (tx_id == 0) tx_id = VSS_IVOCPROC_TOPOLOGY_ID_TX_SM_ECNS; rx_id = get_voice_rx_topology(); if (rx_id == 0) rx_id = VSS_IVOCPROC_TOPOLOGY_ID_RX_DEFAULT; } *tx_topology_id = tx_id; *rx_topology_id = rx_id; } static int voice_send_set_device_cmd(struct voice_data *v) { struct cvp_set_device_cmd cvp_setdev_cmd; int ret = 0; void *apr_cvp; u16 cvp_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvp = common.apr_q6_cvp; if (!apr_cvp) { pr_err("%s: apr_cvp is NULL.\n", __func__); return -EINVAL; } cvp_handle = voice_get_cvp_handle(v); /* set device and wait for response */ cvp_setdev_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_setdev_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_setdev_cmd) - APR_HDR_SIZE); pr_debug(" send create cvp setdev, pkt size = %d\n", cvp_setdev_cmd.hdr.pkt_size); cvp_setdev_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_setdev_cmd.hdr.dest_port = cvp_handle; cvp_setdev_cmd.hdr.token = 0; cvp_setdev_cmd.hdr.opcode = VSS_IVOCPROC_CMD_SET_DEVICE_V2; voc_get_tx_rx_topology(v, &cvp_setdev_cmd.cvp_set_device_v2.tx_topology_id, &cvp_setdev_cmd.cvp_set_device_v2.rx_topology_id); cvp_setdev_cmd.cvp_set_device_v2.tx_port_id = v->dev_tx.port_id; cvp_setdev_cmd.cvp_set_device_v2.rx_port_id = v->dev_rx.port_id; cvp_setdev_cmd.cvp_set_device_v2.vocproc_mode = VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING; cvp_setdev_cmd.cvp_set_device_v2.ec_ref_port_id = VSS_IVOCPROC_PORT_ID_NONE; pr_debug("topology=%d , tx_port_id=%d, rx_port_id=%d\n", cvp_setdev_cmd.cvp_set_device_v2.tx_topology_id, cvp_setdev_cmd.cvp_set_device_v2.tx_port_id, cvp_setdev_cmd.cvp_set_device_v2.rx_port_id); v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvp, (uint32_t *) &cvp_setdev_cmd); if (ret < 0) { pr_err("Fail in sending VOCPROC_FULL_CONTROL_SESSION\n"); goto fail; } pr_debug("wait for cvp create session event\n"); ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_stop_voice_cmd(struct voice_data *v) { struct apr_hdr mvm_stop_voice_cmd; int ret = 0; void *apr_mvm; u16 mvm_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); mvm_stop_voice_cmd.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_stop_voice_cmd.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_stop_voice_cmd) - APR_HDR_SIZE); pr_debug("send mvm_stop_voice_cmd pkt size = %d\n", mvm_stop_voice_cmd.pkt_size); mvm_stop_voice_cmd.src_port = voice_get_idx_for_session(v->session_id); mvm_stop_voice_cmd.dest_port = mvm_handle; mvm_stop_voice_cmd.token = 0; mvm_stop_voice_cmd.opcode = VSS_IMVM_CMD_STOP_VOICE; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_stop_voice_cmd); if (ret < 0) { pr_err("Fail in sending VSS_IMVM_CMD_STOP_VOICE\n"); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_cvs_register_cal_cmd(struct voice_data *v) { struct cvs_register_cal_data_cmd cvs_reg_cal_cmd; struct acdb_cal_block cal_block; int ret = 0; memset(&cvs_reg_cal_cmd, 0, sizeof(cvs_reg_cal_cmd)); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvs) { pr_err("%s: apr_cvs is NULL\n", __func__); goto fail; } if (!common.cal_mem_handle) { pr_err("%s: Cal mem handle is NULL\n", __func__); goto fail; } get_vocstrm_cal(&cal_block); if (cal_block.cal_size == 0) { pr_err("%s: CVS cal size is 0\n", __func__); goto fail; } cvs_reg_cal_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_reg_cal_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_reg_cal_cmd) - APR_HDR_SIZE); cvs_reg_cal_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_reg_cal_cmd.hdr.dest_port = voice_get_cvs_handle(v); cvs_reg_cal_cmd.hdr.token = 0; cvs_reg_cal_cmd.hdr.opcode = VSS_ISTREAM_CMD_REGISTER_CALIBRATION_DATA_V2; cvs_reg_cal_cmd.cvs_cal_data.cal_mem_handle = common.cal_mem_handle; cvs_reg_cal_cmd.cvs_cal_data.cal_mem_address = cal_block.cal_paddr; cvs_reg_cal_cmd.cvs_cal_data.cal_mem_size = cal_block.cal_size; /* Get the column info corresponding to CVS cal from ACDB. */ get_voice_col_data(VOCSTRM_CAL, &cal_block); if (cal_block.cal_size == 0 || cal_block.cal_size > sizeof(cvs_reg_cal_cmd.cvs_cal_data.column_info)) { pr_err("%s: Invalid VOCSTRM_CAL size %d\n", __func__, cal_block.cal_size); goto fail; } memcpy(&cvs_reg_cal_cmd.cvs_cal_data.column_info[0], (void *) cal_block.cal_kvaddr, cal_block.cal_size); v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvs, (uint32_t *) &cvs_reg_cal_cmd); if (ret < 0) { pr_err("%s: Error %d registering CVS cal\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_cvs_deregister_cal_cmd(struct voice_data *v) { struct cvs_deregister_cal_data_cmd cvs_dereg_cal_cmd; struct acdb_cal_block cal_block; int ret = 0; memset(&cvs_dereg_cal_cmd, 0, sizeof(cvs_dereg_cal_cmd)); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvs) { pr_err("%s: apr_cvs is NULL\n", __func__); goto fail; } get_vocstrm_cal(&cal_block); if (cal_block.cal_size == 0) return 0; cvs_dereg_cal_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_dereg_cal_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_dereg_cal_cmd) - APR_HDR_SIZE); cvs_dereg_cal_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_dereg_cal_cmd.hdr.dest_port = voice_get_cvs_handle(v); cvs_dereg_cal_cmd.hdr.token = 0; cvs_dereg_cal_cmd.hdr.opcode = VSS_ISTREAM_CMD_DEREGISTER_CALIBRATION_DATA; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvs, (uint32_t *) &cvs_dereg_cal_cmd); if (ret < 0) { pr_err("%s: Error %d de-registering CVS cal\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_cvp_register_dev_cfg_cmd(struct voice_data *v) { struct cvp_register_dev_cfg_cmd cvp_reg_dev_cfg_cmd; struct acdb_cal_block cal_block; int ret = 0; memset(&cvp_reg_dev_cfg_cmd, 0, sizeof(cvp_reg_dev_cfg_cmd)); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvp) { pr_err("%s: apr_cvp is NULL\n", __func__); goto fail; } if (!common.cal_mem_handle) { pr_err("%s: Cal mem handle is NULL\n", __func__); goto fail; } get_vocproc_dev_cfg_cal(&cal_block); if (cal_block.cal_size == 0) { pr_err("%s: CVP cal size is 0\n", __func__); goto fail; } cvp_reg_dev_cfg_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_reg_dev_cfg_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_reg_dev_cfg_cmd) - APR_HDR_SIZE); cvp_reg_dev_cfg_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_reg_dev_cfg_cmd.hdr.dest_port = voice_get_cvp_handle(v); cvp_reg_dev_cfg_cmd.hdr.token = 0; cvp_reg_dev_cfg_cmd.hdr.opcode = VSS_IVOCPROC_CMD_REGISTER_DEVICE_CONFIG; cvp_reg_dev_cfg_cmd.cvp_dev_cfg_data.mem_handle = common.cal_mem_handle; cvp_reg_dev_cfg_cmd.cvp_dev_cfg_data.mem_address = cal_block.cal_paddr; cvp_reg_dev_cfg_cmd.cvp_dev_cfg_data.mem_size = cal_block.cal_size; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvp, (uint32_t *) &cvp_reg_dev_cfg_cmd); if (ret < 0) { pr_err("%s: Error %d registering CVP dev cfg cal\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_cvp_deregister_dev_cfg_cmd(struct voice_data *v) { struct cvp_deregister_dev_cfg_cmd cvp_dereg_dev_cfg_cmd; struct acdb_cal_block cal_block; int ret = 0; memset(&cvp_dereg_dev_cfg_cmd, 0, sizeof(cvp_dereg_dev_cfg_cmd)); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvp) { pr_err("%s: apr_cvp is NULL.\n", __func__); goto fail; } get_vocproc_dev_cfg_cal(&cal_block); if (cal_block.cal_size == 0) return 0; cvp_dereg_dev_cfg_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_dereg_dev_cfg_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_dereg_dev_cfg_cmd) - APR_HDR_SIZE); cvp_dereg_dev_cfg_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_dereg_dev_cfg_cmd.hdr.dest_port = voice_get_cvp_handle(v); cvp_dereg_dev_cfg_cmd.hdr.token = 0; cvp_dereg_dev_cfg_cmd.hdr.opcode = VSS_IVOCPROC_CMD_DEREGISTER_DEVICE_CONFIG; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvp, (uint32_t *) &cvp_dereg_dev_cfg_cmd); if (ret < 0) { pr_err("%s: Error %d de-registering CVP dev cfg cal\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_cvp_register_cal_cmd(struct voice_data *v) { struct cvp_register_cal_data_cmd cvp_reg_cal_cmd; struct acdb_cal_block cal_block; int ret = 0; memset(&cvp_reg_cal_cmd, 0, sizeof(cvp_reg_cal_cmd)); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvp) { pr_err("%s: apr_cvp is NULL\n", __func__); goto fail; } if (!common.cal_mem_handle) { pr_err("%s: Cal mem handle is NULL\n", __func__); goto fail; } get_vocproc_cal(&cal_block); if (cal_block.cal_size == 0) { pr_err("%s: CVP cal size is 0\n", __func__); goto fail; } cvp_reg_cal_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_reg_cal_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_reg_cal_cmd) - APR_HDR_SIZE); cvp_reg_cal_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_reg_cal_cmd.hdr.dest_port = voice_get_cvp_handle(v); cvp_reg_cal_cmd.hdr.token = 0; cvp_reg_cal_cmd.hdr.opcode = VSS_IVOCPROC_CMD_REGISTER_CALIBRATION_DATA_V2; cvp_reg_cal_cmd.cvp_cal_data.cal_mem_handle = common.cal_mem_handle; cvp_reg_cal_cmd.cvp_cal_data.cal_mem_address = cal_block.cal_paddr; cvp_reg_cal_cmd.cvp_cal_data.cal_mem_size = cal_block.cal_size; /* Get the column info corresponding to CVP cal from ACDB. */ get_voice_col_data(VOCPROC_CAL, &cal_block); if (cal_block.cal_size == 0 || cal_block.cal_size > sizeof(cvp_reg_cal_cmd.cvp_cal_data.column_info)) { pr_err("%s: Invalid VOCPROC_CAL size %d\n", __func__, cal_block.cal_size); goto fail; } memcpy(&cvp_reg_cal_cmd.cvp_cal_data.column_info[0], (void *) cal_block.cal_kvaddr, cal_block.cal_size); v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvp, (uint32_t *) &cvp_reg_cal_cmd); if (ret < 0) { pr_err("%s: Error %d registering CVP cal\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_cvp_deregister_cal_cmd(struct voice_data *v) { struct cvp_deregister_cal_data_cmd cvp_dereg_cal_cmd; struct acdb_cal_block cal_block; int ret = 0; memset(&cvp_dereg_cal_cmd, 0, sizeof(cvp_dereg_cal_cmd)); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvp) { pr_err("%s: apr_cvp is NULL.\n", __func__); goto fail; } get_vocproc_cal(&cal_block); if (cal_block.cal_size == 0) return 0; cvp_dereg_cal_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_dereg_cal_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_dereg_cal_cmd) - APR_HDR_SIZE); cvp_dereg_cal_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_dereg_cal_cmd.hdr.dest_port = voice_get_cvp_handle(v); cvp_dereg_cal_cmd.hdr.token = 0; cvp_dereg_cal_cmd.hdr.opcode = VSS_IVOCPROC_CMD_DEREGISTER_CALIBRATION_DATA; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvp, (uint32_t *) &cvp_dereg_cal_cmd); if (ret < 0) { pr_err("%s: Error %d de-registering CVP cal\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_cvp_register_vol_cal_cmd(struct voice_data *v) { struct cvp_register_vol_cal_data_cmd cvp_reg_vol_cal_cmd; struct acdb_cal_block cal_block; int ret = 0; memset(&cvp_reg_vol_cal_cmd, 0, sizeof(cvp_reg_vol_cal_cmd)); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvp) { pr_err("%s: apr_cvp is NULL.\n", __func__); goto fail; } if (!common.cal_mem_handle) { pr_err("%s: Cal mem handle is NULL\n", __func__); goto fail; } get_vocvol_cal(&cal_block); if (cal_block.cal_size == 0) { pr_err("%s: CVP vol cal size is 0\n", __func__); goto fail; } cvp_reg_vol_cal_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_reg_vol_cal_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_reg_vol_cal_cmd) - APR_HDR_SIZE); cvp_reg_vol_cal_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_reg_vol_cal_cmd.hdr.dest_port = voice_get_cvp_handle(v); cvp_reg_vol_cal_cmd.hdr.token = 0; cvp_reg_vol_cal_cmd.hdr.opcode = VSS_IVOCPROC_CMD_REGISTER_VOL_CALIBRATION_DATA; cvp_reg_vol_cal_cmd.cvp_vol_cal_data.cal_mem_handle = common.cal_mem_handle; cvp_reg_vol_cal_cmd.cvp_vol_cal_data.cal_mem_address = cal_block.cal_paddr; cvp_reg_vol_cal_cmd.cvp_vol_cal_data.cal_mem_size = cal_block.cal_size; /* Get the column info corresponding to CVP volume cal from ACDB. */ get_voice_col_data(VOCVOL_CAL, &cal_block); if (cal_block.cal_size == 0 || cal_block.cal_size > sizeof(cvp_reg_vol_cal_cmd.cvp_vol_cal_data.column_info)) { pr_err("%s: Invalid VOCVOL_CAL size %d\n", __func__, cal_block.cal_size); goto fail; } memcpy(&cvp_reg_vol_cal_cmd.cvp_vol_cal_data.column_info[0], (void *) cal_block.cal_kvaddr, cal_block.cal_size); v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvp, (uint32_t *) &cvp_reg_vol_cal_cmd); if (ret < 0) { pr_err("%s: Error %d registering CVP vol cal\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_cvp_deregister_vol_cal_cmd(struct voice_data *v) { struct cvp_deregister_vol_cal_data_cmd cvp_dereg_vol_cal_cmd; struct acdb_cal_block cal_block; int ret = 0; memset(&cvp_dereg_vol_cal_cmd, 0, sizeof(cvp_dereg_vol_cal_cmd)); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvp) { pr_err("%s: apr_cvp is NULL\n", __func__); goto fail; } get_vocvol_cal(&cal_block); if (cal_block.cal_size == 0) return 0; cvp_dereg_vol_cal_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_dereg_vol_cal_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_dereg_vol_cal_cmd) - APR_HDR_SIZE); cvp_dereg_vol_cal_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_dereg_vol_cal_cmd.hdr.dest_port = voice_get_cvp_handle(v); cvp_dereg_vol_cal_cmd.hdr.token = 0; cvp_dereg_vol_cal_cmd.hdr.opcode = VSS_IVOCPROC_CMD_DEREGISTER_VOL_CALIBRATION_DATA; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvp, (uint32_t *) &cvp_dereg_vol_cal_cmd); if (ret < 0) { pr_err("%s: Error %d de-registering CVP vol cal\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } fail: return ret; } static int voice_map_memory_physical_cmd(struct voice_data *v, struct mem_map_table *table_info, dma_addr_t phys, uint32_t size, uint32_t token) { struct vss_imemory_cmd_map_physical_t mvm_map_phys_cmd; uint32_t *memtable; int ret = 0; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); goto fail; } if (!table_info->data) { pr_err("%s: memory table is NULL.\n", __func__); goto fail; } memtable = (uint32_t *) table_info->data; /* * Store next table descriptor's address(64 bit) as NULL as there * is only one memory block */ memtable[0] = (uint32_t)NULL; memtable[1] = (uint32_t)NULL; /* Store next table descriptor's size */ memtable[2] = 0; /* Store shared mem add */ memtable[3] = phys; memtable[4] = 0; /* Store shared memory size */ memtable[5] = size; mvm_map_phys_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_map_phys_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_map_phys_cmd) - APR_HDR_SIZE); mvm_map_phys_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_map_phys_cmd.hdr.dest_port = voice_get_mvm_handle(v); mvm_map_phys_cmd.hdr.token = token; mvm_map_phys_cmd.hdr.opcode = VSS_IMEMORY_CMD_MAP_PHYSICAL; mvm_map_phys_cmd.table_descriptor.mem_address = table_info->phys; mvm_map_phys_cmd.table_descriptor.mem_size = sizeof(struct vss_imemory_block_t) + sizeof(struct vss_imemory_table_descriptor_t); mvm_map_phys_cmd.is_cached = true; mvm_map_phys_cmd.cache_line_size = 128; mvm_map_phys_cmd.access_mask = 3; mvm_map_phys_cmd.page_align = 4096; mvm_map_phys_cmd.min_data_width = 8; mvm_map_phys_cmd.max_data_width = 64; pr_debug("%s: next table desc: add: %lld, size: %d\n", __func__, *((uint64_t *) memtable), *(((uint32_t *) memtable) + 2)); pr_debug("%s: phy add of of mem being mapped 0x%x, size: %d\n", __func__, *(((uint32_t *) memtable) + 3), *(((uint32_t *) memtable) + 5)); v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_mvm, (uint32_t *) &mvm_map_phys_cmd); if (ret < 0) { pr_err("%s: Error %d sending mvm map phy cmd\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_mem_map_cal_block(struct voice_data *v) { int ret = 0; struct acdb_cal_block cal_block; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } if (common.cal_mem_handle != 0) { pr_debug("%s: Cal block already mem mapped\n", __func__); return ret; } /* Get the physical address of calibration memory block from ACDB. */ get_voice_cal_allocation(&cal_block); if (!cal_block.cal_paddr) { pr_err("%s: Cal block not allocated\n", __func__); return -EINVAL; } ret = voice_map_memory_physical_cmd(v, &common.cal_mem_map_table, cal_block.cal_paddr, cal_block.cal_size, VOC_CAL_MEM_MAP_TOKEN); return ret; } static int voice_pause_voice_call(struct voice_data *v) { struct apr_hdr mvm_pause_voice_cmd; void *apr_mvm; int ret = 0; pr_debug("%s\n", __func__); if (v == NULL) { pr_err("%s: Voice data is NULL\n", __func__); ret = -EINVAL; goto done; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); ret = -EINVAL; goto done; } mvm_pause_voice_cmd.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_pause_voice_cmd.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_pause_voice_cmd) - APR_HDR_SIZE); mvm_pause_voice_cmd.src_port = voice_get_idx_for_session(v->session_id); mvm_pause_voice_cmd.dest_port = voice_get_mvm_handle(v); mvm_pause_voice_cmd.token = 0; mvm_pause_voice_cmd.opcode = VSS_IMVM_CMD_PAUSE_VOICE; v->mvm_state = CMD_STATUS_FAIL; pr_debug("%s: send mvm_pause_voice_cmd pkt size = %d\n", __func__, mvm_pause_voice_cmd.pkt_size); ret = apr_send_pkt(apr_mvm, (uint32_t *)&mvm_pause_voice_cmd); if (ret < 0) { pr_err("Fail in sending VSS_IMVM_CMD_PAUSE_VOICE\n"); ret = -EINVAL; goto done; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); ret = -EINVAL; goto done; } done: return ret; } int voc_unmap_cal_blocks(void) { int result = 0; int result2 = 0; int i; struct voice_data *v = NULL; pr_debug("%s\n", __func__); mutex_lock(&common.common_lock); if (common.cal_mem_handle == 0) goto done; for (i = 0; i < MAX_VOC_SESSIONS; i++) { v = &common.voice[i]; mutex_lock(&v->lock); if (is_voc_state_active(v->voc_state)) { result2 = voice_pause_voice_call(v); if (result2 < 0) { pr_err("%s: voice_pause_voice_call failed for session 0x%x, err %d!\n", __func__, v->session_id, result2); result = result2; } voice_send_cvp_deregister_vol_cal_cmd(v); voice_send_cvp_deregister_cal_cmd(v); voice_send_cvp_deregister_dev_cfg_cmd(v); voice_send_cvs_deregister_cal_cmd(v); result2 = voice_send_start_voice_cmd(v); if (result2) { pr_err("%s: voice_send_start_voice_cmd failed for session 0x%x, err %d!\n", __func__, v->session_id, result2); result = result2; } } if ((common.cal_mem_handle != 0) && (!is_other_session_active(v->session_id))) { result2 = voice_send_mvm_unmap_memory_physical_cmd( v, common.cal_mem_handle); if (result2) { pr_err("%s: voice_send_mvm_unmap_memory_physical_cmd failed for session 0x%x, err %d!\n", __func__, v->session_id, result2); result = result2; } else { common.cal_mem_handle = 0; } } mutex_unlock(&v->lock); } done: mutex_unlock(&common.common_lock); return result; } static int voice_setup_vocproc(struct voice_data *v) { struct cvp_create_full_ctl_session_cmd cvp_session_cmd; int ret = 0; void *apr_cvp; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvp = common.apr_q6_cvp; if (!apr_cvp) { pr_err("%s: apr_cvp is NULL.\n", __func__); return -EINVAL; } /* create cvp session and wait for response */ cvp_session_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_session_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_session_cmd) - APR_HDR_SIZE); pr_debug(" send create cvp session, pkt size = %d\n", cvp_session_cmd.hdr.pkt_size); cvp_session_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_session_cmd.hdr.dest_port = 0; cvp_session_cmd.hdr.token = 0; cvp_session_cmd.hdr.opcode = VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION_V2; voc_get_tx_rx_topology(v, &cvp_session_cmd.cvp_session.tx_topology_id, &cvp_session_cmd.cvp_session.rx_topology_id); cvp_session_cmd.cvp_session.direction = 2; /*tx and rx*/ cvp_session_cmd.cvp_session.tx_port_id = v->dev_tx.port_id; cvp_session_cmd.cvp_session.rx_port_id = v->dev_rx.port_id; cvp_session_cmd.cvp_session.profile_id = VSS_ICOMMON_CAL_NETWORK_ID_NONE; cvp_session_cmd.cvp_session.vocproc_mode = VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING; cvp_session_cmd.cvp_session.ec_ref_port_id = VSS_IVOCPROC_PORT_ID_NONE; pr_debug("tx_topology: %d tx_port_id=%d, rx_port_id=%d, mode: 0x%x\n", cvp_session_cmd.cvp_session.tx_topology_id, cvp_session_cmd.cvp_session.tx_port_id, cvp_session_cmd.cvp_session.rx_port_id, cvp_session_cmd.cvp_session.vocproc_mode); pr_debug("rx_topology: %d, profile_id: 0x%x, pkt_size: %d\n", cvp_session_cmd.cvp_session.rx_topology_id, cvp_session_cmd.cvp_session.profile_id, cvp_session_cmd.hdr.pkt_size); v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvp, (uint32_t *) &cvp_session_cmd); if (ret < 0) { pr_err("Fail in sending VOCPROC_FULL_CONTROL_SESSION\n"); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } voice_send_cvs_register_cal_cmd(v); voice_send_cvp_register_dev_cfg_cmd(v); voice_send_cvp_register_cal_cmd(v); voice_send_cvp_register_vol_cal_cmd(v); /* enable vocproc */ ret = voice_send_enable_vocproc_cmd(v); if (ret < 0) goto fail; /* attach vocproc */ ret = voice_send_attach_vocproc_cmd(v); if (ret < 0) goto fail; /* send tty mode if tty device is used */ voice_send_tty_mode_cmd(v); if (is_voip_session(v->session_id)) { ret = voice_send_mvm_cal_network_cmd(v); if (ret < 0) pr_err("%s: voice_send_mvm_cal_network_cmd: %d\n", __func__, ret); ret = voice_send_mvm_media_type_cmd(v); if (ret < 0) pr_err("%s: voice_send_mvm_media_type_cmd: %d\n", __func__, ret); voice_send_netid_timing_cmd(v); } /* enable slowtalk if st_enable is set */ if (v->st_enable) voice_send_set_pp_enable_cmd(v, MODULE_ID_VOICE_MODULE_ST, v->st_enable); /* Start in-call music delivery if this feature is enabled */ if (v->music_info.play_enable) voice_cvs_start_playback(v); /* Start in-call recording if this feature is enabled */ if (v->rec_info.rec_enable) voice_cvs_start_record(v, v->rec_info.rec_mode); if (v->dtmf_rx_detect_en) voice_send_dtmf_rx_detection_cmd(v, v->dtmf_rx_detect_en); rtac_add_voice(voice_get_cvs_handle(v), voice_get_cvp_handle(v), v->dev_rx.port_id, v->dev_tx.port_id, v->session_id); return 0; fail: return -EINVAL; } static int voice_send_enable_vocproc_cmd(struct voice_data *v) { int ret = 0; struct apr_hdr cvp_enable_cmd; void *apr_cvp; u16 cvp_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvp = common.apr_q6_cvp; if (!apr_cvp) { pr_err("%s: apr_cvp is NULL.\n", __func__); return -EINVAL; } cvp_handle = voice_get_cvp_handle(v); /* enable vocproc and wait for respose */ cvp_enable_cmd.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_enable_cmd.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_enable_cmd) - APR_HDR_SIZE); pr_debug("cvp_enable_cmd pkt size = %d, cvp_handle=%d\n", cvp_enable_cmd.pkt_size, cvp_handle); cvp_enable_cmd.src_port = voice_get_idx_for_session(v->session_id); cvp_enable_cmd.dest_port = cvp_handle; cvp_enable_cmd.token = 0; cvp_enable_cmd.opcode = VSS_IVOCPROC_CMD_ENABLE; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvp, (uint32_t *) &cvp_enable_cmd); if (ret < 0) { pr_err("Fail in sending VSS_IVOCPROC_CMD_ENABLE\n"); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_mvm_cal_network_cmd(struct voice_data *v) { struct vss_imvm_cmd_set_cal_network_t mvm_set_cal_network; int ret = 0; void *apr_mvm; u16 mvm_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); mvm_set_cal_network.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_set_cal_network.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_set_cal_network) - APR_HDR_SIZE); mvm_set_cal_network.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_set_cal_network.hdr.dest_port = mvm_handle; mvm_set_cal_network.hdr.token = 0; mvm_set_cal_network.hdr.opcode = VSS_IMVM_CMD_SET_CAL_NETWORK; mvm_set_cal_network.network_id = VSS_ICOMMON_CAL_NETWORK_ID_NONE; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_set_cal_network); if (ret < 0) { pr_err("%s: Error %d sending SET_NETWORK\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout %d\n", __func__, ret); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_netid_timing_cmd(struct voice_data *v) { int ret = 0; void *apr_mvm; u16 mvm_handle; struct mvm_set_network_cmd mvm_set_network; struct mvm_set_voice_timing_cmd mvm_set_voice_timing; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); ret = voice_config_cvs_vocoder(v); if (ret < 0) { pr_err("%s: Error %d configuring CVS voc", __func__, ret); goto fail; } /* Set network ID. */ pr_debug("Setting network ID\n"); mvm_set_network.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_set_network.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_set_network) - APR_HDR_SIZE); mvm_set_network.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_set_network.hdr.dest_port = mvm_handle; mvm_set_network.hdr.token = 0; mvm_set_network.hdr.opcode = VSS_ICOMMON_CMD_SET_NETWORK; mvm_set_network.network.network_id = common.mvs_info.network_type; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_set_network); if (ret < 0) { pr_err("%s: Error %d sending SET_NETWORK\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } /* Set voice timing. */ pr_debug("Setting voice timing\n"); mvm_set_voice_timing.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_set_voice_timing.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_set_voice_timing) - APR_HDR_SIZE); mvm_set_voice_timing.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_set_voice_timing.hdr.dest_port = mvm_handle; mvm_set_voice_timing.hdr.token = 0; mvm_set_voice_timing.hdr.opcode = VSS_ICOMMON_CMD_SET_VOICE_TIMING; mvm_set_voice_timing.timing.mode = 0; mvm_set_voice_timing.timing.enc_offset = 8000; mvm_set_voice_timing.timing.dec_req_offset = 3300; mvm_set_voice_timing.timing.dec_offset = 8300; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_set_voice_timing); if (ret < 0) { pr_err("%s: Error %d sending SET_TIMING\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_attach_vocproc_cmd(struct voice_data *v) { int ret = 0; struct mvm_attach_vocproc_cmd mvm_a_vocproc_cmd; void *apr_mvm; u16 mvm_handle, cvp_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); cvp_handle = voice_get_cvp_handle(v); /* attach vocproc and wait for response */ mvm_a_vocproc_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_a_vocproc_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_a_vocproc_cmd) - APR_HDR_SIZE); pr_debug("send mvm_a_vocproc_cmd pkt size = %d\n", mvm_a_vocproc_cmd.hdr.pkt_size); mvm_a_vocproc_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_a_vocproc_cmd.hdr.dest_port = mvm_handle; mvm_a_vocproc_cmd.hdr.token = 0; mvm_a_vocproc_cmd.hdr.opcode = VSS_IMVM_CMD_ATTACH_VOCPROC; mvm_a_vocproc_cmd.mvm_attach_cvp_handle.handle = cvp_handle; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_a_vocproc_cmd); if (ret < 0) { pr_err("Fail in sending VSS_IMVM_CMD_ATTACH_VOCPROC\n"); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_destroy_vocproc(struct voice_data *v) { struct mvm_detach_vocproc_cmd mvm_d_vocproc_cmd; struct apr_hdr cvp_destroy_session_cmd; int ret = 0; void *apr_mvm, *apr_cvp; u16 mvm_handle, cvp_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; apr_cvp = common.apr_q6_cvp; if (!apr_mvm || !apr_cvp) { pr_err("%s: apr_mvm or apr_cvp is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); cvp_handle = voice_get_cvp_handle(v); /* stop playback or recording */ v->music_info.force = 1; voice_cvs_stop_playback(v); voice_cvs_stop_record(v); /* send stop voice cmd */ voice_send_stop_voice_cmd(v); /* send stop dtmf detecton cmd */ if (v->dtmf_rx_detect_en) voice_send_dtmf_rx_detection_cmd(v, 0); /* reset LCH mode */ v->lch_mode = 0; /* clear mute setting */ v->dev_rx.dev_mute = common.default_mute_val; v->dev_tx.dev_mute = common.default_mute_val; v->stream_rx.stream_mute = common.default_mute_val; v->stream_tx.stream_mute = common.default_mute_val; /* detach VOCPROC and wait for response from mvm */ mvm_d_vocproc_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_d_vocproc_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_d_vocproc_cmd) - APR_HDR_SIZE); pr_debug("mvm_d_vocproc_cmd pkt size = %d\n", mvm_d_vocproc_cmd.hdr.pkt_size); mvm_d_vocproc_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); mvm_d_vocproc_cmd.hdr.dest_port = mvm_handle; mvm_d_vocproc_cmd.hdr.token = 0; mvm_d_vocproc_cmd.hdr.opcode = VSS_IMVM_CMD_DETACH_VOCPROC; mvm_d_vocproc_cmd.mvm_detach_cvp_handle.handle = cvp_handle; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mvm_d_vocproc_cmd); if (ret < 0) { pr_err("Fail in sending VSS_IMVM_CMD_DETACH_VOCPROC\n"); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } voice_send_cvp_deregister_vol_cal_cmd(v); voice_send_cvp_deregister_cal_cmd(v); voice_send_cvp_deregister_dev_cfg_cmd(v); voice_send_cvs_deregister_cal_cmd(v); /* destrop cvp session */ cvp_destroy_session_cmd.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_destroy_session_cmd.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_destroy_session_cmd) - APR_HDR_SIZE); pr_debug("cvp_destroy_session_cmd pkt size = %d\n", cvp_destroy_session_cmd.pkt_size); cvp_destroy_session_cmd.src_port = voice_get_idx_for_session(v->session_id); cvp_destroy_session_cmd.dest_port = cvp_handle; cvp_destroy_session_cmd.token = 0; cvp_destroy_session_cmd.opcode = APRV2_IBASIC_CMD_DESTROY_SESSION; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvp, (uint32_t *) &cvp_destroy_session_cmd); if (ret < 0) { pr_err("Fail in sending APRV2_IBASIC_CMD_DESTROY_SESSION\n"); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } rtac_remove_voice(voice_get_cvs_handle(v)); cvp_handle = 0; voice_set_cvp_handle(v, cvp_handle); return 0; fail: return -EINVAL; } static int voice_send_mvm_unmap_memory_physical_cmd(struct voice_data *v, uint32_t mem_handle) { struct vss_imemory_cmd_unmap_t mem_unmap; int ret = 0; void *apr_mvm; u16 mvm_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); return -EINVAL; } mvm_handle = voice_get_mvm_handle(v); mem_unmap.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mem_unmap.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mem_unmap) - APR_HDR_SIZE); mem_unmap.hdr.src_port = voice_get_idx_for_session(v->session_id); mem_unmap.hdr.dest_port = mvm_handle; mem_unmap.hdr.token = 0; mem_unmap.hdr.opcode = VSS_IMEMORY_CMD_UNMAP; mem_unmap.mem_handle = mem_handle; pr_debug("%s: mem_handle: ox%x\n", __func__, mem_unmap.mem_handle); v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *) &mem_unmap); if (ret < 0) { pr_err("mem_unmap op[0x%x]ret[%d]\n", mem_unmap.hdr.opcode, ret); goto fail; } ret = wait_event_timeout(v->mvm_wait, (v->mvm_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout %d\n", __func__, ret); goto fail; } return 0; fail: return ret; } static int voice_send_cvs_packet_exchange_config_cmd(struct voice_data *v) { struct vss_istream_cmd_set_oob_packet_exchange_config_t packet_exchange_config_pkt; int ret = 0; uint64_t *dec_buf; uint64_t *enc_buf; void *apr_cvs; u16 cvs_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } dec_buf = (uint64_t *)v->shmem_info.sh_buf.buf[0].phys; enc_buf = (uint64_t *)v->shmem_info.sh_buf.buf[1].phys; apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); packet_exchange_config_pkt.hdr.hdr_field = APR_HDR_FIELD( APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); packet_exchange_config_pkt.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(packet_exchange_config_pkt) - APR_HDR_SIZE); packet_exchange_config_pkt.hdr.src_port = voice_get_idx_for_session(v->session_id); packet_exchange_config_pkt.hdr.dest_port = cvs_handle; packet_exchange_config_pkt.hdr.token = 0; packet_exchange_config_pkt.hdr.opcode = VSS_ISTREAM_CMD_SET_OOB_PACKET_EXCHANGE_CONFIG; packet_exchange_config_pkt.mem_handle = v->shmem_info.mem_handle; packet_exchange_config_pkt.dec_buf_addr = (uint32_t)dec_buf; packet_exchange_config_pkt.dec_buf_size = 4096; packet_exchange_config_pkt.enc_buf_addr = (uint32_t)enc_buf; packet_exchange_config_pkt.enc_buf_size = 4096; pr_debug("%s: dec buf: add %p, size %d, enc buf: add %p, size %d\n", __func__, dec_buf, packet_exchange_config_pkt.dec_buf_size, enc_buf, packet_exchange_config_pkt.enc_buf_size); v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &packet_exchange_config_pkt); if (ret < 0) { pr_err("Failed to send packet exchange config cmd %d\n", ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) pr_err("%s: wait_event timeout %d\n", __func__, ret); return 0; fail: return -EINVAL; } static int voice_send_cvs_data_exchange_mode_cmd(struct voice_data *v) { struct vss_istream_cmd_set_packet_exchange_mode_t data_exchange_pkt; int ret = 0; void *apr_cvs; u16 cvs_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); data_exchange_pkt.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); data_exchange_pkt.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(data_exchange_pkt) - APR_HDR_SIZE); data_exchange_pkt.hdr.src_port = voice_get_idx_for_session(v->session_id); data_exchange_pkt.hdr.dest_port = cvs_handle; data_exchange_pkt.hdr.token = 0; data_exchange_pkt.hdr.opcode = VSS_ISTREAM_CMD_SET_PACKET_EXCHANGE_MODE; data_exchange_pkt.mode = VSS_ISTREAM_PACKET_EXCHANGE_MODE_OUT_OF_BAND; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &data_exchange_pkt); if (ret < 0) { pr_err("Failed to send data exchange mode %d\n", ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) pr_err("%s: wait_event timeout %d\n", __func__, ret); return 0; fail: return -EINVAL; } static int voice_send_stream_mute_cmd(struct voice_data *v) { struct cvs_set_mute_cmd cvs_mute_cmd; int ret = 0; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); goto fail; } /* send mute/unmute to cvs */ cvs_mute_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_mute_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_mute_cmd) - APR_HDR_SIZE); cvs_mute_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_mute_cmd.hdr.dest_port = voice_get_cvs_handle(v); cvs_mute_cmd.hdr.token = 0; cvs_mute_cmd.hdr.opcode = VSS_IVOLUME_CMD_MUTE_V2; cvs_mute_cmd.cvs_set_mute.direction = VSS_IVOLUME_DIRECTION_TX; cvs_mute_cmd.cvs_set_mute.mute_flag = v->stream_tx.stream_mute; cvs_mute_cmd.cvs_set_mute.ramp_duration_ms = DEFAULT_MUTE_RAMP_DURATION; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvs, (uint32_t *) &cvs_mute_cmd); if (ret < 0) { pr_err("%s: Error %d sending stream mute\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_device_mute_cmd(struct voice_data *v, uint16_t direction, uint16_t mute_flag) { struct cvp_set_mute_cmd cvp_mute_cmd; int ret = 0; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); goto fail; } if (!common.apr_q6_cvp) { pr_err("%s: apr_cvp is NULL.\n", __func__); goto fail; } cvp_mute_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_mute_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_mute_cmd) - APR_HDR_SIZE); cvp_mute_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_mute_cmd.hdr.dest_port = voice_get_cvp_handle(v); cvp_mute_cmd.hdr.token = 0; cvp_mute_cmd.hdr.opcode = VSS_IVOLUME_CMD_MUTE_V2; cvp_mute_cmd.cvp_set_mute.direction = direction; cvp_mute_cmd.cvp_set_mute.mute_flag = mute_flag; cvp_mute_cmd.cvp_set_mute.ramp_duration_ms = DEFAULT_MUTE_RAMP_DURATION; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(common.apr_q6_cvp, (uint32_t *) &cvp_mute_cmd); if (ret < 0) { pr_err("%s: Error %d sending rx device cmd\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: Command timeout\n", __func__); goto fail; } return 0; fail: return -EINVAL; } static int voice_send_vol_index_cmd(struct voice_data *v) { struct cvp_set_rx_volume_index_cmd cvp_vol_cmd; int ret = 0; void *apr_cvp; u16 cvp_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvp = common.apr_q6_cvp; if (!apr_cvp) { pr_err("%s: apr_cvp is NULL.\n", __func__); return -EINVAL; } cvp_handle = voice_get_cvp_handle(v); /* send volume index to cvp */ cvp_vol_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvp_vol_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvp_vol_cmd) - APR_HDR_SIZE); cvp_vol_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); cvp_vol_cmd.hdr.dest_port = cvp_handle; cvp_vol_cmd.hdr.token = 0; cvp_vol_cmd.hdr.opcode = VSS_IVOCPROC_CMD_SET_RX_VOLUME_INDEX; cvp_vol_cmd.cvp_set_vol_idx.vol_index = v->dev_rx.volume; v->cvp_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvp, (uint32_t *) &cvp_vol_cmd); if (ret < 0) { pr_err("Fail in sending RX VOL INDEX\n"); return -EINVAL; } ret = wait_event_timeout(v->cvp_wait, (v->cvp_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); return -EINVAL; } return 0; } static int voice_cvs_start_record(struct voice_data *v, uint32_t rec_mode) { int ret = 0; void *apr_cvs; u16 cvs_handle; struct cvs_start_record_cmd cvs_start_record; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); if (!v->rec_info.recording) { cvs_start_record.hdr.hdr_field = APR_HDR_FIELD( APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_start_record.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_start_record) - APR_HDR_SIZE); cvs_start_record.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_start_record.hdr.dest_port = cvs_handle; cvs_start_record.hdr.token = 0; cvs_start_record.hdr.opcode = VSS_IRECORD_CMD_START; cvs_start_record.rec_mode.port_id = VSS_IRECORD_PORT_ID_DEFAULT; if (rec_mode == VOC_REC_UPLINK) { cvs_start_record.rec_mode.rx_tap_point = VSS_IRECORD_TAP_POINT_NONE; cvs_start_record.rec_mode.tx_tap_point = VSS_IRECORD_TAP_POINT_STREAM_END; } else if (rec_mode == VOC_REC_DOWNLINK) { cvs_start_record.rec_mode.rx_tap_point = VSS_IRECORD_TAP_POINT_STREAM_END; cvs_start_record.rec_mode.tx_tap_point = VSS_IRECORD_TAP_POINT_NONE; } else if (rec_mode == VOC_REC_BOTH) { cvs_start_record.rec_mode.rx_tap_point = VSS_IRECORD_TAP_POINT_STREAM_END; cvs_start_record.rec_mode.tx_tap_point = VSS_IRECORD_TAP_POINT_STREAM_END; } else { pr_err("%s: Invalid in-call rec_mode %d\n", __func__, rec_mode); ret = -EINVAL; goto fail; } v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_start_record); if (ret < 0) { pr_err("%s: Error %d sending START_RECORD\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } v->rec_info.recording = 1; } else { pr_debug("%s: Start record already sent\n", __func__); } return 0; fail: return ret; } static int voice_cvs_stop_record(struct voice_data *v) { int ret = 0; void *apr_cvs; u16 cvs_handle; struct apr_hdr cvs_stop_record; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); if (v->rec_info.recording) { cvs_stop_record.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_stop_record.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_stop_record) - APR_HDR_SIZE); cvs_stop_record.src_port = voice_get_idx_for_session(v->session_id); cvs_stop_record.dest_port = cvs_handle; cvs_stop_record.token = 0; cvs_stop_record.opcode = VSS_IRECORD_CMD_STOP; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_stop_record); if (ret < 0) { pr_err("%s: Error %d sending STOP_RECORD\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } v->rec_info.recording = 0; } else { pr_debug("%s: Stop record already sent\n", __func__); } return 0; fail: return ret; } int voc_start_record(uint32_t port_id, uint32_t set) { int ret = 0; int rec_mode = 0; u16 cvs_handle; int i, rec_set = 0; for (i = 0; i < MAX_VOC_SESSIONS; i++) { struct voice_data *v = &common.voice[i]; pr_debug("%s: i:%d port_id: %d, set: %d\n", __func__, i, port_id, set); mutex_lock(&v->lock); rec_mode = v->rec_info.rec_mode; rec_set = set; if (set) { if ((v->rec_route_state.ul_flag != 0) && (v->rec_route_state.dl_flag != 0)) { pr_debug("%s: i=%d, rec mode already set.\n", __func__, i); mutex_unlock(&v->lock); if (i < MAX_VOC_SESSIONS) continue; else return 0; } if (port_id == VOICE_RECORD_TX) { if ((v->rec_route_state.ul_flag == 0) && (v->rec_route_state.dl_flag == 0)) { rec_mode = VOC_REC_UPLINK; v->rec_route_state.ul_flag = 1; } else if ((v->rec_route_state.ul_flag == 0) && (v->rec_route_state.dl_flag != 0)) { voice_cvs_stop_record(v); rec_mode = VOC_REC_BOTH; v->rec_route_state.ul_flag = 1; } } else if (port_id == VOICE_RECORD_RX) { if ((v->rec_route_state.ul_flag == 0) && (v->rec_route_state.dl_flag == 0)) { rec_mode = VOC_REC_DOWNLINK; v->rec_route_state.dl_flag = 1; } else if ((v->rec_route_state.ul_flag != 0) && (v->rec_route_state.dl_flag == 0)) { voice_cvs_stop_record(v); rec_mode = VOC_REC_BOTH; v->rec_route_state.dl_flag = 1; } } rec_set = 1; } else { if ((v->rec_route_state.ul_flag == 0) && (v->rec_route_state.dl_flag == 0)) { pr_debug("%s: i=%d, rec already stops.\n", __func__, i); mutex_unlock(&v->lock); if (i < MAX_VOC_SESSIONS) continue; else return 0; } if (port_id == VOICE_RECORD_TX) { if ((v->rec_route_state.ul_flag != 0) && (v->rec_route_state.dl_flag == 0)) { v->rec_route_state.ul_flag = 0; rec_set = 0; } else if ((v->rec_route_state.ul_flag != 0) && (v->rec_route_state.dl_flag != 0)) { voice_cvs_stop_record(v); v->rec_route_state.ul_flag = 0; rec_mode = VOC_REC_DOWNLINK; rec_set = 1; } } else if (port_id == VOICE_RECORD_RX) { if ((v->rec_route_state.ul_flag == 0) && (v->rec_route_state.dl_flag != 0)) { v->rec_route_state.dl_flag = 0; rec_set = 0; } else if ((v->rec_route_state.ul_flag != 0) && (v->rec_route_state.dl_flag != 0)) { voice_cvs_stop_record(v); v->rec_route_state.dl_flag = 0; rec_mode = VOC_REC_UPLINK; rec_set = 1; } } } pr_debug("%s: i=%d, mode =%d, set =%d\n", __func__, i, rec_mode, rec_set); cvs_handle = voice_get_cvs_handle(v); if (cvs_handle != 0) { if (rec_set) ret = voice_cvs_start_record(v, rec_mode); else ret = voice_cvs_stop_record(v); } /* Cache the value */ v->rec_info.rec_enable = rec_set; v->rec_info.rec_mode = rec_mode; mutex_unlock(&v->lock); } return ret; } static int voice_cvs_start_playback(struct voice_data *v) { int ret = 0; struct cvs_start_playback_cmd cvs_start_playback; void *apr_cvs; u16 cvs_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); if (!v->music_info.playing && v->music_info.count) { cvs_start_playback.hdr.hdr_field = APR_HDR_FIELD( APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_start_playback.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_start_playback) - APR_HDR_SIZE); cvs_start_playback.hdr.src_port = voice_get_idx_for_session(v->session_id); cvs_start_playback.hdr.dest_port = cvs_handle; cvs_start_playback.hdr.token = 0; cvs_start_playback.hdr.opcode = VSS_IPLAYBACK_CMD_START; cvs_start_playback.playback_mode.port_id = VSS_IPLAYBACK_PORT_ID_DEFAULT; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_start_playback); if (ret < 0) { pr_err("%s: Error %d sending START_PLAYBACK\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } v->music_info.playing = 1; } else { pr_debug("%s: Start playback already sent\n", __func__); } return 0; fail: return ret; } static int voice_cvs_stop_playback(struct voice_data *v) { int ret = 0; struct apr_hdr cvs_stop_playback; void *apr_cvs; u16 cvs_handle; if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL.\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); if (v->music_info.playing && ((!v->music_info.count) || (v->music_info.force))) { cvs_stop_playback.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); cvs_stop_playback.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(cvs_stop_playback) - APR_HDR_SIZE); cvs_stop_playback.src_port = voice_get_idx_for_session(v->session_id); cvs_stop_playback.dest_port = cvs_handle; cvs_stop_playback.token = 0; cvs_stop_playback.opcode = VSS_IPLAYBACK_CMD_STOP; v->cvs_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_cvs, (uint32_t *) &cvs_stop_playback); if (ret < 0) { pr_err("%s: Error %d sending STOP_PLAYBACK\n", __func__, ret); goto fail; } ret = wait_event_timeout(v->cvs_wait, (v->cvs_state == CMD_STATUS_SUCCESS), msecs_to_jiffies(TIMEOUT_MS)); if (!ret) { pr_err("%s: wait_event timeout\n", __func__); goto fail; } v->music_info.playing = 0; v->music_info.force = 0; } else { pr_debug("%s: Stop playback already sent\n", __func__); } return 0; fail: return ret; } int voc_start_playback(uint32_t set) { int ret = 0; u16 cvs_handle; int i; for (i = 0; i < MAX_VOC_SESSIONS; i++) { struct voice_data *v = &common.voice[i]; mutex_lock(&v->lock); v->music_info.play_enable = set; if (set) v->music_info.count++; else v->music_info.count--; pr_debug("%s: music_info count =%d\n", __func__, v->music_info.count); cvs_handle = voice_get_cvs_handle(v); if (cvs_handle != 0) { if (set) ret = voice_cvs_start_playback(v); else ret = voice_cvs_stop_playback(v); } mutex_unlock(&v->lock); } return ret; } int voc_disable_cvp(uint32_t session_id) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); if (v->voc_state == VOC_RUN) { rtac_remove_voice(voice_get_cvs_handle(v)); /* send cmd to dsp to disable vocproc */ ret = voice_send_disable_vocproc_cmd(v); if (ret < 0) { pr_err("%s: disable vocproc failed\n", __func__); goto fail; } voice_send_cvp_deregister_vol_cal_cmd(v); voice_send_cvp_deregister_cal_cmd(v); voice_send_cvp_deregister_dev_cfg_cmd(v); v->voc_state = VOC_CHANGE; } fail: mutex_unlock(&v->lock); return ret; } int voc_enable_cvp(uint32_t session_id) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: Invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); if (v->voc_state == VOC_CHANGE) { ret = voice_send_set_device_cmd(v); if (ret < 0) { pr_err("%s: Set device failed\n", __func__); goto fail; } voice_send_cvp_register_dev_cfg_cmd(v); voice_send_cvp_register_cal_cmd(v); voice_send_cvp_register_vol_cal_cmd(v); if (v->lch_mode == VOICE_LCH_START) { pr_debug("%s: TX and RX mute ON\n", __func__); voice_send_device_mute_cmd(v, VSS_IVOLUME_DIRECTION_TX, VSS_IVOLUME_MUTE_ON); voice_send_device_mute_cmd(v, VSS_IVOLUME_DIRECTION_RX, VSS_IVOLUME_MUTE_ON); } else if (v->lch_mode == VOICE_LCH_STOP) { pr_debug("%s: TX and RX mute OFF\n", __func__); voice_send_device_mute_cmd(v, VSS_IVOLUME_DIRECTION_TX, VSS_IVOLUME_MUTE_OFF); voice_send_device_mute_cmd(v, VSS_IVOLUME_DIRECTION_RX, VSS_IVOLUME_MUTE_OFF); /* Reset lch mode when VOICE_LCH_STOP is recieved */ v->lch_mode = 0; } else { pr_debug("%s: Mute commands not sent for lch_mode=%d\n", __func__, v->lch_mode); } ret = voice_send_enable_vocproc_cmd(v); if (ret < 0) { pr_err("%s: Enable vocproc failed %d\n", __func__, ret); goto fail; } /* Send tty mode if tty device is used */ voice_send_tty_mode_cmd(v); /* enable slowtalk */ if (v->st_enable) voice_send_set_pp_enable_cmd(v, MODULE_ID_VOICE_MODULE_ST, v->st_enable); rtac_add_voice(voice_get_cvs_handle(v), voice_get_cvp_handle(v), v->dev_rx.port_id, v->dev_tx.port_id, v->session_id); v->voc_state = VOC_RUN; } fail: mutex_unlock(&v->lock); return ret; } static int voice_set_packet_exchange_mode_and_config(uint32_t session_id, uint32_t mode) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } if (v->voc_state != VOC_RUN) ret = voice_send_cvs_data_exchange_mode_cmd(v); if (ret) { pr_err("%s: Error voice_send_data_exchange_mode_cmd %d\n", __func__, ret); goto fail; } ret = voice_send_cvs_packet_exchange_config_cmd(v); if (ret) { pr_err("%s: Error: voice_send_packet_exchange_config_cmd %d\n", __func__, ret); goto fail; } return ret; fail: return -EINVAL; } int voc_set_tx_mute(uint32_t session_id, uint32_t dir, uint32_t mute) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); v->stream_tx.stream_mute = mute; if ((v->voc_state == VOC_RUN) || (v->voc_state == VOC_CHANGE) || (v->voc_state == VOC_STANDBY)) ret = voice_send_stream_mute_cmd(v); mutex_unlock(&v->lock); return ret; } int voc_set_rx_device_mute(uint32_t session_id, uint32_t mute) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); v->dev_rx.dev_mute = mute; if (v->voc_state == VOC_RUN) ret = voice_send_device_mute_cmd(v, VSS_IVOLUME_DIRECTION_RX, v->dev_rx.dev_mute); mutex_unlock(&v->lock); return ret; } int voc_get_rx_device_mute(uint32_t session_id) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); ret = v->dev_rx.dev_mute; mutex_unlock(&v->lock); return ret; } int voc_set_tty_mode(uint32_t session_id, uint8_t tty_mode) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); v->tty_mode = tty_mode; mutex_unlock(&v->lock); return ret; } uint8_t voc_get_tty_mode(uint32_t session_id) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); ret = v->tty_mode; mutex_unlock(&v->lock); return ret; } int voc_set_pp_enable(uint32_t session_id, uint32_t module_id, uint32_t enable) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); if (module_id == MODULE_ID_VOICE_MODULE_ST) v->st_enable = enable; if (v->voc_state == VOC_RUN) { if (module_id == MODULE_ID_VOICE_MODULE_ST) ret = voice_send_set_pp_enable_cmd(v, MODULE_ID_VOICE_MODULE_ST, enable); } mutex_unlock(&v->lock); return ret; } int voc_get_pp_enable(uint32_t session_id, uint32_t module_id) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); if (module_id == MODULE_ID_VOICE_MODULE_ST) ret = v->st_enable; mutex_unlock(&v->lock); return ret; } int voc_set_rx_vol_index(uint32_t session_id, uint32_t dir, uint32_t vol_idx) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); v->dev_rx.volume = vol_idx; if ((v->voc_state == VOC_RUN) || (v->voc_state == VOC_CHANGE) || (v->voc_state == VOC_STANDBY)) ret = voice_send_vol_index_cmd(v); mutex_unlock(&v->lock); return ret; } int voc_set_rxtx_port(uint32_t session_id, uint32_t port_id, uint32_t dev_type) { struct voice_data *v = voice_get_session(session_id); if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } pr_debug("%s: port_id=%d, type=%d\n", __func__, port_id, dev_type); mutex_lock(&v->lock); if (dev_type == DEV_RX) v->dev_rx.port_id = q6audio_get_port_id(port_id); else v->dev_tx.port_id = q6audio_get_port_id(port_id); mutex_unlock(&v->lock); return 0; } int voc_set_route_flag(uint32_t session_id, uint8_t path_dir, uint8_t set) { struct voice_data *v = voice_get_session(session_id); if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } pr_debug("%s: path_dir=%d, set=%d\n", __func__, path_dir, set); mutex_lock(&v->lock); if (path_dir == RX_PATH) v->voc_route_state.rx_route_flag = set; else v->voc_route_state.tx_route_flag = set; mutex_unlock(&v->lock); return 0; } uint8_t voc_get_route_flag(uint32_t session_id, uint8_t path_dir) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return 0; } mutex_lock(&v->lock); if (path_dir == RX_PATH) ret = v->voc_route_state.rx_route_flag; else ret = v->voc_route_state.tx_route_flag; mutex_unlock(&v->lock); return ret; } int voc_end_voice_call(uint32_t session_id) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); if (v->voc_state == VOC_RUN || v->voc_state == VOC_ERROR || v->voc_state == VOC_CHANGE || v->voc_state == VOC_STANDBY) { pr_debug("%s: VOC_STATE: %d\n", __func__, v->voc_state); ret = voice_destroy_vocproc(v); if (ret < 0) pr_err("%s: destroy voice failed\n", __func__); voice_destroy_mvm_cvs_session(v); v->voc_state = VOC_RELEASE; } else { pr_err("%s: Error: End voice called in state %d\n", __func__, v->voc_state); ret = -EINVAL; } mutex_unlock(&v->lock); return ret; } int voc_standby_voice_call(uint32_t session_id) { struct voice_data *v = voice_get_session(session_id); struct apr_hdr mvm_standby_voice_cmd; void *apr_mvm; u16 mvm_handle; int ret = 0; pr_debug("%s: voc state=%d", __func__, v->voc_state); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } if (v->voc_state == VOC_RUN) { apr_mvm = common.apr_q6_mvm; if (!apr_mvm) { pr_err("%s: apr_mvm is NULL.\n", __func__); ret = -EINVAL; goto fail; } mvm_handle = voice_get_mvm_handle(v); mvm_standby_voice_cmd.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); mvm_standby_voice_cmd.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(mvm_standby_voice_cmd) - APR_HDR_SIZE); pr_debug("send mvm_standby_voice_cmd pkt size = %d\n", mvm_standby_voice_cmd.pkt_size); mvm_standby_voice_cmd.src_port = voice_get_idx_for_session(v->session_id); mvm_standby_voice_cmd.dest_port = mvm_handle; mvm_standby_voice_cmd.token = 0; mvm_standby_voice_cmd.opcode = VSS_IMVM_CMD_STANDBY_VOICE; v->mvm_state = CMD_STATUS_FAIL; ret = apr_send_pkt(apr_mvm, (uint32_t *)&mvm_standby_voice_cmd); if (ret < 0) { pr_err("Fail in sending VSS_IMVM_CMD_STANDBY_VOICE\n"); ret = -EINVAL; goto fail; } v->voc_state = VOC_STANDBY; } fail: return ret; } int voc_set_lch(uint32_t session_id, enum voice_lch_mode lch_mode) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: Invalid session_id 0x%x\n", __func__, session_id); ret = -EINVAL; goto done; } mutex_lock(&v->lock); if (v->lch_mode == lch_mode) { pr_debug("%s: Session %d already in LCH mode %d\n", __func__, session_id, lch_mode); mutex_unlock(&v->lock); goto done; } v->lch_mode = lch_mode; mutex_unlock(&v->lock); ret = voc_disable_cvp(session_id); if (ret < 0) { pr_err("%s: voc_disable_cvp failed ret=%d\n", __func__, ret); goto done; } /* Mute and topology_none will be set as part of voc_enable_cvp() */ ret = voc_enable_cvp(session_id); if (ret < 0) { pr_err("%s: voc_enable_cvp failed ret=%d\n", __func__, ret); goto done; } done: return ret; } int voc_resume_voice_call(uint32_t session_id) { struct voice_data *v = voice_get_session(session_id); int ret = 0; ret = voice_send_start_voice_cmd(v); if (ret < 0) { pr_err("Fail in sending START_VOICE\n"); goto fail; } v->voc_state = VOC_RUN; return 0; fail: return -EINVAL; } int voc_start_voice_call(uint32_t session_id) { struct voice_data *v = voice_get_session(session_id); int ret = 0; if (v == NULL) { pr_err("%s: invalid session_id 0x%x\n", __func__, session_id); return -EINVAL; } mutex_lock(&v->lock); if (v->voc_state == VOC_ERROR) { pr_debug("%s: VOC in ERR state\n", __func__); voice_destroy_mvm_cvs_session(v); v->voc_state = VOC_INIT; } if ((v->voc_state == VOC_INIT) || (v->voc_state == VOC_RELEASE)) { ret = voice_apr_register(); if (ret < 0) { pr_err("%s: apr register failed\n", __func__); goto fail; } ret = voice_create_mvm_cvs_session(v); if (ret < 0) { pr_err("create mvm and cvs failed\n"); goto fail; } /* Memory map the calibration memory block. */ ret = voice_mem_map_cal_block(v); if (ret < 0) { pr_err("%s: Memory map of cal block failed %d\n", __func__, ret); /* Allow call to continue, call quality will be bad. */ } if (is_voip_session(session_id)) { ret = voice_map_memory_physical_cmd(v, &v->shmem_info.memtbl, v->shmem_info.sh_buf.buf[0].phys, v->shmem_info.sh_buf.buf[0].size * NUM_OF_BUFFERS, VOIP_MEM_MAP_TOKEN); if (ret) { pr_err("%s: mvm_map_memory_phy failed %d\n", __func__, ret); goto fail; } ret = voice_set_packet_exchange_mode_and_config( session_id, VSS_ISTREAM_PACKET_EXCHANGE_MODE_OUT_OF_BAND); if (ret) { pr_err("%s: Err: exchange_mode_and_config %d\n", __func__, ret); goto fail; } } ret = voice_send_dual_control_cmd(v); if (ret < 0) { pr_err("Err Dual command failed\n"); goto fail; } ret = voice_setup_vocproc(v); if (ret < 0) { pr_err("setup voice failed\n"); goto fail; } ret = voice_send_vol_index_cmd(v); if (ret < 0) pr_err("voice volume failed\n"); ret = voice_send_stream_mute_cmd(v); if (ret < 0) pr_err("voice mute failed\n"); ret = voice_send_start_voice_cmd(v); if (ret < 0) { pr_err("start voice failed\n"); goto fail; } v->voc_state = VOC_RUN; } else { pr_err("%s: Error: Start voice called in state %d\n", __func__, v->voc_state); ret = -EINVAL; goto fail; } fail: mutex_unlock(&v->lock); return ret; } void voc_register_mvs_cb(ul_cb_fn ul_cb, dl_cb_fn dl_cb, void *private_data) { common.mvs_info.ul_cb = ul_cb; common.mvs_info.dl_cb = dl_cb; common.mvs_info.private_data = private_data; } void voc_register_dtmf_rx_detection_cb(dtmf_rx_det_cb_fn dtmf_rx_ul_cb, void *private_data) { common.dtmf_info.dtmf_rx_ul_cb = dtmf_rx_ul_cb; common.dtmf_info.private_data = private_data; } void voc_config_vocoder(uint32_t media_type, uint32_t rate, uint32_t network_type, uint32_t dtx_mode) { common.mvs_info.media_type = media_type; common.mvs_info.rate = rate; common.mvs_info.network_type = network_type; common.mvs_info.dtx_mode = dtx_mode; } static int32_t qdsp_mvm_callback(struct apr_client_data *data, void *priv) { uint32_t *ptr = NULL; struct common_data *c = NULL; struct voice_data *v = NULL; int i = 0; if ((data == NULL) || (priv == NULL)) { pr_err("%s: data or priv is NULL\n", __func__); return -EINVAL; } c = priv; pr_debug("%s: Payload Length = %d, opcode=%x\n", __func__, data->payload_size, data->opcode); if (data->opcode == RESET_EVENTS) { if (data->reset_proc == APR_DEST_MODEM) { pr_debug("%s: Received MODEM reset event\n", __func__); } else { pr_debug("%s: Reset event received in Voice service\n", __func__); apr_reset(c->apr_q6_mvm); c->apr_q6_mvm = NULL; /* clean up memory handle */ c->cal_mem_handle = 0; /* Sub-system restart is applicable to all sessions. */ for (i = 0; i < MAX_VOC_SESSIONS; i++) { c->voice[i].mvm_handle = 0; c->voice[i].shmem_info.mem_handle = 0; } } voc_set_error_state(data->reset_proc); return 0; } pr_debug("%s: session_id 0x%x\n", __func__, data->dest_port); v = voice_get_session_by_idx(data->dest_port); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } if (data->opcode == APR_BASIC_RSP_RESULT) { if (data->payload_size) { ptr = data->payload; pr_debug("%x %x\n", ptr[0], ptr[1]); /* ping mvm service ACK */ switch (ptr[0]) { case VSS_IMVM_CMD_CREATE_PASSIVE_CONTROL_SESSION: case VSS_IMVM_CMD_CREATE_FULL_CONTROL_SESSION: /* Passive session is used for CS call * Full session is used for VoIP call. */ pr_debug("%s: cmd = 0x%x\n", __func__, ptr[0]); if (!ptr[1]) { pr_debug("%s: MVM handle is %d\n", __func__, data->src_port); voice_set_mvm_handle(v, data->src_port); } else pr_err("got NACK for sending MVM create session\n"); v->mvm_state = CMD_STATUS_SUCCESS; wake_up(&v->mvm_wait); break; case VSS_IMVM_CMD_START_VOICE: case VSS_IMVM_CMD_ATTACH_VOCPROC: case VSS_IMVM_CMD_STOP_VOICE: case VSS_IMVM_CMD_DETACH_VOCPROC: case VSS_ISTREAM_CMD_SET_TTY_MODE: case APRV2_IBASIC_CMD_DESTROY_SESSION: case VSS_IMVM_CMD_ATTACH_STREAM: case VSS_IMVM_CMD_DETACH_STREAM: case VSS_ICOMMON_CMD_SET_NETWORK: case VSS_ICOMMON_CMD_SET_VOICE_TIMING: case VSS_IMVM_CMD_SET_POLICY_DUAL_CONTROL: case VSS_IMVM_CMD_SET_CAL_NETWORK: case VSS_IMVM_CMD_SET_CAL_MEDIA_TYPE: case VSS_IMEMORY_CMD_MAP_PHYSICAL: case VSS_IMEMORY_CMD_UNMAP: case VSS_IMVM_CMD_PAUSE_VOICE: case VSS_IMVM_CMD_STANDBY_VOICE: pr_debug("%s: cmd = 0x%x\n", __func__, ptr[0]); v->mvm_state = CMD_STATUS_SUCCESS; wake_up(&v->mvm_wait); break; default: pr_debug("%s: not match cmd = 0x%x\n", __func__, ptr[0]); break; } } } else if (data->opcode == VSS_IMEMORY_RSP_MAP) { pr_debug("%s, Revd VSS_IMEMORY_RSP_MAP response\n", __func__); if (data->payload_size && data->token == VOIP_MEM_MAP_TOKEN) { ptr = data->payload; if (ptr[0]) { v->shmem_info.mem_handle = ptr[0]; pr_debug("%s: shared mem_handle: 0x[%x]\n", __func__, v->shmem_info.mem_handle); v->mvm_state = CMD_STATUS_SUCCESS; wake_up(&v->mvm_wait); } } else if (data->payload_size && data->token == VOC_CAL_MEM_MAP_TOKEN) { ptr = data->payload; if (ptr[0]) { c->cal_mem_handle = ptr[0]; pr_debug("%s: cal mem handle 0x%x\n", __func__, c->cal_mem_handle); v->mvm_state = CMD_STATUS_SUCCESS; wake_up(&v->mvm_wait); } } else { pr_err("%s: Unknown mem map token %d\n", __func__, data->token); } } return 0; } static int32_t qdsp_cvs_callback(struct apr_client_data *data, void *priv) { uint32_t *ptr = NULL; struct common_data *c = NULL; struct voice_data *v = NULL; int i = 0; if ((data == NULL) || (priv == NULL)) { pr_err("%s: data or priv is NULL\n", __func__); return -EINVAL; } c = priv; pr_debug("%s: session_id 0x%x\n", __func__, data->dest_port); pr_debug("%s: Payload Length = %d, opcode=%x\n", __func__, data->payload_size, data->opcode); if (data->opcode == RESET_EVENTS) { if (data->reset_proc == APR_DEST_MODEM) { pr_debug("%s: Received Modem reset event\n", __func__); } else { pr_debug("%s: Reset event received in Voice service\n", __func__); apr_reset(c->apr_q6_cvs); c->apr_q6_cvs = NULL; /* Sub-system restart is applicable to all sessions. */ for (i = 0; i < MAX_VOC_SESSIONS; i++) c->voice[i].cvs_handle = 0; } voc_set_error_state(data->reset_proc); return 0; } v = voice_get_session_by_idx(data->dest_port); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } if (data->opcode == APR_BASIC_RSP_RESULT) { if (data->payload_size) { ptr = data->payload; pr_debug("%x %x\n", ptr[0], ptr[1]); if (ptr[1] != 0) { pr_err("%s: cmd = 0x%x returned error = 0x%x\n", __func__, ptr[0], ptr[1]); } /*response from CVS */ switch (ptr[0]) { case VSS_ISTREAM_CMD_CREATE_PASSIVE_CONTROL_SESSION: case VSS_ISTREAM_CMD_CREATE_FULL_CONTROL_SESSION: if (!ptr[1]) { pr_debug("%s: CVS handle is %d\n", __func__, data->src_port); voice_set_cvs_handle(v, data->src_port); } else pr_err("got NACK for sending CVS create session\n"); v->cvs_state = CMD_STATUS_SUCCESS; wake_up(&v->cvs_wait); break; case VSS_IVOLUME_CMD_MUTE_V2: case VSS_ISTREAM_CMD_SET_MEDIA_TYPE: case VSS_ISTREAM_CMD_VOC_AMR_SET_ENC_RATE: case VSS_ISTREAM_CMD_VOC_AMRWB_SET_ENC_RATE: case VSS_ISTREAM_CMD_SET_ENC_DTX_MODE: case VSS_ISTREAM_CMD_CDMA_SET_ENC_MINMAX_RATE: case APRV2_IBASIC_CMD_DESTROY_SESSION: case VSS_ISTREAM_CMD_REGISTER_CALIBRATION_DATA_V2: case VSS_ISTREAM_CMD_DEREGISTER_CALIBRATION_DATA: case VSS_ICOMMON_CMD_MAP_MEMORY: case VSS_ICOMMON_CMD_UNMAP_MEMORY: case VSS_ICOMMON_CMD_SET_UI_PROPERTY: case VSS_IPLAYBACK_CMD_START: case VSS_IPLAYBACK_CMD_STOP: case VSS_IRECORD_CMD_START: case VSS_IRECORD_CMD_STOP: case VSS_ISTREAM_CMD_SET_PACKET_EXCHANGE_MODE: case VSS_ISTREAM_CMD_SET_OOB_PACKET_EXCHANGE_CONFIG: case VSS_ISTREAM_CMD_SET_RX_DTMF_DETECTION: pr_debug("%s: cmd = 0x%x\n", __func__, ptr[0]); v->cvs_state = CMD_STATUS_SUCCESS; wake_up(&v->cvs_wait); break; case VOICE_CMD_SET_PARAM: pr_debug("%s: VOICE_CMD_SET_PARAM\n", __func__); rtac_make_voice_callback(RTAC_CVS, ptr, data->payload_size); break; case VOICE_CMD_GET_PARAM: pr_debug("%s: VOICE_CMD_GET_PARAM\n", __func__); /* Should only come here if there is an APR */ /* error or malformed APR packet. Otherwise */ /* response will be returned as */ /* VOICE_EVT_GET_PARAM_ACK */ if (ptr[1] != 0) { pr_err("%s: CVP get param error = %d, resuming\n", __func__, ptr[1]); rtac_make_voice_callback(RTAC_CVP, data->payload, data->payload_size); } break; default: pr_debug("%s: cmd = 0x%x\n", __func__, ptr[0]); break; } } } else if (data->opcode == VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_READY) { int ret = 0; u16 cvs_handle; uint32_t *cvs_voc_pkt; struct cvs_enc_buffer_consumed_cmd send_enc_buf_consumed_cmd; void *apr_cvs; pr_debug("Encoder buffer is ready\n"); apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); send_enc_buf_consumed_cmd.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); send_enc_buf_consumed_cmd.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(send_enc_buf_consumed_cmd) - APR_HDR_SIZE); send_enc_buf_consumed_cmd.hdr.src_port = voice_get_idx_for_session(v->session_id); send_enc_buf_consumed_cmd.hdr.dest_port = cvs_handle; send_enc_buf_consumed_cmd.hdr.token = 0; send_enc_buf_consumed_cmd.hdr.opcode = VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_CONSUMED; cvs_voc_pkt = v->shmem_info.sh_buf.buf[1].data; if (cvs_voc_pkt != NULL && common.mvs_info.ul_cb != NULL) { common.mvs_info.ul_cb((uint8_t *)&cvs_voc_pkt[3], cvs_voc_pkt[2], common.mvs_info.private_data); } else pr_err("%s: cvs_voc_pkt or ul_cb is NULL\n", __func__); ret = apr_send_pkt(apr_cvs, (uint32_t *) &send_enc_buf_consumed_cmd); if (ret < 0) { pr_err("%s: Err send ENC_BUF_CONSUMED_NOTIFY %d\n", __func__, ret); goto fail; } } else if (data->opcode == VSS_ISTREAM_EVT_SEND_ENC_BUFFER) { pr_debug("Recd VSS_ISTREAM_EVT_SEND_ENC_BUFFER\n"); } else if (data->opcode == VSS_ISTREAM_EVT_OOB_NOTIFY_DEC_BUFFER_REQUEST) { int ret = 0; u16 cvs_handle; uint32_t *cvs_voc_pkt; struct cvs_dec_buffer_ready_cmd send_dec_buf; void *apr_cvs; apr_cvs = common.apr_q6_cvs; if (!apr_cvs) { pr_err("%s: apr_cvs is NULL\n", __func__); return -EINVAL; } cvs_handle = voice_get_cvs_handle(v); send_dec_buf.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); send_dec_buf.hdr.pkt_size = APR_PKT_SIZE(APR_HDR_SIZE, sizeof(send_dec_buf) - APR_HDR_SIZE); send_dec_buf.hdr.src_port = voice_get_idx_for_session(v->session_id); send_dec_buf.hdr.dest_port = cvs_handle; send_dec_buf.hdr.token = 0; send_dec_buf.hdr.opcode = VSS_ISTREAM_EVT_OOB_NOTIFY_DEC_BUFFER_READY; cvs_voc_pkt = (uint32_t *)(v->shmem_info.sh_buf.buf[0].data); if (cvs_voc_pkt != NULL && common.mvs_info.dl_cb != NULL) { /* Set timestamp to 0 and advance the pointer */ cvs_voc_pkt[0] = 0; /* Set media_type and advance the pointer */ cvs_voc_pkt[1] = common.mvs_info.media_type; common.mvs_info.dl_cb( (uint8_t *)&cvs_voc_pkt[2], common.mvs_info.private_data); ret = apr_send_pkt(apr_cvs, (uint32_t *) &send_dec_buf); if (ret < 0) { pr_err("%s: Err send DEC_BUF_READY_NOTIFI %d\n", __func__, ret); goto fail; } } else { pr_debug("%s: voc_pkt or dl_cb is NULL\n", __func__); goto fail; } } else if (data->opcode == VSS_ISTREAM_EVT_REQUEST_DEC_BUFFER) { pr_debug("Recd VSS_ISTREAM_EVT_REQUEST_DEC_BUFFER\n"); } else if (data->opcode == VSS_ISTREAM_EVT_SEND_DEC_BUFFER) { pr_debug("Send dec buf resp\n"); } else if (data->opcode == APR_RSP_ACCEPTED) { ptr = data->payload; if (ptr[0]) pr_debug("%s: APR_RSP_ACCEPTED for 0x%x:\n", __func__, ptr[0]); } else if (data->opcode == VSS_ISTREAM_EVT_NOT_READY) { pr_debug("Recd VSS_ISTREAM_EVT_NOT_READY\n"); } else if (data->opcode == VSS_ISTREAM_EVT_READY) { pr_debug("Recd VSS_ISTREAM_EVT_READY\n"); } else if (data->opcode == VOICE_EVT_GET_PARAM_ACK) { pr_debug("%s: VOICE_EVT_GET_PARAM_ACK\n", __func__); ptr = data->payload; if (ptr[0] != 0) { pr_err("%s: VOICE_EVT_GET_PARAM_ACK returned error = 0x%x\n", __func__, ptr[0]); } rtac_make_voice_callback(RTAC_CVS, data->payload, data->payload_size); } else if (data->opcode == VSS_ISTREAM_EVT_RX_DTMF_DETECTED) { struct vss_istream_evt_rx_dtmf_detected *dtmf_rx_detected; uint32_t *voc_pkt = data->payload; uint32_t pkt_len = data->payload_size; if ((voc_pkt != NULL) && (pkt_len == sizeof(struct vss_istream_evt_rx_dtmf_detected))) { dtmf_rx_detected = (struct vss_istream_evt_rx_dtmf_detected *) voc_pkt; pr_debug("RX_DTMF_DETECTED low_freq=%d high_freq=%d\n", dtmf_rx_detected->low_freq, dtmf_rx_detected->high_freq); if (c->dtmf_info.dtmf_rx_ul_cb) c->dtmf_info.dtmf_rx_ul_cb((uint8_t *)voc_pkt, voc_get_session_name(v->session_id), c->dtmf_info.private_data); } else { pr_err("Invalid packet\n"); } } else pr_debug("Unknown opcode 0x%x\n", data->opcode); fail: return 0; } static int32_t qdsp_cvp_callback(struct apr_client_data *data, void *priv) { uint32_t *ptr = NULL; struct common_data *c = NULL; struct voice_data *v = NULL; int i = 0; if ((data == NULL) || (priv == NULL)) { pr_err("%s: data or priv is NULL\n", __func__); return -EINVAL; } c = priv; if (data->opcode == RESET_EVENTS) { if (data->reset_proc == APR_DEST_MODEM) { pr_debug("%s: Received Modem reset event\n", __func__); } else { pr_debug("%s: Reset event received in Voice service\n", __func__); apr_reset(c->apr_q6_cvp); c->apr_q6_cvp = NULL; /* Sub-system restart is applicable to all sessions. */ for (i = 0; i < MAX_VOC_SESSIONS; i++) c->voice[i].cvp_handle = 0; } voc_set_error_state(data->reset_proc); return 0; } v = voice_get_session_by_idx(data->dest_port); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } if (data->opcode == APR_BASIC_RSP_RESULT) { if (data->payload_size) { ptr = data->payload; pr_debug("%x %x\n", ptr[0], ptr[1]); if (ptr[1] != 0) { pr_err("%s: cmd = 0x%x returned error = 0x%x\n", __func__, ptr[0], ptr[1]); } switch (ptr[0]) { case VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION_V2: /*response from CVP */ pr_debug("%s: cmd = 0x%x\n", __func__, ptr[0]); if (!ptr[1]) { voice_set_cvp_handle(v, data->src_port); pr_debug("status: %d, cvphdl=%d\n", ptr[1], data->src_port); } else pr_err("got NACK from CVP create session response\n"); v->cvp_state = CMD_STATUS_SUCCESS; wake_up(&v->cvp_wait); break; case VSS_IVOCPROC_CMD_SET_DEVICE_V2: case VSS_IVOCPROC_CMD_SET_RX_VOLUME_INDEX: case VSS_IVOCPROC_CMD_ENABLE: case VSS_IVOCPROC_CMD_DISABLE: case APRV2_IBASIC_CMD_DESTROY_SESSION: case VSS_IVOCPROC_CMD_REGISTER_VOL_CALIBRATION_DATA: case VSS_IVOCPROC_CMD_DEREGISTER_VOL_CALIBRATION_DATA: case VSS_IVOCPROC_CMD_REGISTER_CALIBRATION_DATA_V2: case VSS_IVOCPROC_CMD_DEREGISTER_CALIBRATION_DATA: case VSS_IVOCPROC_CMD_REGISTER_DEVICE_CONFIG: case VSS_IVOCPROC_CMD_DEREGISTER_DEVICE_CONFIG: case VSS_ICOMMON_CMD_MAP_MEMORY: case VSS_ICOMMON_CMD_UNMAP_MEMORY: case VSS_IVOLUME_CMD_MUTE_V2: v->cvp_state = CMD_STATUS_SUCCESS; wake_up(&v->cvp_wait); break; case VOICE_CMD_SET_PARAM: pr_debug("%s: VOICE_CMD_SET_PARAM\n", __func__); rtac_make_voice_callback(RTAC_CVP, ptr, data->payload_size); break; case VOICE_CMD_GET_PARAM: pr_debug("%s: VOICE_CMD_GET_PARAM\n", __func__); /* Should only come here if there is an APR */ /* error or malformed APR packet. Otherwise */ /* response will be returned as */ /* VOICE_EVT_GET_PARAM_ACK */ if (ptr[1] != 0) { pr_err("%s: CVP get param error = %d, resuming\n", __func__, ptr[1]); rtac_make_voice_callback(RTAC_CVP, data->payload, data->payload_size); } break; default: pr_debug("%s: not match cmd = 0x%x\n", __func__, ptr[0]); break; } } } else if (data->opcode == VOICE_EVT_GET_PARAM_ACK) { pr_debug("%s: VOICE_EVT_GET_PARAM_ACK\n", __func__); ptr = data->payload; if (ptr[0] != 0) { pr_err("%s: VOICE_EVT_GET_PARAM_ACK returned error = 0x%x\n", __func__, ptr[0]); } rtac_make_voice_callback(RTAC_CVP, data->payload, data->payload_size); } return 0; } static int voice_alloc_oob_shared_mem(void) { int cnt = 0; int rc = 0; int len; void *mem_addr; dma_addr_t phys; int bufsz = BUFFER_BLOCK_SIZE; int bufcnt = NUM_OF_BUFFERS; struct voice_data *v = voice_get_session( common.voice[VOC_PATH_FULL].session_id); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } rc = msm_audio_ion_alloc("voip_client", &(v->shmem_info.sh_buf.client), &(v->shmem_info.sh_buf.handle), bufsz*bufcnt, (ion_phys_addr_t *)&phys, (size_t *)&len, &mem_addr); if (rc) { pr_err("%s: audio ION alloc failed, rc = %d\n", __func__, rc); return -EINVAL; } while (cnt < bufcnt) { v->shmem_info.sh_buf.buf[cnt].data = mem_addr + (cnt * bufsz); v->shmem_info.sh_buf.buf[cnt].phys = phys + (cnt * bufsz); v->shmem_info.sh_buf.buf[cnt].size = bufsz; cnt++; } pr_debug("%s buf[0].data:[%p], buf[0].phys:[%p], &buf[0].phys:[%p],\n", __func__, (void *)v->shmem_info.sh_buf.buf[0].data, (void *)v->shmem_info.sh_buf.buf[0].phys, (void *)&v->shmem_info.sh_buf.buf[0].phys); pr_debug("%s: buf[1].data:[%p], buf[1].phys[%p], &buf[1].phys[%p]\n", __func__, (void *)v->shmem_info.sh_buf.buf[1].data, (void *)v->shmem_info.sh_buf.buf[1].phys, (void *)&v->shmem_info.sh_buf.buf[1].phys); memset((void *)v->shmem_info.sh_buf.buf[0].data, 0, (bufsz * bufcnt)); return 0; } static int voice_alloc_oob_mem_table(void) { int rc = 0; int len; struct voice_data *v = voice_get_session( common.voice[VOC_PATH_FULL].session_id); if (v == NULL) { pr_err("%s: v is NULL\n", __func__); return -EINVAL; } rc = msm_audio_ion_alloc("voip_client", &(v->shmem_info.memtbl.client), &(v->shmem_info.memtbl.handle), sizeof(struct vss_imemory_table_t), (ion_phys_addr_t *)&v->shmem_info.memtbl.phys, (size_t *)&len, &(v->shmem_info.memtbl.data)); if (rc) { pr_err("%s: audio ION alloc failed, rc = %d\n", __func__, rc); return -EINVAL; } v->shmem_info.memtbl.size = sizeof(struct vss_imemory_table_t); pr_debug("%s data[%p]phys[%p][%p]\n", __func__, (void *)v->shmem_info.memtbl.data, (void *)v->shmem_info.memtbl.phys, (void *)&v->shmem_info.memtbl.phys); return 0; } static int voice_alloc_cal_mem_map_table(void) { int ret = 0; int len; ret = msm_audio_ion_alloc("voip_client", &(common.cal_mem_map_table.client), &(common.cal_mem_map_table.handle), sizeof(struct vss_imemory_table_t), (ion_phys_addr_t *)&common.cal_mem_map_table.phys, (size_t *) &len, &(common.cal_mem_map_table.data)); if (ret) { pr_err("%s: audio ION alloc failed, rc = %d\n", __func__, ret); return -EINVAL; } common.cal_mem_map_table.size = sizeof(struct vss_imemory_table_t); pr_debug("%s: data 0x%x phys 0x%x\n", __func__, (unsigned int) common.cal_mem_map_table.data, common.cal_mem_map_table.phys); return 0; } static int __init voice_init(void) { int rc = 0, i = 0; memset(&common, 0, sizeof(struct common_data)); /* set default value */ common.default_mute_val = 0; /* default is un-mute */ common.default_vol_val = 0; common.default_sample_val = 8000; /* Initialize MVS info. */ common.mvs_info.network_type = VSS_NETWORK_ID_DEFAULT; mutex_init(&common.common_lock); /* Initialize session id with vsid */ init_session_id(); for (i = 0; i < MAX_VOC_SESSIONS; i++) { /* initialize dev_rx and dev_tx */ common.voice[i].dev_rx.volume = common.default_vol_val; common.voice[i].dev_rx.dev_mute = common.default_mute_val; common.voice[i].dev_tx.dev_mute = common.default_mute_val; common.voice[i].stream_rx.stream_mute = common.default_mute_val; common.voice[i].stream_tx.stream_mute = common.default_mute_val; common.voice[i].dev_tx.port_id = 0x100B; common.voice[i].dev_rx.port_id = 0x100A; common.voice[i].sidetone_gain = 0x512; common.voice[i].dtmf_rx_detect_en = 0; common.voice[i].lch_mode = 0; common.voice[i].voc_state = VOC_INIT; init_waitqueue_head(&common.voice[i].mvm_wait); init_waitqueue_head(&common.voice[i].cvs_wait); init_waitqueue_head(&common.voice[i].cvp_wait); mutex_init(&common.voice[i].lock); } /* Allocate shared memory for OOB Voip */ rc = voice_alloc_oob_shared_mem(); if (rc < 0) pr_err("failed to alloc shared memory for OOB %d\n", rc); else { /* Allocate mem map table for OOB */ rc = voice_alloc_oob_mem_table(); if (rc < 0) pr_err("failed to alloc mem map talbe %d\n", rc); } /* Allocate memory for calibration memory map table. */ rc = voice_alloc_cal_mem_map_table(); return rc; } late_initcall(voice_init);
Java
/* * Copyright 2005 Eric Anholt * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Eric Anholt <anholt@FreeBSD.org> * */ #include "sis_context.h" #include "sis_state.h" #include "sis_tris.h" #include "sis_lock.h" #include "sis_tex.h" #include "sis_reg.h" #include "context.h" #include "enums.h" #include "colormac.h" #include "swrast/swrast.h" #include "vbo/vbo.h" #include "tnl/tnl.h" #include "swrast_setup/swrast_setup.h" #include "tnl/t_pipeline.h" /* ============================================================= * Alpha blending */ static void sis6326DDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) { sisContextPtr smesa = SIS_CONTEXT(ctx); GLubyte refbyte; __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; CLAMPED_FLOAT_TO_UBYTE(refbyte, ref); current->hwAlpha = refbyte << 16; /* Alpha Test function */ switch (func) { case GL_NEVER: current->hwAlpha |= S_ASET_PASS_NEVER; break; case GL_LESS: current->hwAlpha |= S_ASET_PASS_LESS; break; case GL_EQUAL: current->hwAlpha |= S_ASET_PASS_EQUAL; break; case GL_LEQUAL: current->hwAlpha |= S_ASET_PASS_LEQUAL; break; case GL_GREATER: current->hwAlpha |= S_ASET_PASS_GREATER; break; case GL_NOTEQUAL: current->hwAlpha |= S_ASET_PASS_NOTEQUAL; break; case GL_GEQUAL: current->hwAlpha |= S_ASET_PASS_GEQUAL; break; case GL_ALWAYS: current->hwAlpha |= S_ASET_PASS_ALWAYS; break; } prev->hwAlpha = current->hwAlpha; smesa->GlobalFlag |= GFLAG_ALPHASETTING; } static void sis6326DDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA ) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; current->hwDstSrcBlend = 0; switch (dfactorRGB) { case GL_ZERO: current->hwDstSrcBlend |= S_DBLEND_ZERO; break; case GL_ONE: current->hwDstSrcBlend |= S_DBLEND_ONE; break; case GL_SRC_COLOR: current->hwDstSrcBlend |= S_DBLEND_SRC_COLOR; break; case GL_ONE_MINUS_SRC_COLOR: current->hwDstSrcBlend |= S_DBLEND_INV_SRC_COLOR; break; case GL_SRC_ALPHA: current->hwDstSrcBlend |= S_DBLEND_SRC_ALPHA; break; case GL_ONE_MINUS_SRC_ALPHA: current->hwDstSrcBlend |= S_DBLEND_INV_SRC_ALPHA; break; case GL_DST_ALPHA: current->hwDstSrcBlend |= S_DBLEND_DST_ALPHA; break; case GL_ONE_MINUS_DST_ALPHA: current->hwDstSrcBlend |= S_DBLEND_INV_DST_ALPHA; break; } switch (sfactorRGB) { case GL_ZERO: current->hwDstSrcBlend |= S_SBLEND_ZERO; break; case GL_ONE: current->hwDstSrcBlend |= S_SBLEND_ONE; break; case GL_SRC_ALPHA: current->hwDstSrcBlend |= S_SBLEND_SRC_ALPHA; break; case GL_ONE_MINUS_SRC_ALPHA: current->hwDstSrcBlend |= S_SBLEND_INV_SRC_ALPHA; break; case GL_DST_ALPHA: current->hwDstSrcBlend |= S_SBLEND_DST_ALPHA; break; case GL_ONE_MINUS_DST_ALPHA: current->hwDstSrcBlend |= S_SBLEND_INV_DST_ALPHA; break; case GL_DST_COLOR: current->hwDstSrcBlend |= S_SBLEND_DST_COLOR; break; case GL_ONE_MINUS_DST_COLOR: current->hwDstSrcBlend |= S_SBLEND_INV_DST_COLOR; break; case GL_SRC_ALPHA_SATURATE: current->hwDstSrcBlend |= S_SBLEND_SRC_ALPHA_SAT; break; } if (current->hwDstSrcBlend != prev->hwDstSrcBlend) { prev->hwDstSrcBlend = current->hwDstSrcBlend; smesa->GlobalFlag |= GFLAG_DSTBLEND; } } /* ============================================================= * Depth testing */ static void sis6326DDDepthFunc( GLcontext *ctx, GLenum func ) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; current->hwZ &= ~MASK_6326_ZTestMode; switch (func) { case GL_LESS: current->hwZ |= S_ZSET_PASS_LESS; break; case GL_GEQUAL: current->hwZ |= S_ZSET_PASS_GEQUAL; break; case GL_LEQUAL: current->hwZ |= S_ZSET_PASS_LEQUAL; break; case GL_GREATER: current->hwZ |= S_ZSET_PASS_GREATER; break; case GL_NOTEQUAL: current->hwZ |= S_ZSET_PASS_NOTEQUAL; break; case GL_EQUAL: current->hwZ |= S_ZSET_PASS_EQUAL; break; case GL_ALWAYS: current->hwZ |= S_ZSET_PASS_ALWAYS; break; case GL_NEVER: current->hwZ |= S_ZSET_PASS_NEVER; break; } if (current->hwZ != prev->hwZ) { prev->hwZ = current->hwZ; smesa->GlobalFlag |= GFLAG_ZSETTING; } } static void sis6326DDDepthMask( GLcontext *ctx, GLboolean flag ) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *current = &smesa->current; if (ctx->Depth.Test) current->hwCapEnable |= S_ENABLE_ZWrite; else current->hwCapEnable &= ~S_ENABLE_ZWrite; } /* ============================================================= * Fog */ static void sis6326DDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *current = &smesa->current; __GLSiSHardware *prev = &smesa->prev; GLint fogColor; switch(pname) { case GL_FOG_COLOR: fogColor = FLOAT_TO_UBYTE( ctx->Fog.Color[0] ) << 16; fogColor |= FLOAT_TO_UBYTE( ctx->Fog.Color[1] ) << 8; fogColor |= FLOAT_TO_UBYTE( ctx->Fog.Color[2] ); current->hwFog = 0x01000000 | fogColor; if (current->hwFog != prev->hwFog) { prev->hwFog = current->hwFog; smesa->GlobalFlag |= GFLAG_FOGSETTING; } break; } } /* ============================================================= * Clipping */ void sis6326UpdateClipping(GLcontext *ctx) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; GLint x1, y1, x2, y2; x1 = 0; y1 = 0; x2 = smesa->width - 1; y2 = smesa->height - 1; if (ctx->Scissor.Enabled) { if (ctx->Scissor.X > x1) x1 = ctx->Scissor.X; if (ctx->Scissor.Y > y1) y1 = ctx->Scissor.Y; if (ctx->Scissor.X + ctx->Scissor.Width - 1 < x2) x2 = ctx->Scissor.X + ctx->Scissor.Width - 1; if (ctx->Scissor.Y + ctx->Scissor.Height - 1 < y2) y2 = ctx->Scissor.Y + ctx->Scissor.Height - 1; } y1 = Y_FLIP(y1); y2 = Y_FLIP(y2); /*current->clipTopBottom = (y2 << 13) | y1; current->clipLeftRight = (x1 << 13) | x2;*/ /* XXX */ current->clipTopBottom = (0 << 13) | smesa->height; current->clipLeftRight = (0 << 13) | smesa->width; if ((current->clipTopBottom != prev->clipTopBottom) || (current->clipLeftRight != prev->clipLeftRight)) { prev->clipTopBottom = current->clipTopBottom; prev->clipLeftRight = current->clipLeftRight; smesa->GlobalFlag |= GFLAG_CLIPPING; } } static void sis6326DDScissor( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) { if (ctx->Scissor.Enabled) sis6326UpdateClipping( ctx ); } /* ============================================================= * Culling */ static void sis6326UpdateCull( GLcontext *ctx ) { /* XXX culling */ } static void sis6326DDCullFace( GLcontext *ctx, GLenum mode ) { sis6326UpdateCull( ctx ); } static void sis6326DDFrontFace( GLcontext *ctx, GLenum mode ) { sis6326UpdateCull( ctx ); } /* ============================================================= * Masks */ static void sis6326DDColorMask( GLcontext *ctx, GLboolean r, GLboolean g, GLboolean b, GLboolean a ) { sisContextPtr smesa = SIS_CONTEXT(ctx); if (r && g && b && ((ctx->Visual.alphaBits == 0) || a)) { FALLBACK(smesa, SIS_FALLBACK_WRITEMASK, 0); } else { FALLBACK(smesa, SIS_FALLBACK_WRITEMASK, 1); } } /* ============================================================= * Rendering attributes */ static void sis6326UpdateSpecular(GLcontext *ctx) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *current = &smesa->current; if (NEED_SECONDARY_COLOR(ctx)) current->hwCapEnable |= S_ENABLE_Specular; else current->hwCapEnable &= ~S_ENABLE_Specular; } static void sis6326DDLightModelfv(GLcontext *ctx, GLenum pname, const GLfloat *param) { if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) { sis6326UpdateSpecular(ctx); } } static void sis6326DDShadeModel( GLcontext *ctx, GLenum mode ) { sisContextPtr smesa = SIS_CONTEXT(ctx); /* Signal to sisRasterPrimitive to recalculate dwPrimitiveSet */ smesa->hw_primitive = -1; } /* ============================================================= * Window position */ /* ============================================================= * Viewport */ static void sis6326CalcViewport( GLcontext *ctx ) { sisContextPtr smesa = SIS_CONTEXT(ctx); const GLfloat *v = ctx->Viewport._WindowMap.m; GLfloat *m = smesa->hw_viewport; /* See also sis_translate_vertex. */ m[MAT_SX] = v[MAT_SX]; m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X; m[MAT_SY] = - v[MAT_SY]; m[MAT_TY] = - v[MAT_TY] + smesa->driDrawable->h + SUBPIXEL_Y; m[MAT_SZ] = v[MAT_SZ] * smesa->depth_scale; m[MAT_TZ] = v[MAT_TZ] * smesa->depth_scale; } static void sis6326DDViewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ) { sis6326CalcViewport( ctx ); } static void sis6326DDDepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval ) { sis6326CalcViewport( ctx ); } /* ============================================================= * Miscellaneous */ static void sis6326DDLogicOpCode( GLcontext *ctx, GLenum opcode ) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; if (!ctx->Color.ColorLogicOpEnabled) return; current->hwDstSet &= ~MASK_ROP2; switch (opcode) { case GL_CLEAR: current->hwDstSet |= LOP_CLEAR; break; case GL_SET: current->hwDstSet |= LOP_SET; break; case GL_COPY: current->hwDstSet |= LOP_COPY; break; case GL_COPY_INVERTED: current->hwDstSet |= LOP_COPY_INVERTED; break; case GL_NOOP: current->hwDstSet |= LOP_NOOP; break; case GL_INVERT: current->hwDstSet |= LOP_INVERT; break; case GL_AND: current->hwDstSet |= LOP_AND; break; case GL_NAND: current->hwDstSet |= LOP_NAND; break; case GL_OR: current->hwDstSet |= LOP_OR; break; case GL_NOR: current->hwDstSet |= LOP_NOR; break; case GL_XOR: current->hwDstSet |= LOP_XOR; break; case GL_EQUIV: current->hwDstSet |= LOP_EQUIV; break; case GL_AND_REVERSE: current->hwDstSet |= LOP_AND_REVERSE; break; case GL_AND_INVERTED: current->hwDstSet |= LOP_AND_INVERTED; break; case GL_OR_REVERSE: current->hwDstSet |= LOP_OR_REVERSE; break; case GL_OR_INVERTED: current->hwDstSet |= LOP_OR_INVERTED; break; } if (current->hwDstSet != prev->hwDstSet) { prev->hwDstSet = current->hwDstSet; smesa->GlobalFlag |= GFLAG_DESTSETTING; } } void sis6326DDDrawBuffer( GLcontext *ctx, GLenum mode ) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; if(getenv("SIS_DRAW_FRONT")) ctx->DrawBuffer->_ColorDrawBufferMask[0] = GL_FRONT_LEFT; /* * _DrawDestMask is easier to cope with than <mode>. */ current->hwDstSet &= ~MASK_DstBufferPitch; switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { case BUFFER_BIT_FRONT_LEFT: current->hwOffsetDest = smesa->front.offset; current->hwDstSet |= smesa->front.pitch; FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; case BUFFER_BIT_BACK_LEFT: current->hwOffsetDest = smesa->back.offset; current->hwDstSet |= smesa->back.pitch; FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; default: /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE ); return; } if (current->hwDstSet != prev->hwDstSet) { prev->hwDstSet = current->hwDstSet; smesa->GlobalFlag |= GFLAG_DESTSETTING; } if (current->hwOffsetDest != prev->hwOffsetDest) { prev->hwOffsetDest = current->hwOffsetDest; smesa->GlobalFlag |= GFLAG_DESTSETTING; } } /* ============================================================= * Polygon stipple */ /* ============================================================= * Render mode */ /* ============================================================= * State enable/disable */ static void sis6326DDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *current = &smesa->current; switch (cap) { case GL_ALPHA_TEST: if (state) current->hwCapEnable |= S_ENABLE_AlphaTest; else current->hwCapEnable &= ~S_ENABLE_AlphaTest; break; case GL_BLEND: /* TODO: */ if (state) /* if (state & !ctx->Color.ColorLogicOpEnabled) */ current->hwCapEnable |= S_ENABLE_Blend; else current->hwCapEnable &= ~S_ENABLE_Blend; break; case GL_CULL_FACE: /* XXX culling */ break; case GL_DEPTH_TEST: if (state && smesa->depth.offset != 0) current->hwCapEnable |= S_ENABLE_ZTest; else current->hwCapEnable &= ~S_ENABLE_ZTest; sis6326DDDepthMask( ctx, ctx->Depth.Mask ); break; case GL_DITHER: if (state) current->hwCapEnable |= S_ENABLE_Dither; else current->hwCapEnable &= ~S_ENABLE_Dither; break; case GL_FOG: if (state) current->hwCapEnable |= S_ENABLE_Fog; else current->hwCapEnable &= ~S_ENABLE_Fog; break; case GL_COLOR_LOGIC_OP: if (state) sis6326DDLogicOpCode( ctx, ctx->Color.LogicOp ); else sis6326DDLogicOpCode( ctx, GL_COPY ); break; case GL_SCISSOR_TEST: sis6326UpdateClipping( ctx ); break; case GL_STENCIL_TEST: if (state) { FALLBACK(smesa, SIS_FALLBACK_STENCIL, 1); } else { FALLBACK(smesa, SIS_FALLBACK_STENCIL, 0); } break; case GL_LIGHTING: case GL_COLOR_SUM_EXT: sis6326UpdateSpecular(ctx); break; } } /* ============================================================= * State initialization, management */ /* Called before beginning of rendering. */ void sis6326UpdateHWState( GLcontext *ctx ) { sisContextPtr smesa = SIS_CONTEXT(ctx); __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; if (smesa->NewGLState & _NEW_TEXTURE) sisUpdateTextureState( ctx ); if (current->hwCapEnable ^ prev->hwCapEnable) { prev->hwCapEnable = current->hwCapEnable; smesa->GlobalFlag |= GFLAG_ENABLESETTING; } if (smesa->GlobalFlag & GFLAG_RENDER_STATES) sis_update_render_state( smesa ); if (smesa->GlobalFlag & GFLAG_TEXTURE_STATES) sis_update_texture_state( smesa ); } static void sis6326DDInvalidateState( GLcontext *ctx, GLuint new_state ) { sisContextPtr smesa = SIS_CONTEXT(ctx); _swrast_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); _vbo_InvalidateState( ctx, new_state ); _tnl_InvalidateState( ctx, new_state ); smesa->NewGLState |= new_state; } /* Initialize the context's hardware state. */ void sis6326DDInitState( sisContextPtr smesa ) { __GLSiSHardware *prev = &smesa->prev; __GLSiSHardware *current = &smesa->current; GLcontext *ctx = smesa->glCtx; /* add Texture Perspective Enable */ current->hwCapEnable = S_ENABLE_TextureCache | S_ENABLE_TexturePerspective | S_ENABLE_Dither; /* Z test mode is LESS */ current->hwZ = S_ZSET_PASS_LESS | S_ZSET_FORMAT_16; if (ctx->Visual.depthBits > 0) current->hwCapEnable |= S_ENABLE_ZWrite; /* Alpha test mode is ALWAYS, alpha ref value is 0 */ current->hwAlpha = S_ASET_PASS_ALWAYS; /* ROP2 is COPYPEN */ current->hwDstSet = LOP_COPY; /* LinePattern is 0, Repeat Factor is 0 */ current->hwLinePattern = 0x00008000; /* Src blend is BLEND_ONE, Dst blend is D3DBLEND_ZERO */ current->hwDstSrcBlend = S_SBLEND_ONE | S_DBLEND_ZERO; switch (smesa->bytesPerPixel) { case 2: current->hwDstSet |= DST_FORMAT_RGB_565; break; case 4: current->hwDstSet |= DST_FORMAT_ARGB_8888; break; } smesa->depth_scale = 1.0 / (GLfloat)0xffff; smesa->clearTexCache = GL_TRUE; smesa->clearColorPattern = 0; sis6326UpdateZPattern(smesa, 1.0); sis6326UpdateCull(ctx); /* Set initial fog settings. Start and end are the same case. */ sis6326DDFogfv( ctx, GL_FOG_DENSITY, &ctx->Fog.Density ); sis6326DDFogfv( ctx, GL_FOG_END, &ctx->Fog.End ); sis6326DDFogfv( ctx, GL_FOG_MODE, NULL ); memcpy(prev, current, sizeof(__GLSiSHardware)); } /* Initialize the driver's state functions. */ void sis6326DDInitStateFuncs( GLcontext *ctx ) { ctx->Driver.UpdateState = sis6326DDInvalidateState; ctx->Driver.Clear = sis6326DDClear; ctx->Driver.ClearColor = sis6326DDClearColor; ctx->Driver.ClearDepth = sis6326DDClearDepth; ctx->Driver.AlphaFunc = sis6326DDAlphaFunc; ctx->Driver.BlendFuncSeparate = sis6326DDBlendFuncSeparate; ctx->Driver.ColorMask = sis6326DDColorMask; ctx->Driver.CullFace = sis6326DDCullFace; ctx->Driver.DepthMask = sis6326DDDepthMask; ctx->Driver.DepthFunc = sis6326DDDepthFunc; ctx->Driver.DepthRange = sis6326DDDepthRange; ctx->Driver.DrawBuffer = sis6326DDDrawBuffer; ctx->Driver.Enable = sis6326DDEnable; ctx->Driver.FrontFace = sis6326DDFrontFace; ctx->Driver.Fogfv = sis6326DDFogfv; ctx->Driver.LogicOpcode = sis6326DDLogicOpCode; ctx->Driver.Scissor = sis6326DDScissor; ctx->Driver.ShadeModel = sis6326DDShadeModel; ctx->Driver.LightModelfv = sis6326DDLightModelfv; ctx->Driver.Viewport = sis6326DDViewport; }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_31) on Wed May 15 10:56:37 EEST 2013 --> <TITLE> ITouchHandler (AChartEngine) </TITLE> <META NAME="date" CONTENT="2013-05-15"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ITouchHandler (AChartEngine)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ITouchHandler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../org/achartengine/GraphicalView.html" title="class in org.achartengine"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../org/achartengine/TouchHandler.html" title="class in org.achartengine"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?org/achartengine/ITouchHandler.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ITouchHandler.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.achartengine</FONT> <BR> Interface ITouchHandler</H2> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../org/achartengine/TouchHandler.html" title="class in org.achartengine">TouchHandler</A>, <A HREF="../../org/achartengine/TouchHandlerOld.html" title="class in org.achartengine">TouchHandlerOld</A></DD> </DL> <HR> <DL> <DT><PRE>public interface <B>ITouchHandler</B></DL> </PRE> <P> The interface to be implemented by the touch handlers. <P> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../org/achartengine/ITouchHandler.html#addPanListener(org.achartengine.tools.PanListener)">addPanListener</A></B>(<A HREF="../../org/achartengine/tools/PanListener.html" title="interface in org.achartengine.tools">PanListener</A>&nbsp;listener)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a new pan listener.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../org/achartengine/ITouchHandler.html#addZoomListener(org.achartengine.tools.ZoomListener)">addZoomListener</A></B>(<A HREF="../../org/achartengine/tools/ZoomListener.html" title="interface in org.achartengine.tools">ZoomListener</A>&nbsp;listener)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a new zoom listener.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../org/achartengine/ITouchHandler.html#handleTouch(android.view.MotionEvent)">handleTouch</A></B>(android.view.MotionEvent&nbsp;event)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Handles the touch event.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../org/achartengine/ITouchHandler.html#removePanListener(org.achartengine.tools.PanListener)">removePanListener</A></B>(<A HREF="../../org/achartengine/tools/PanListener.html" title="interface in org.achartengine.tools">PanListener</A>&nbsp;listener)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a pan listener.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../org/achartengine/ITouchHandler.html#removeZoomListener(org.achartengine.tools.ZoomListener)">removeZoomListener</A></B>(<A HREF="../../org/achartengine/tools/ZoomListener.html" title="interface in org.achartengine.tools">ZoomListener</A>&nbsp;listener)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a zoom listener.</TD> </TR> </TABLE> &nbsp; <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="handleTouch(android.view.MotionEvent)"><!-- --></A><H3> handleTouch</H3> <PRE> boolean <B>handleTouch</B>(android.view.MotionEvent&nbsp;event)</PRE> <DL> <DD>Handles the touch event. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>event</CODE> - the touch event <DT><B>Returns:</B><DD>true if the event was handled</DL> </DD> </DL> <HR> <A NAME="addZoomListener(org.achartengine.tools.ZoomListener)"><!-- --></A><H3> addZoomListener</H3> <PRE> void <B>addZoomListener</B>(<A HREF="../../org/achartengine/tools/ZoomListener.html" title="interface in org.achartengine.tools">ZoomListener</A>&nbsp;listener)</PRE> <DL> <DD>Adds a new zoom listener. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>listener</CODE> - zoom listener</DL> </DD> </DL> <HR> <A NAME="removeZoomListener(org.achartengine.tools.ZoomListener)"><!-- --></A><H3> removeZoomListener</H3> <PRE> void <B>removeZoomListener</B>(<A HREF="../../org/achartengine/tools/ZoomListener.html" title="interface in org.achartengine.tools">ZoomListener</A>&nbsp;listener)</PRE> <DL> <DD>Removes a zoom listener. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>listener</CODE> - zoom listener</DL> </DD> </DL> <HR> <A NAME="addPanListener(org.achartengine.tools.PanListener)"><!-- --></A><H3> addPanListener</H3> <PRE> void <B>addPanListener</B>(<A HREF="../../org/achartengine/tools/PanListener.html" title="interface in org.achartengine.tools">PanListener</A>&nbsp;listener)</PRE> <DL> <DD>Adds a new pan listener. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>listener</CODE> - pan listener</DL> </DD> </DL> <HR> <A NAME="removePanListener(org.achartengine.tools.PanListener)"><!-- --></A><H3> removePanListener</H3> <PRE> void <B>removePanListener</B>(<A HREF="../../org/achartengine/tools/PanListener.html" title="interface in org.achartengine.tools">PanListener</A>&nbsp;listener)</PRE> <DL> <DD>Removes a pan listener. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>listener</CODE> - pan listener</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ITouchHandler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../org/achartengine/GraphicalView.html" title="class in org.achartengine"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../org/achartengine/TouchHandler.html" title="class in org.achartengine"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?org/achartengine/ITouchHandler.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ITouchHandler.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &#169; 2009 - 2011 4ViewSoft. All Rights Reserved.</i> </BODY> </HTML>
Java
module Admin class JobsController < AdminController def initialize(repository = Delayed::Job) @repository = repository super() end def index @jobs = @repository.order(created_at: :desc) end def show @job = @repository.find(params[:id]) end def update @job = @repository.find(params[:id]) @job.invoke_job redirect_to admin_jobs_path end def destroy @job = @repository.find(params[:id]) @job.destroy redirect_to admin_jobs_path end end end
Java
/** Copyright (C) SYSTAP, LLC 2006-2012. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.bigdata.rdf.graph.analytics; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import org.openrdf.model.Value; import org.openrdf.sail.SailConnection; import com.bigdata.rdf.graph.IGASContext; import com.bigdata.rdf.graph.IGASEngine; import com.bigdata.rdf.graph.IGASState; import com.bigdata.rdf.graph.IGASStats; import com.bigdata.rdf.graph.IGraphAccessor; import com.bigdata.rdf.graph.analytics.CC.VS; import com.bigdata.rdf.graph.impl.sail.AbstractSailGraphTestCase; /** * Test class for Breadth First Search (BFS) traversal. * * @see BFS * * @author <a href="mailto:thompsonbry@users.sourceforge.net">Bryan Thompson</a> */ public class TestCC extends AbstractSailGraphTestCase { public TestCC() { } public TestCC(String name) { super(name); } public void testCC() throws Exception { /* * Load two graphs. These graphs are not connected with one another (no * shared vertices). This means that each graph will be its own * connected component (all vertices in each source graph are * connected within that source graph). */ final SmallGraphProblem p1 = setupSmallGraphProblem(); final SSSPGraphProblem p2 = setupSSSPGraphProblem(); final IGASEngine gasEngine = getGraphFixture() .newGASEngine(1/* nthreads */); try { final SailConnection cxn = getGraphFixture().getSail() .getConnection(); try { final IGraphAccessor graphAccessor = getGraphFixture() .newGraphAccessor(cxn); final CC gasProgram = new CC(); final IGASContext<CC.VS, CC.ES, Value> gasContext = gasEngine .newGASContext(graphAccessor, gasProgram); final IGASState<CC.VS, CC.ES, Value> gasState = gasContext .getGASState(); // Converge. final IGASStats stats = gasContext.call(); if(log.isInfoEnabled()) log.info(stats); /* * Check the #of connected components that are self-reported and * the #of vertices in each connected component. This helps to * detect vertices that should have been visited but were not * due to the initial frontier. E.g., "DC" will not be reported * as a connected component of size (1) unless it gets into the * initial frontier (it has no edges, only an attribute). */ final Map<Value, AtomicInteger> labels = gasProgram .getConnectedComponents(gasState); // the size of the connected component for this vertex. { final VS valueState = gasState.getState(p1.getFoafPerson()); final Value label = valueState != null?valueState.getLabel():null; assertEquals(4, labels.get(label).get()); } // the size of the connected component for this vertex. { final VS valueState = gasState.getState(p2.get_v1()); final Value label = valueState != null?valueState.getLabel():null; final AtomicInteger ai = labels.get(label); final int count = ai!=null?ai.get():-1; assertEquals(5, count); } if (false) { /* * The size of the connected component for this vertex. * * Note: The vertex sampling code ignores self-loops and * ignores vertices that do not have ANY edges. Thus "DC" is * not put into the frontier and is not visited. */ final Value label = gasState.getState(p1.getDC()) .getLabel(); assertNotNull(label); /* * If DC was not put into the initial frontier, then it will * be missing here. */ assertNotNull(labels.get(label)); assertEquals(1, labels.get(label).get()); } // the #of connected components. assertEquals(2, labels.size()); /* * Most vertices in problem1 have the same label (the exception * is DC, which is it its own connected component). */ Value label1 = null; for (Value v : p1.getVertices()) { final CC.VS vs = gasState.getState(v); if (log.isInfoEnabled()) log.info("v=" + v + ", label=" + vs.getLabel()); if(v.equals(p1.getDC())) { /* * This vertex is in its own connected component and is * therefore labeled by itself. */ assertEquals("vertex=" + v, v, vs.getLabel()); continue; } if (label1 == null) { label1 = vs.getLabel(); assertNotNull(label1); } assertEquals("vertex=" + v, label1, vs.getLabel()); } // All vertices in problem2 have the same label. Value label2 = null; for (Value v : p2.getVertices()) { final CC.VS vs = gasState.getState(v); if (log.isInfoEnabled()) log.info("v=" + v + ", label=" + vs.getLabel()); if (label2 == null) { label2 = vs.getLabel(); assertNotNull(label2); } assertEquals("vertex=" + v, label2, vs.getLabel()); } // The labels for the two connected components are distinct. assertNotSame(label1, label2); } finally { try { cxn.rollback(); } finally { cxn.close(); } } } finally { gasEngine.shutdownNow(); } } }
Java
/* * include/linux/dvs_suite.h * * Copyright (C) 2010 Sookyoung Kim <sookyoung.kim@lge.com> */ #ifndef _LINUX_DVS_SUITE_H #define _LINUX_DVS_SUITE_H /*************************************************************************** * Headers ***************************************************************************/ #include <asm/current.h> /* For current macro */ #include <asm/div64.h> /* For division */ #include <linux/mm.h> #include <linux/vmalloc.h> #include <linux/spinlock.h> #include <linux/errno.h> /* For EAGAIN and EWOULDBLOCK */ #include <linux/kernel.h> /* For printk */ #include <linux/sched.h> /* For struct task_struct and wait_event* macros */ #include <linux/slab.h> /* For kmalloc and kfree */ #include <linux/string.h> /* To use string functions */ #include <linux/times.h> /* For struct timeval and do_gettimeofday */ #include <linux/cred.h> /* To get uid */ #include <linux/workqueue.h> #include <plat/omap_device.h> #include <plat/omap-pm.h> /* * Including resource34xx.h here causes build error. * This is the reason why we moved ds_update_cpu_op() from here to resource34xx.c. */ //#include "../../arch/arm/mach-omap2/resource34xx.h" /* For set_opp() */ //#include "../../../system/core/include/private/android_filesystem_config.h" /* For AID_* */ /*************************************************************************** * Definitions ***************************************************************************/ /* The 4 operating points (CPU_OP) supported by Hub (LU3000)'s OMAP3630 CPU_OP 0: (1000 MHz, 1.35V), Scaling factor 1 = 0x1000 in fixed point number CPU_OP 1: ( 800 MHz, 1.26V), Scaling factor 0.8 = 0xccc CPU_OP 2: ( 600 MHz, 1.10V), Scaling factor 0.6 = 0x999 CPU_OP 3: ( 300 MHz, 0.93V), Scaling factor 0.3 = 0x4cc set_opp(&vdd1_opp, VDD1_OPP4) set_opp(&vdd1_opp, VDD1_OPP3) set_opp(&vdd1_opp, VDD1_OPP2) set_opp(&vdd1_opp, VDD1_OPP1) */ /* The number of CPU_OPs to use */ #define DS_CPU_OP_LIMIT 4 /* To cope with touch and key inputs */ #define DS_TOUCH_TIMEOUT_COUNT_MAX 7 /* The CPU_OP indices */ #define DS_CPU_OP_INDEX_0 1000000000 #define DS_CPU_OP_INDEX_1 800000000 #define DS_CPU_OP_INDEX_2 600000000 #define DS_CPU_OP_INDEX_3 300000000 #define DS_CPU_OP_INDEX_MAX DS_CPU_OP_INDEX_0 #define DS_CPU_OP_INDEX_N2MAX DS_CPU_OP_INDEX_1 #define DS_CPU_OP_INDEX_N2MIN DS_CPU_OP_INDEX_2 #define DS_CPU_OP_INDEX_MIN DS_CPU_OP_INDEX_3 /* The scaling factors */ /* These values mean the U(20,12) fixed point numbers' 12bit fractions. * In this format, * ------ Decimal part ------ -- Fraction -- * 1 = 0000 0000 0000 0000 0001 0000 0000 0000 = 0x00001000 * 0.5 = 0000 0000 0000 0000 0000 1000 0000 0000 = 0x00000800 * 0.25 = 0000 0000 0000 0000 0000 0100 0000 0000 = 0x00000400 * 0.125 = 0000 0000 0000 0000 0000 0010 0000 0000 = 0x00000200 * 0.0625 = 0000 0000 0000 0000 0000 0001 0000 0000 = 0x00000100 * 0.03125 = 0000 0000 0000 0000 0000 0000 1000 0000 = 0x00000080 * 0.015625 = 0000 0000 0000 0000 0000 0000 0100 0000 = 0x00000040 * 0.0078125 = 0000 0000 0000 0000 0000 0000 0010 0000 = 0x00000020 * 0.00390625 = 0000 0000 0000 0000 0000 0000 0010 0000 = 0x00000010 * 0.0019553125 = 0000 0000 0000 0000 0000 0000 0010 0000 = 0x00000008 * 0.0009765625 = 0000 0000 0000 0000 0000 0000 0010 0000 = 0x00000004 * 0.00048828125 = 0000 0000 0000 0000 0000 0000 0010 0000 = 0x00000002 * 0.000244140625 = 0000 0000 0000 0000 0000 0000 0010 0000 = 0x00000001 * * Ex) * 0.75 = 0.5 + 0.25 = 0000 0000 0000 0000 0000 1100 0000 0000 = 0x00000c00 */ #define DS_CPU_OP_SF_0 0x1000 // 1 #define DS_CPU_OP_SF_1 0xccc // 0.8 #define DS_CPU_OP_SF_2 0x999 // 0.6 #define DS_CPU_OP_SF_3 0x4cc // 0.3 /* The conversion macros between index and mhz/mv */ #if 0 // To do. The following is for Pentium M #define DS_MHZMV2INDEX(mhz, mv) ((((mhz)/100)<<8)|(((mv)-700)/16)) #endif /* WARNING! Not precise! */ #define DS_INDEX2MHZ(index) \ ((index)==1000000000 ? 1000 : \ ((index)==800000000 ? 800 : \ ((index)==600000000 ? 600 : 300))) #define DS_INDEX2MHZPRECISE(index) \ ((index)==1000000000 ? 1000 : \ ((index)==800000000 ? 800 : \ ((index)==600000000 ? 600 : 300))) #if 0 // To do. The following is for Pentium M #define DS_INDEX2MV(index) (((int)(index)&0xff)*16+700) #endif #define DS_INDEX2NR(index) \ ((index)==1000000000 ? 0 : \ ((index)==800000000 ? 1 : \ ((index)==600000000 ? 2 : 3))) #define DS_INDEX2SF(index) \ ((index)==1000000000 ? 0x1000 : \ ((index)==800000000 ? 0xccc : \ ((index)==600000000 ? 0x999 : 0x4cc))) /* For ds_status.cpu_mode */ #define DS_CPU_MODE_IDLE 0 #define DS_CPU_MODE_TASK 1 #define DS_CPU_MODE_SCHEDULE 2 #define DS_CPU_MODE_DVS_SUITE 4 /* For ds_configuration.sched_scheme */ #define DS_SCHED_LINUX_NATIVE 0 #define DS_SCHED_GPSCHED 1 /* For ds_configuration.dvs_scheme */ // For now, dvs_scheme of Swift is fixed to DS_DVS_GPSCHEDVS. #define DS_DVS_NO_DVS 0 #define DS_DVS_MIN 1 #define DS_DVS_GPSCHEDVS 2 #define DS_DVS_MANUAL 99 /* For do_dvs_suite() */ #define DS_ENTRY_RET_FROM_SYSTEM_CALL 0 #define DS_ENTRY_SWITCH_TO 1 /* The macro to convert an unsigned long type to U(20,12) fixed point. Result is U(20,12) fixed point. */ #define DS_ULONG2FP12(x) ((x)<<12) /* The macro to extract the integer part of the given U(20,12) fixed point number. Result is unsigned long. */ #define DS_GETFP12INT(x) (((x)&0xfffff000)>>12) /* The macro to extract the fraction part of the given U(20,12) fixed point number. Result is U(20,12) fixed point. */ #define DS_GETFP12FRA(x) ((x)&0x00000fff) /* Definitions for compare44bits() */ #define DS_LARGER 1 #define DS_EQUAL 0 #define DS_SMALLER -1 /* A representative HRT task in a Smartphone is voice call. * To do. Implement it in the future. For this time, we ignore such a HRT task. */ #define DS_CONDITION_FOR_HRT 0 /* Process static priority */ #define DS_LINUX_DEFAULT_STATIC_PRIO 120 //#define DS_HRT_STATIC_PRIO 100 // 100 nice -20 #define DS_HRT_STATIC_PRIO 105 // 100 nice -15 #define DS_DBSRT_STATIC_PRIO 110 // 110 nice -10 #define DS_RBSRT_STATIC_PRIO 115 // 115 nice -5 #define DS_NRT_STATIC_PRIO 120 // 120 nice 0 #define DS_IDLE_PRIO 140 //#define DS_HRT_NICE -20 // -20 #define DS_HRT_NICE -15 // -15 #define DS_DBSRT_NICE -10 // -10 #define DS_RBSRT_NICE -5 // -5 #define DS_NRT_NICE 0 // 0 /* Process rt_priority. p->prio = p->normal_prio = 99 - p->rt_priority for SCHED_RR tasks. p->prio = p->normal_prio = p->static_prio for SCHED_NORMAL tasks. */ #define DS_HRT_RR_PRIO 29 // p->prio = 70 #define DS_DBSRT_RR_PRIO 19 // p->prio = 80 #define DS_RBSRT_RR_PRIO 9 // p->prio = 90 /* Scheduler type. */ #define DS_SCHED_NORMAL 0 #define DS_SCHED_RR 1 /* Process type. */ #define DS_HRT_TASK 1 // HRT #define DS_SRT_UI_SERVER_TASK 2 // DBSRT #define DS_SRT_UI_CLIENT_TASK 3 // DBSRT #define DS_SRT_KERNEL_THREAD 4 // RBSRT #define DS_SRT_DAEMON_TASK 5 // RBSRT #define DS_NRT_TASK 6 // NRT #define DS_MIN_RT_SCHED_TYPE DS_SRT_UI_CLIENT_TASK /* If a DS_SRT_UI_CLIENT_TASK does not interact with DS_SRT_UI_SERVER_TASK * for over DS_SRT_UI_IPC_TIMEOUT, we re-define its type. * The new type depends on conditions. */ #define DS_SRT_UI_IPC_NO 3 // #define DS_SRT_UI_IPC_TIMEOUT 500000 // 500 msec. It should not be larger than 1sec. #define DS_TOUCH_TIMEOUT 980000 // 980 msec. Don't touch this. LG standard. /* The maximum allowable number of PID. 0 ~ 32767. */ #define DS_PID_LIMIT 32768 /* Definitions for AIDVS */ /* DS_AIDVS_SPEEDUP_THRESHOLD and DS_AIDVS_SPEEDUP_INTERVAL * should be less than 1000000 */ #define DS_AIDVS_MOVING_AVG_WEIGHT 3 /* 3 */ #define DS_AIDVS_INTERVALS_IN_AN_WINDOW 100 /* 100 intervals in an window */ #define DS_AIDVS_SPEEDUP_THRESHOLD 100000 /* 100 msec in fse */ #define DS_AIDVS_SPEEDUP_INTERVAL 100000 /* 100 msec in fse */ /* Definitions for GPScheDVS */ /* Following THRESHOLD and INTERVAL values should be less than 1000000. */ #define DS_GPSCHEDVS_L0_INTERVALS_IN_AN_WINDOW 100 /* Max. intervals in an window */ #define DS_GPSCHEDVS_L0_MIN_WINDOW_LENGTH 10000 /* 10 msec in elapsed */ #define DS_GPSCHEDVS_L0_SPEEDUP_THRESHOLD 3000 /* 3 msec in fse */ #define DS_GPSCHEDVS_L0_SPEEDUP_INTERVAL 3000 /* 3 msec in fse */ #define DS_GPSCHEDVS_L1_INTERVALS_IN_AN_WINDOW 100 /* Max. intervals in an window */ #define DS_GPSCHEDVS_L1_MIN_WINDOW_LENGTH 30000 /* 25 msec in elapsed */ #define DS_GPSCHEDVS_L1_SPEEDUP_THRESHOLD 5000 /* 5 msec in fse */ #define DS_GPSCHEDVS_L1_SPEEDUP_INTERVAL 5000 /* 5 msec in fse */ #define DS_GPSCHEDVS_L2_INTERVALS_IN_AN_WINDOW 100 /* Max. intervals in an window */ #define DS_GPSCHEDVS_L2_MIN_WINDOW_LENGTH 40000 /* 50 msec in elapsed */ #define DS_GPSCHEDVS_L2_SPEEDUP_THRESHOLD 50000 /* 10 msec in fse */ #define DS_GPSCHEDVS_L2_SPEEDUP_INTERVAL 50000 /* 10 msec in fse */ #define DS_GPSCHEDVS_L3_INTERVALS_IN_AN_WINDOW 100 /* Max. intervals in an window */ #define DS_GPSCHEDVS_L3_MIN_WINDOW_LENGTH 80000 /* 100 msec in elapsed */ #define DS_GPSCHEDVS_L3_SPEEDUP_THRESHOLD 100000 /* 20 msec in fse */ #define DS_GPSCHEDVS_L3_SPEEDUP_INTERVAL 100000 /* 20 msec in fse */ #define DS_MIN_CPU_OP_UPDATE_INTERVAL_U 10000 /* 10 msec */ #define DS_MIN_CPU_OP_UPDATE_INTERVAL_D 10000 /* 10 msec */ #define DS_INIT_DELAY_SEC 20 /* 20 seconds */ #define DS_POST_EARLY_SUSPEND_TIMEOUT_USEC 2000000 /* 2 seconds */ /*************************************************************************** * Variables and data structures ***************************************************************************/ extern struct timeval ds_timeval; typedef struct dvs_suite_configuration DS_CONF; typedef struct dvs_suite_status DS_STAT; typedef struct dvs_suite_counter DS_COUNT; typedef struct dvs_suite_parameter DS_PARAM; typedef struct ds_aidvs_interval_structure DS_AIDVS_INTERVAL_STRUCT; typedef struct ds_aidvs_status_structure DS_AIDVS_STAT_STRUCT; typedef struct ds_aidvs_l3_status_structure DS_AIDVS_L3_STAT_STRUCT; typedef struct ds_aidvs_l2_status_structure DS_AIDVS_L2_STAT_STRUCT; typedef struct ds_aidvs_l1_status_structure DS_AIDVS_L1_STAT_STRUCT; typedef struct ds_aidvs_l0_status_structure DS_AIDVS_L0_STAT_STRUCT; typedef struct ds_gpschedvs_status_structure DS_GPSCHEDVS_STAT_STRUCT; ////////////////////////////////////////////////////////////////////////////////////// /* The dvs_suite configuration structure. All the fields of this structure are adjusted by the Loadable Kernel Module (LKM) dvs_suite_mod. Field dvs_scheme tells the DVS scheme to force. Possible values are as follows: 0: Constantly forcing the maximum CPU_OP., i.e., CPU_OP0. 1: Constantly forcing the minimum CPU_OP., i.e., CPU_OP4 for Swift 2: AIDVS 3: GPScheDVS 99: MANUAL Field on_dvs tells whether to force the chosen DVS scheme or not. If on_dvs is set, the DVS scheme indicated by field dvs_scheme is forced. If on_dvs is reset, the maximum CPU_OP is forced as default. */ struct dvs_suite_configuration { /* For scheduling scheme */ int sched_scheme; /* For dvs_suite */ int dvs_scheme; int on_dvs; /* For DVS schemes */ /* GPSDVS and GPScheDVS strategies 0: System energy centric strategy. 1: CPU power centric strategy. */ int gpsdvs_strategy; int gpschedvs_strategy; int aidvs_interval_window_size; unsigned long aidvs_speedup_threshold; unsigned long aidvs_speedup_interval; }; extern DS_CONF ds_configuration; //////////////////////////////////////////////////////////////////////////////////////////// /* The current system status. Field ds_initialized indicates that whether dvs_suite is initialized or not. The initialization process sets ds_status.cpu_op_index to what the CPU is currently running at. Field flag_time_base_initialized indicates whether tv_usec_base were initialized or not. Field tv_usec_base holds the last read ds_timeval.tv_usec value. We use do_gettimeofday() to get the elapsed real time. Field cpu_op_index indicates the current CPU_OP index. Field cpu_op_index_sf indicates the current CPU_OP scalinf factor. Field cpu_op_index_nr indicates the integer number corresponding to the current CPU_OP index. They are 0 for CPU_OP_INDEX_0, 1 for CPU_OP_INDEX_1, and so forth. Field cpu_op_mhz indicates the MHz value in fixed point format corresponding to the current CPU_OP index. Field cpu_mode indicates the current cpu mode among that cpu is idle (0: DS_CPU_MODE_IDLE), cpu is busy while running a task (1: DS_CPU_MODE_TASK), cpu is busy while performing schedule() (2: DS_CPU_MODE_SCHEDULE), and cpu is busy while running dvs_suite related codes (4: DS_CPU_MODE_DVS_SUITE). Fields current_dvs_scheme and dvs_is_on hold the current state of the corresponding fields in ds_configuration and are used to check if the corresponding feature should be initialized or not. Field flag_just_mm_interacted indicates the fact that the current task just made an interaction with media server for a multimedia transaction. Field flag_just_uie_interacted indicates the fact that the current task just made an interaction with system server for an user input event transaction. Field ms_pid is the pid of media server. Field ss_pid is the pid of system server. Field *pti[DS_PID_LIMIT] is the array holding the pointers to per task information data structures. The index for pti is the PID of tasks. This data structure is used to trace the type of tasks. */ struct dvs_suite_status { int flag_run_dvs; int ds_initialized; int flag_time_base_initialized; unsigned long tv_sec_curr; unsigned long tv_usec_curr; unsigned long tv_sec_base; unsigned long tv_usec_base; unsigned int cpu_op_index; unsigned int cpu_op_sf; int cpu_op_index_nr; int cpu_op_mhz; int cpu_mode; int flag_update_cpu_op; unsigned int target_cpu_op_index; unsigned long cpu_op_last_update_sec; unsigned long cpu_op_last_update_usec; int current_dvs_scheme; int scheduler[DS_PID_LIMIT]; int type[DS_PID_LIMIT]; int type_fixed[DS_PID_LIMIT]; int type_need_to_be_changed[DS_PID_LIMIT]; int tgid[DS_PID_LIMIT]; char tg_owner_comm[DS_PID_LIMIT][16]; int tgid_type_changed[DS_PID_LIMIT]; int tgid_type_change_causer[DS_PID_LIMIT]; unsigned long ipc_timeout_sec[DS_PID_LIMIT]; unsigned long ipc_timeout_usec[DS_PID_LIMIT]; int flag_touch_timeout_count; unsigned long touch_timeout_sec; unsigned long touch_timeout_usec; int flag_mutex_lock_on_clock_state; int mutex_lock_on_clock_state_cnt; int flag_correct_cpu_op_update_path; int flag_post_early_suspend; unsigned long post_early_suspend_sec; unsigned long post_early_suspend_usec; int flag_do_post_early_suspend; unsigned long mpu_min_freq_to_lock; unsigned long l3_min_freq_to_lock; unsigned long iva_min_freq_to_lock; }; extern DS_STAT ds_status; //////////////////////////////////////////////////////////////////////////////////////////// /* The data structure holding various counters. The first type of counters are time counters which holds the fractions of busy (= task + context switch + dvs suite, i.e. the overhead) and idle time at each CPU_OP. Additionally, the full speed equivalent sec and usec values are calculated and stored. fp12_*_fse_fraction holds the fraction smaller than 1 usec in U(20,12) fixed point format. elapsed_sec and elapsed_usec hold the total elapsed time (wall clock time) since the system was booted. The second type of counters hold the occurrence number of certain events such as CPU_OP transitions, schedules, and total number of system calls and interrupts. */ struct dvs_suite_counter { unsigned long elapsed_sec; unsigned long elapsed_usec; #if 0 unsigned long idle_sec[DS_CPU_OP_LIMIT]; unsigned long idle_usec[DS_CPU_OP_LIMIT]; unsigned long idle_total_sec; unsigned long idle_total_usec; unsigned long busy_sec[DS_CPU_OP_LIMIT]; unsigned long busy_usec[DS_CPU_OP_LIMIT]; #endif unsigned long busy_total_sec; unsigned long busy_total_usec; unsigned long busy_fse_sec; unsigned long busy_fse_usec; unsigned long busy_fse_usec_fra_fp12; #if 0 unsigned long busy_task_sec[DS_CPU_OP_LIMIT]; unsigned long busy_task_usec[DS_CPU_OP_LIMIT]; unsigned long busy_task_total_sec; unsigned long busy_task_total_usec; unsigned long busy_task_fse_sec; unsigned long busy_task_fse_usec; unsigned long busy_task_fse_usec_fra_fp12; /* The busy time caused by HRT tasks */ unsigned long busy_hrt_task_sec; unsigned long busy_hrt_task_usec; unsigned long busy_hrt_task_fse_sec; unsigned long busy_hrt_task_fse_usec; unsigned long busy_hrt_task_fse_usec_fra_fp12; /* The busy time caused by DBSRT tasks */ unsigned long busy_dbsrt_task_sec; unsigned long busy_dbsrt_task_usec; unsigned long busy_dbsrt_task_fse_sec; unsigned long busy_dbsrt_task_fse_usec; unsigned long busy_dbsrt_task_fse_usec_fra_fp12; /* The busy time caused by RBSRT tasks */ unsigned long busy_rbsrt_task_sec; unsigned long busy_rbsrt_task_usec; unsigned long busy_rbsrt_task_fse_sec; unsigned long busy_rbsrt_task_fse_usec; unsigned long busy_rbsrt_task_fse_usec_fra_fp12; /* The busy time caused by NRT tasks */ unsigned long busy_nrt_task_sec; unsigned long busy_nrt_task_usec; unsigned long busy_nrt_task_fse_sec; unsigned long busy_nrt_task_fse_usec; unsigned long busy_nrt_task_fse_usec_fra_fp12; unsigned long busy_schedule_sec[DS_CPU_OP_LIMIT]; unsigned long busy_schedule_usec[DS_CPU_OP_LIMIT]; unsigned long busy_schedule_total_sec; unsigned long busy_schedule_total_usec; unsigned long busy_schedule_fse_sec; unsigned long busy_schedule_fse_usec; unsigned long busy_schedule_fse_usec_fra_fp12; unsigned long busy_dvs_suite_sec[DS_CPU_OP_LIMIT]; unsigned long busy_dvs_suite_usec[DS_CPU_OP_LIMIT]; unsigned long busy_dvs_suite_total_sec; unsigned long busy_dvs_suite_total_usec; unsigned long busy_dvs_suite_fse_sec; unsigned long busy_dvs_suite_fse_usec; unsigned long busy_dvs_suite_fse_usec_fra_fp12; unsigned long ds_cpu_op_adjustment_no; unsigned long schedule_no; unsigned long ret_from_system_call_no; #endif }; extern DS_COUNT ds_counter; /* The parameters for do_dvs_suite(). Field entry_type indicates where do_dvs_suite() was called. entry_type DS_ENTRY_RET_FROM_SYSTEM_CALL indicates that do_dvs_suite() was called at the beginning of ENTRY(ret_from_system_call) defined in linux/arch/i386/kernel/entry.S. entry_type DS_ENTRY_SWITCH_TO indicates that do_dvs_suite() was called at the end of __switch_to() macro defined in linux/arch/i386/kernel/process.c. Fields prev_p and next_p are set only before calling do_dvs_suite() in __switch_to() macro. When calling do_dvs_suite() from ENTRY(ret_from_system_call), these fields should be ignored. */ struct dvs_suite_parameter { int entry_type; struct task_struct *prev_p; struct task_struct *next_p; }; extern DS_PARAM ds_parameter; //////////////////////////////////////////////////////////////////////////////////////////// /* * Variables for AIDVS. */ struct ds_aidvs_interval_structure { unsigned long time_usec_interval; unsigned long time_usec_work_fse; unsigned long time_usec_work; // struct ds_aidvs_interval_structure *next; }; struct ds_aidvs_status_structure { int base_initialized; int flag_in_busy_half; unsigned long time_usec_interval; unsigned long time_usec_interval_inc_base; unsigned long time_sec_interval_inc_base; unsigned long time_usec_work_fse; unsigned long time_usec_work_fse_inc_base; unsigned long time_usec_work_fse_lasting; unsigned long time_usec_work; unsigned long time_usec_work_inc_base; unsigned long time_usec_work_lasting; DS_AIDVS_INTERVAL_STRUCT interval_window_array[DS_AIDVS_INTERVALS_IN_AN_WINDOW]; int interval_window_index; // DS_AIDVS_INTERVAL_STRUCT *interval_window_head; // DS_AIDVS_INTERVAL_STRUCT *interval_window_tail; unsigned long time_usec_interval_in_window; unsigned long time_usec_work_fse_in_window; unsigned long time_usec_work_in_window; int consecutive_speedup_count; unsigned long utilization_int_ulong; unsigned long utilization_fra_fp12; unsigned long time_usec_util_calc_base; unsigned long time_sec_util_calc_base; unsigned int cpu_op_index; }; extern DS_AIDVS_STAT_STRUCT ds_aidvs_status; /* * Variables for GPScheDVS. */ struct ds_gpschedvs_status_structure { int current_strategy; /* Workload includes HRT + DBSRT + RBSRT + NRT tasks, i.e., all tasks. */ DS_AIDVS_STAT_STRUCT aidvs_l3_status; /* Workload includes HRT + DBSRT + RBSRT tasks */ DS_AIDVS_STAT_STRUCT aidvs_l2_status; /* Workload includes HRT + DBSRT tasks */ DS_AIDVS_STAT_STRUCT aidvs_l1_status; /* Workload includes HRT tasks */ DS_AIDVS_STAT_STRUCT aidvs_l0_status; }; extern DS_GPSCHEDVS_STAT_STRUCT ds_gpschedvs_status; //////////////////////////////////////////////////////////////////////////////////////////// /* * Other global vairables */ /*************************************************************************** * Function definitions ***************************************************************************/ extern void ds_fpmul12(unsigned long, unsigned long, unsigned long *); extern void ds_fpdiv12(unsigned long, unsigned long, unsigned long *, unsigned long *); extern void ds_div32(unsigned long, unsigned long, unsigned long *, unsigned long *); extern int ds_find_first1_in_integer_part(unsigned long); extern int ds_find_first1_in_fraction_part(unsigned long); extern int ds_compare45bits(int, unsigned long, unsigned long, int, unsigned long, unsigned long); extern int ds_shiftleft44bits(int, unsigned long, unsigned long, int, int *, unsigned long *, unsigned long *); extern int ds_subtract44bits(int, unsigned long, unsigned long, int, unsigned long, unsigned long, int *, unsigned long *, unsigned long *); extern int ds_fpmul(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long *, unsigned long *); extern int ds_fpdiv(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long *, unsigned long *); extern unsigned int ds_get_next_high_cpu_op_index(unsigned long, unsigned long); extern unsigned int ds_get_next_low_cpu_op_index(unsigned long, unsigned long); /* * The functions for each DVS scheme. */ /* AIDVS */ extern int ds_do_dvs_aidvs(unsigned int *, DS_AIDVS_STAT_STRUCT *, int, int, unsigned long, unsigned long, unsigned long); /* GPScheDVS */ extern int ds_do_dvs_gpschedvs(unsigned int *); /* * Wrappers to be used in the existing kernel codes * to call the main dvs suite function. */ extern asmlinkage void ld_update_cpu_op(void); extern int ld_initialize_dvs_suite(int); extern int ld_update_time_counter(void); extern int ld_update_priority_normal(struct task_struct *); extern void ld_do_dvs_suite(void); /* * The main dvs suite function. */ extern int ds_initialize_dvs_suite(int); extern int ds_initialize_iaqos_trace(void); extern int ds_initialize_cmqos_trace(void); extern int ds_initialize_job_trace(void); extern int ds_initialize_dvs_scheme(int); extern int ds_update_time_counter(void); extern int ds_update_priority_normal(struct task_struct *); extern int ds_update_priority_rt(struct task_struct *); //extern void ds_update_cpu_op(void); extern asmlinkage void ds_update_cpu_op(void); extern int ds_detect_task_type(void); extern void do_dvs_suite(void); #endif /* !(_LINUX_DVS_SUITE_H) */
Java
/* * Copyright (C) 2016 robert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package pl.rcebula.code_generation.final_steps; import java.util.ArrayList; import java.util.List; import pl.rcebula.code_generation.intermediate.intermediate_code_structure.IField; import pl.rcebula.code_generation.intermediate.intermediate_code_structure.IntermediateCode; import pl.rcebula.code_generation.intermediate.intermediate_code_structure.Line; import pl.rcebula.code_generation.intermediate.intermediate_code_structure.StringField; /** * * @author robert */ public class AddInformationsAboutModules { private final IntermediateCode ic; private final List<String> modulesName; public AddInformationsAboutModules(IntermediateCode ic, List<String> modulesName) { this.ic = ic; this.modulesName = modulesName; analyse(); } private void analyse() { // tworzymy pola List<IField> fields = new ArrayList<>(); for (String m : modulesName) { IField f = new StringField(m); fields.add(f); } // wstawiamy pustą linię na początek ic.insertLine(Line.generateEmptyStringLine(), 0); // tworzymy linię i wstawiamy na początek Line line = new Line(fields); ic.insertLine(line, 0); } }
Java
/***************************************************************************** Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ /**************************************************//** @file dict/dict0load.c Loads to the memory cache database object definitions from dictionary tables Created 4/24/1996 Heikki Tuuri *******************************************************/ #include "dict0load.h" #include "mysql_version.h" #ifdef UNIV_NONINL #include "dict0load.ic" #endif #include "btr0pcur.h" #include "btr0btr.h" #include "page0page.h" #include "mach0data.h" #include "dict0dict.h" #include "dict0boot.h" #include "rem0cmp.h" #include "srv0start.h" #include "srv0srv.h" #include "ha_prototypes.h" /* innobase_casedn_str() */ /** Following are six InnoDB system tables */ static const char* SYSTEM_TABLE_NAME[] = { "SYS_TABLES", "SYS_INDEXES", "SYS_COLUMNS", "SYS_FIELDS", "SYS_FOREIGN", "SYS_FOREIGN_COLS" }; /****************************************************************//** Compare the name of an index column. @return TRUE if the i'th column of index is 'name'. */ static ibool name_of_col_is( /*===========*/ const dict_table_t* table, /*!< in: table */ const dict_index_t* index, /*!< in: index */ ulint i, /*!< in: index field offset */ const char* name) /*!< in: name to compare to */ { ulint tmp = dict_col_get_no(dict_field_get_col( dict_index_get_nth_field( index, i))); return(strcmp(name, dict_table_get_col_name(table, tmp)) == 0); } /********************************************************************//** Finds the first table name in the given database. @return own: table name, NULL if does not exist; the caller must free the memory in the string! */ UNIV_INTERN char* dict_get_first_table_name_in_db( /*============================*/ const char* name) /*!< in: database name which ends in '/' */ { dict_table_t* sys_tables; btr_pcur_t pcur; dict_index_t* sys_index; dtuple_t* tuple; mem_heap_t* heap; dfield_t* dfield; const rec_t* rec; const byte* field; ulint len; mtr_t mtr; ut_ad(mutex_own(&(dict_sys->mutex))); heap = mem_heap_create(1000); mtr_start(&mtr); sys_tables = dict_table_get_low("SYS_TABLES"); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); ut_a(!dict_table_is_comp(sys_tables)); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); dfield_set_data(dfield, name, ut_strlen(name)); dict_index_copy_types(tuple, sys_index, 1); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); loop: rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur)) { /* Not found */ btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); return(NULL); } field = rec_get_nth_field_old(rec, 0, &len); if (len < strlen(name) || ut_memcmp(name, field, strlen(name)) != 0) { /* Not found */ btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); return(NULL); } if (!rec_get_deleted_flag(rec, 0)) { /* We found one */ char* table_name = mem_strdupl((char*) field, len); btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); return(table_name); } btr_pcur_move_to_next_user_rec(&pcur, &mtr); goto loop; } /********************************************************************//** Prints to the standard output information on all tables found in the data dictionary system table. */ UNIV_INTERN void dict_print(void) /*============*/ { dict_table_t* table; btr_pcur_t pcur; const rec_t* rec; mem_heap_t* heap; mtr_t mtr; /* Enlarge the fatal semaphore wait timeout during the InnoDB table monitor printout */ mutex_enter(&kernel_mutex); srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ mutex_exit(&kernel_mutex); heap = mem_heap_create(1000); mutex_enter(&(dict_sys->mutex)); mtr_start(&mtr); rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES); while (rec) { const char* err_msg; err_msg = dict_process_sys_tables_rec( heap, rec, &table, DICT_TABLE_LOAD_FROM_CACHE | DICT_TABLE_UPDATE_STATS); mtr_commit(&mtr); if (!err_msg) { dict_table_print_low(table); } else { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: %s\n", err_msg); } mem_heap_empty(heap); mtr_start(&mtr); rec = dict_getnext_system(&pcur, &mtr); } mtr_commit(&mtr); mutex_exit(&(dict_sys->mutex)); mem_heap_free(heap); /* Restore the fatal semaphore wait timeout */ mutex_enter(&kernel_mutex); srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ mutex_exit(&kernel_mutex); } /********************************************************************//** This function gets the next system table record as it scans the table. @return the next record if found, NULL if end of scan */ static const rec_t* dict_getnext_system_low( /*====================*/ btr_pcur_t* pcur, /*!< in/out: persistent cursor to the record*/ mtr_t* mtr) /*!< in: the mini-transaction */ { rec_t* rec = NULL; while (!rec || rec_get_deleted_flag(rec, 0)) { btr_pcur_move_to_next_user_rec(pcur, mtr); rec = btr_pcur_get_rec(pcur); if (!btr_pcur_is_on_user_rec(pcur)) { /* end of index */ btr_pcur_close(pcur); return(NULL); } } /* Get a record, let's save the position */ btr_pcur_store_position(pcur, mtr); return(rec); } /********************************************************************//** This function opens a system table, and return the first record. @return first record of the system table */ UNIV_INTERN const rec_t* dict_startscan_system( /*==================*/ btr_pcur_t* pcur, /*!< out: persistent cursor to the record */ mtr_t* mtr, /*!< in: the mini-transaction */ dict_system_id_t system_id) /*!< in: which system table to open */ { dict_table_t* system_table; dict_index_t* clust_index; const rec_t* rec; ut_a(system_id < SYS_NUM_SYSTEM_TABLES); system_table = dict_table_get_low(SYSTEM_TABLE_NAME[system_id]); clust_index = UT_LIST_GET_FIRST(system_table->indexes); btr_pcur_open_at_index_side(TRUE, clust_index, BTR_SEARCH_LEAF, pcur, TRUE, mtr); rec = dict_getnext_system_low(pcur, mtr); return(rec); } /********************************************************************//** This function gets the next system table record as it scans the table. @return the next record if found, NULL if end of scan */ UNIV_INTERN const rec_t* dict_getnext_system( /*================*/ btr_pcur_t* pcur, /*!< in/out: persistent cursor to the record */ mtr_t* mtr) /*!< in: the mini-transaction */ { const rec_t* rec; /* Restore the position */ btr_pcur_restore_position(BTR_SEARCH_LEAF, pcur, mtr); /* Get the next record */ rec = dict_getnext_system_low(pcur, mtr); return(rec); } /********************************************************************//** This function processes one SYS_TABLES record and populate the dict_table_t struct for the table. Extracted out of dict_print() to be used by both monitor table output and information schema innodb_sys_tables output. @return error message, or NULL on success */ UNIV_INTERN const char* dict_process_sys_tables_rec( /*========================*/ mem_heap_t* heap, /*!< in/out: temporary memory heap */ const rec_t* rec, /*!< in: SYS_TABLES record */ dict_table_t** table, /*!< out: dict_table_t to fill */ dict_table_info_t status) /*!< in: status bit controls options such as whether we shall look for dict_table_t from cache first */ { ulint len; const char* field; const char* err_msg = NULL; char* table_name; field = (const char*) rec_get_nth_field_old(rec, 0, &len); ut_a(!rec_get_deleted_flag(rec, 0)); /* Get the table name */ table_name = mem_heap_strdupl(heap, field, len); /* If DICT_TABLE_LOAD_FROM_CACHE is set, first check whether there is cached dict_table_t struct first */ if (status & DICT_TABLE_LOAD_FROM_CACHE) { *table = dict_table_get_low(table_name); if (!(*table)) { err_msg = "Table not found in cache"; } } else { err_msg = dict_load_table_low(table_name, rec, table); } if (err_msg) { return(err_msg); } if ((status & DICT_TABLE_UPDATE_STATS) && dict_table_get_first_index(*table)) { /* Update statistics if DICT_TABLE_UPDATE_STATS is set */ dict_update_statistics(*table, FALSE /* update even if initialized */); } return(NULL); } /********************************************************************//** This function parses a SYS_INDEXES record and populate a dict_index_t structure with the information from the record. For detail information about SYS_INDEXES fields, please refer to dict_boot() function. @return error message, or NULL on success */ UNIV_INTERN const char* dict_process_sys_indexes_rec( /*=========================*/ mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_INDEXES rec */ dict_index_t* index, /*!< out: index to be filled */ table_id_t* table_id) /*!< out: index table id */ { const char* err_msg; byte* buf; buf = mem_heap_alloc(heap, 8); /* Parse the record, and get "dict_index_t" struct filled */ err_msg = dict_load_index_low(buf, NULL, heap, rec, FALSE, &index); *table_id = mach_read_from_8(buf); return(err_msg); } /********************************************************************//** This function parses a SYS_COLUMNS record and populate a dict_column_t structure with the information from the record. @return error message, or NULL on success */ UNIV_INTERN const char* dict_process_sys_columns_rec( /*=========================*/ mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_COLUMNS rec */ dict_col_t* column, /*!< out: dict_col_t to be filled */ table_id_t* table_id, /*!< out: table id */ const char** col_name) /*!< out: column name */ { const char* err_msg; /* Parse the record, and get "dict_col_t" struct filled */ err_msg = dict_load_column_low(NULL, heap, column, table_id, col_name, rec); return(err_msg); } /********************************************************************//** This function parses a SYS_FIELDS record and populates a dict_field_t structure with the information from the record. @return error message, or NULL on success */ UNIV_INTERN const char* dict_process_sys_fields_rec( /*========================*/ mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_FIELDS rec */ dict_field_t* sys_field, /*!< out: dict_field_t to be filled */ ulint* pos, /*!< out: Field position */ index_id_t* index_id, /*!< out: current index id */ index_id_t last_id) /*!< in: previous index id */ { byte* buf; byte* last_index_id; const char* err_msg; buf = mem_heap_alloc(heap, 8); last_index_id = mem_heap_alloc(heap, 8); mach_write_to_8(last_index_id, last_id); err_msg = dict_load_field_low(buf, NULL, sys_field, pos, last_index_id, heap, rec, NULL, 0); *index_id = mach_read_from_8(buf); return(err_msg); } #ifdef FOREIGN_NOT_USED /********************************************************************//** This function parses a SYS_FOREIGN record and populate a dict_foreign_t structure with the information from the record. For detail information about SYS_FOREIGN fields, please refer to dict_load_foreign() function. @return error message, or NULL on success */ UNIV_INTERN const char* dict_process_sys_foreign_rec( /*=========================*/ mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_FOREIGN rec */ dict_foreign_t* foreign) /*!< out: dict_foreign_t struct to be filled */ { ulint len; const byte* field; ulint n_fields_and_type; if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) { return("delete-marked record in SYS_FOREIGN"); } if (UNIV_UNLIKELY(rec_get_n_fields_old(rec) != 6)) { return("wrong number of columns in SYS_FOREIGN record"); } field = rec_get_nth_field_old(rec, 0/*ID*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { err_len: return("incorrect column length in SYS_FOREIGN"); } /* This recieves a dict_foreign_t* that points to a stack variable. So mem_heap_free(foreign->heap) is not used as elsewhere. Since the heap used here is freed elsewhere, foreign->heap is not assigned. */ foreign->id = mem_heap_strdupl(heap, (const char*) field, len); rec_get_nth_field_offs_old(rec, 1/*DB_TRX_ID*/, &len); if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) { goto err_len; } rec_get_nth_field_offs_old(rec, 2/*DB_ROLL_PTR*/, &len); if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) { goto err_len; } /* The _lookup versions of the referenced and foreign table names are not assigned since they are not used in this dict_foreign_t */ field = rec_get_nth_field_old(rec, 3/*FOR_NAME*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { goto err_len; } foreign->foreign_table_name = mem_heap_strdupl( heap, (const char*) field, len); field = rec_get_nth_field_old(rec, 4/*REF_NAME*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { goto err_len; } foreign->referenced_table_name = mem_heap_strdupl( heap, (const char*) field, len); field = rec_get_nth_field_old(rec, 5/*N_COLS*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } n_fields_and_type = mach_read_from_4(field); foreign->type = (unsigned int) (n_fields_and_type >> 24); foreign->n_fields = (unsigned int) (n_fields_and_type & 0x3FFUL); return(NULL); } #endif /* FOREIGN_NOT_USED */ #ifdef FOREIGN_NOT_USED /********************************************************************//** This function parses a SYS_FOREIGN_COLS record and extract necessary information from the record and return to caller. @return error message, or NULL on success */ UNIV_INTERN const char* dict_process_sys_foreign_col_rec( /*=============================*/ mem_heap_t* heap, /*!< in/out: heap memory */ const rec_t* rec, /*!< in: current SYS_FOREIGN_COLS rec */ const char** name, /*!< out: foreign key constraint name */ const char** for_col_name, /*!< out: referencing column name */ const char** ref_col_name, /*!< out: referenced column name in referenced table */ ulint* pos) /*!< out: column position */ { ulint len; const byte* field; if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) { return("delete-marked record in SYS_FOREIGN_COLS"); } if (UNIV_UNLIKELY(rec_get_n_fields_old(rec) != 6)) { return("wrong number of columns in SYS_FOREIGN_COLS record"); } field = rec_get_nth_field_old(rec, 0/*ID*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { err_len: return("incorrect column length in SYS_FOREIGN_COLS"); } *name = mem_heap_strdupl(heap, (char*) field, len); field = rec_get_nth_field_old(rec, 1/*POS*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } *pos = mach_read_from_4(field); rec_get_nth_field_offs_old(rec, 2/*DB_TRX_ID*/, &len); if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) { goto err_len; } rec_get_nth_field_offs_old(rec, 3/*DB_ROLL_PTR*/, &len); if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) { goto err_len; } field = rec_get_nth_field_old(rec, 4/*FOR_COL_NAME*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { goto err_len; } *for_col_name = mem_heap_strdupl(heap, (char*) field, len); field = rec_get_nth_field_old(rec, 5/*REF_COL_NAME*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { goto err_len; } *ref_col_name = mem_heap_strdupl(heap, (char*) field, len); return(NULL); } #endif /* FOREIGN_NOT_USED */ /********************************************************************//** Determine the flags of a table described in SYS_TABLES. @return compressed page size in kilobytes; or 0 if the tablespace is uncompressed, ULINT_UNDEFINED on error */ static ulint dict_sys_tables_get_flags( /*======================*/ const rec_t* rec) /*!< in: a record of SYS_TABLES */ { const byte* field; ulint len; ulint n_cols; ulint flags; field = rec_get_nth_field_old(rec, 5, &len); ut_a(len == 4); flags = mach_read_from_4(field); if (UNIV_LIKELY(flags == DICT_TABLE_ORDINARY)) { return(0); } field = rec_get_nth_field_old(rec, 4/*N_COLS*/, &len); n_cols = mach_read_from_4(field); if (UNIV_UNLIKELY(!(n_cols & 0x80000000UL))) { /* New file formats require ROW_FORMAT=COMPACT. */ return(ULINT_UNDEFINED); } switch (flags & (DICT_TF_FORMAT_MASK | DICT_TF_COMPACT)) { default: case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT: case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT | DICT_TF_COMPACT: /* flags should be DICT_TABLE_ORDINARY, or DICT_TF_FORMAT_MASK should be nonzero. */ return(ULINT_UNDEFINED); case DICT_TF_FORMAT_ZIP << DICT_TF_FORMAT_SHIFT | DICT_TF_COMPACT: #if DICT_TF_FORMAT_MAX > DICT_TF_FORMAT_ZIP # error "missing case labels for DICT_TF_FORMAT_ZIP .. DICT_TF_FORMAT_MAX" #endif /* We support this format. */ break; } if (UNIV_UNLIKELY((flags & DICT_TF_ZSSIZE_MASK) > (DICT_TF_ZSSIZE_MAX << DICT_TF_ZSSIZE_SHIFT))) { /* Unsupported compressed page size. */ return(ULINT_UNDEFINED); } if (UNIV_UNLIKELY(flags & (~0 << DICT_TF_BITS))) { /* Some unused bits are set. */ return(ULINT_UNDEFINED); } return(flags); } /********************************************************************//** In a crash recovery we already have all the tablespace objects created. This function compares the space id information in the InnoDB data dictionary to what we already read with fil_load_single_table_tablespaces(). In a normal startup, we create the tablespace objects for every table in InnoDB's data dictionary, if the corresponding .ibd file exists. We also scan the biggest space id, and store it to fil_system. */ UNIV_INTERN void dict_check_tablespaces_and_store_max_id( /*====================================*/ ibool in_crash_recovery) /*!< in: are we doing a crash recovery */ { dict_table_t* sys_tables; dict_index_t* sys_index; btr_pcur_t pcur; const rec_t* rec; ulint max_space_id; mtr_t mtr; mutex_enter(&(dict_sys->mutex)); mtr_start(&mtr); sys_tables = dict_table_get_low("SYS_TABLES"); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); ut_a(!dict_table_is_comp(sys_tables)); max_space_id = mtr_read_ulint(dict_hdr_get(&mtr) + DICT_HDR_MAX_SPACE_ID, MLOG_4BYTES, &mtr); fil_set_max_space_id_if_bigger(max_space_id); btr_pcur_open_at_index_side(TRUE, sys_index, BTR_SEARCH_LEAF, &pcur, TRUE, &mtr); loop: btr_pcur_move_to_next_user_rec(&pcur, &mtr); rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur)) { /* end of index */ btr_pcur_close(&pcur); mtr_commit(&mtr); /* We must make the tablespace cache aware of the biggest known space id */ /* printf("Biggest space id in data dictionary %lu\n", max_space_id); */ fil_set_max_space_id_if_bigger(max_space_id); mutex_exit(&(dict_sys->mutex)); return; } if (!rec_get_deleted_flag(rec, 0)) { /* We found one */ const byte* field; ulint len; ulint space_id; ulint flags; char* name; field = rec_get_nth_field_old(rec, 0, &len); name = mem_strdupl((char*) field, len); flags = dict_sys_tables_get_flags(rec); if (UNIV_UNLIKELY(flags == ULINT_UNDEFINED)) { field = rec_get_nth_field_old(rec, 5, &len); flags = mach_read_from_4(field); ut_print_timestamp(stderr); fputs(" InnoDB: Error: table ", stderr); ut_print_filename(stderr, name); fprintf(stderr, "\n" "InnoDB: in InnoDB data dictionary" " has unknown type %lx.\n", (ulong) flags); goto loop; } field = rec_get_nth_field_old(rec, 9, &len); ut_a(len == 4); space_id = mach_read_from_4(field); btr_pcur_store_position(&pcur, &mtr); mtr_commit(&mtr); if (space_id == 0) { /* The system tablespace always exists. */ } else if (in_crash_recovery) { /* Check that the tablespace (the .ibd file) really exists; print a warning to the .err log if not. Do not print warnings for temporary tables. */ ibool is_temp; field = rec_get_nth_field_old(rec, 4, &len); if (0x80000000UL & mach_read_from_4(field)) { /* ROW_FORMAT=COMPACT: read the is_temp flag from SYS_TABLES.MIX_LEN. */ field = rec_get_nth_field_old(rec, 7, &len); is_temp = mach_read_from_4(field) & DICT_TF2_TEMPORARY; } else { /* For tables created with old versions of InnoDB, SYS_TABLES.MIX_LEN may contain garbage. Such tables would always be in ROW_FORMAT=REDUNDANT. Pretend that all such tables are non-temporary. That is, do not suppress error printouts about temporary tables not being found. */ is_temp = FALSE; } fil_space_for_table_exists_in_mem( space_id, name, is_temp, TRUE, !is_temp); } else { /* It is a normal database startup: create the space object and check that the .ibd file exists. */ fil_open_single_table_tablespace(FALSE, space_id, flags, name); } mem_free(name); if (space_id > max_space_id) { max_space_id = space_id; } mtr_start(&mtr); btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr); } goto loop; } /********************************************************************//** Loads a table column definition from a SYS_COLUMNS record to dict_table_t. @return error message, or NULL on success */ UNIV_INTERN const char* dict_load_column_low( /*=================*/ dict_table_t* table, /*!< in/out: table, could be NULL if we just populate a dict_column_t struct with information from a SYS_COLUMNS record */ mem_heap_t* heap, /*!< in/out: memory heap for temporary storage */ dict_col_t* column, /*!< out: dict_column_t to fill, or NULL if table != NULL */ table_id_t* table_id, /*!< out: table id */ const char** col_name, /*!< out: column name */ const rec_t* rec) /*!< in: SYS_COLUMNS record */ { char* name; const byte* field; ulint len; ulint mtype; ulint prtype; ulint col_len; ulint pos; ut_ad(table || column); if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) { return("delete-marked record in SYS_COLUMNS"); } if (UNIV_UNLIKELY(rec_get_n_fields_old(rec) != 9)) { return("wrong number of columns in SYS_COLUMNS record"); } field = rec_get_nth_field_old(rec, 0/*TABLE_ID*/, &len); if (UNIV_UNLIKELY(len != 8)) { err_len: return("incorrect column length in SYS_COLUMNS"); } if (table_id) { *table_id = mach_read_from_8(field); } else if (UNIV_UNLIKELY(table->id != mach_read_from_8(field))) { return("SYS_COLUMNS.TABLE_ID mismatch"); } field = rec_get_nth_field_old(rec, 1/*POS*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } pos = mach_read_from_4(field); if (UNIV_UNLIKELY(table && table->n_def != pos)) { return("SYS_COLUMNS.POS mismatch"); } rec_get_nth_field_offs_old(rec, 2/*DB_TRX_ID*/, &len); if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) { goto err_len; } rec_get_nth_field_offs_old(rec, 3/*DB_ROLL_PTR*/, &len); if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) { goto err_len; } field = rec_get_nth_field_old(rec, 4/*NAME*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { goto err_len; } name = mem_heap_strdupl(heap, (const char*) field, len); if (col_name) { *col_name = name; } field = rec_get_nth_field_old(rec, 5/*MTYPE*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } mtype = mach_read_from_4(field); field = rec_get_nth_field_old(rec, 6/*PRTYPE*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } prtype = mach_read_from_4(field); if (dtype_get_charset_coll(prtype) == 0 && dtype_is_string_type(mtype)) { /* The table was created with < 4.1.2. */ if (dtype_is_binary_string_type(mtype, prtype)) { /* Use the binary collation for string columns of binary type. */ prtype = dtype_form_prtype( prtype, DATA_MYSQL_BINARY_CHARSET_COLL); } else { /* Use the default charset for other than binary columns. */ prtype = dtype_form_prtype( prtype, data_mysql_default_charset_coll); } } field = rec_get_nth_field_old(rec, 7/*LEN*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } col_len = mach_read_from_4(field); field = rec_get_nth_field_old(rec, 8/*PREC*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } if (!column) { dict_mem_table_add_col(table, heap, name, mtype, prtype, col_len); } else { dict_mem_fill_column_struct(column, pos, mtype, prtype, col_len); } return(NULL); } /********************************************************************//** Loads definitions for table columns. */ static void dict_load_columns( /*==============*/ dict_table_t* table, /*!< in/out: table */ mem_heap_t* heap) /*!< in/out: memory heap for temporary storage */ { dict_table_t* sys_columns; dict_index_t* sys_index; btr_pcur_t pcur; dtuple_t* tuple; dfield_t* dfield; const rec_t* rec; byte* buf; ulint i; mtr_t mtr; ut_ad(mutex_own(&(dict_sys->mutex))); mtr_start(&mtr); sys_columns = dict_table_get_low("SYS_COLUMNS"); sys_index = UT_LIST_GET_FIRST(sys_columns->indexes); ut_a(!dict_table_is_comp(sys_columns)); ut_a(name_of_col_is(sys_columns, sys_index, 4, "NAME")); ut_a(name_of_col_is(sys_columns, sys_index, 8, "PREC")); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); buf = mem_heap_alloc(heap, 8); mach_write_to_8(buf, table->id); dfield_set_data(dfield, buf, 8); dict_index_copy_types(tuple, sys_index, 1); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); for (i = 0; i + DATA_N_SYS_COLS < (ulint) table->n_cols; i++) { const char* err_msg; rec = btr_pcur_get_rec(&pcur); ut_a(btr_pcur_is_on_user_rec(&pcur)); err_msg = dict_load_column_low(table, heap, NULL, NULL, NULL, rec); if (err_msg) { fprintf(stderr, "InnoDB: %s\n", err_msg); ut_error; } btr_pcur_move_to_next_user_rec(&pcur, &mtr); } btr_pcur_close(&pcur); mtr_commit(&mtr); } /** Error message for a delete-marked record in dict_load_field_low() */ static const char* dict_load_field_del = "delete-marked record in SYS_FIELDS"; static const char* dict_load_field_too_big = "column prefix exceeds maximum" " limit"; /********************************************************************//** Loads an index field definition from a SYS_FIELDS record to dict_index_t. @return error message, or NULL on success */ UNIV_INTERN const char* dict_load_field_low( /*================*/ byte* index_id, /*!< in/out: index id (8 bytes) an "in" value if index != NULL and "out" if index == NULL */ dict_index_t* index, /*!< in/out: index, could be NULL if we just populate a dict_field_t struct with information from a SYS_FIELDSS record */ dict_field_t* sys_field, /*!< out: dict_field_t to be filled */ ulint* pos, /*!< out: Field position */ byte* last_index_id, /*!< in: last index id */ mem_heap_t* heap, /*!< in/out: memory heap for temporary storage */ const rec_t* rec, /*!< in: SYS_FIELDS record */ char* addition_err_str,/*!< out: additional error message that requires information to be filled, or NULL */ ulint err_str_len) /*!< in: length of addition_err_str in bytes */ { const byte* field; ulint len; ulint pos_and_prefix_len; ulint prefix_len; ibool first_field; ulint position; /* Either index or sys_field is supplied, not both */ ut_a((!index) || (!sys_field)); if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) { return(dict_load_field_del); } if (UNIV_UNLIKELY(rec_get_n_fields_old(rec) != 5)) { return("wrong number of columns in SYS_FIELDS record"); } field = rec_get_nth_field_old(rec, 0/*INDEX_ID*/, &len); if (UNIV_UNLIKELY(len != 8)) { err_len: return("incorrect column length in SYS_FIELDS"); } if (!index) { ut_a(last_index_id); memcpy(index_id, (const char*)field, 8); first_field = memcmp(index_id, last_index_id, 8); } else { first_field = (index->n_def == 0); if (memcmp(field, index_id, 8)) { return("SYS_FIELDS.INDEX_ID mismatch"); } } field = rec_get_nth_field_old(rec, 1/*POS*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } rec_get_nth_field_offs_old(rec, 2/*DB_TRX_ID*/, &len); if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) { goto err_len; } rec_get_nth_field_offs_old(rec, 3/*DB_ROLL_PTR*/, &len); if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) { goto err_len; } /* The next field stores the field position in the index and a possible column prefix length if the index field does not contain the whole column. The storage format is like this: if there is at least one prefix field in the index, then the HIGH 2 bytes contain the field number (index->n_def) and the low 2 bytes the prefix length for the field. Otherwise the field number (index->n_def) is contained in the 2 LOW bytes. */ pos_and_prefix_len = mach_read_from_4(field); if (index && UNIV_UNLIKELY ((pos_and_prefix_len & 0xFFFFUL) != index->n_def && (pos_and_prefix_len >> 16 & 0xFFFF) != index->n_def)) { return("SYS_FIELDS.POS mismatch"); } if (first_field || pos_and_prefix_len > 0xFFFFUL) { prefix_len = pos_and_prefix_len & 0xFFFFUL; position = (pos_and_prefix_len & 0xFFFF0000UL) >> 16; } else { prefix_len = 0; position = pos_and_prefix_len & 0xFFFFUL; } field = rec_get_nth_field_old(rec, 4, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { goto err_len; } if (prefix_len > REC_VERSION_56_MAX_INDEX_COL_LEN) { if (addition_err_str) { ut_snprintf(addition_err_str, err_str_len, "index field '%s' has a prefix length" " of %lu bytes", mem_heap_strdupl( heap, (const char*) field, len), (ulong) prefix_len); } return(dict_load_field_too_big); } if (index) { dict_mem_index_add_field( index, mem_heap_strdupl(heap, (const char*) field, len), prefix_len); } else { ut_a(sys_field); ut_a(pos); sys_field->name = mem_heap_strdupl( heap, (const char*) field, len); sys_field->prefix_len = prefix_len; *pos = position; } return(NULL); } /********************************************************************//** Loads definitions for index fields. @return DB_SUCCESS if ok, DB_CORRUPTION if corruption */ static ulint dict_load_fields( /*=============*/ dict_index_t* index, /*!< in/out: index whose fields to load */ mem_heap_t* heap) /*!< in: memory heap for temporary storage */ { dict_table_t* sys_fields; dict_index_t* sys_index; btr_pcur_t pcur; dtuple_t* tuple; dfield_t* dfield; const rec_t* rec; byte* buf; ulint i; mtr_t mtr; ulint error; ut_ad(mutex_own(&(dict_sys->mutex))); mtr_start(&mtr); sys_fields = dict_table_get_low("SYS_FIELDS"); sys_index = UT_LIST_GET_FIRST(sys_fields->indexes); ut_a(!dict_table_is_comp(sys_fields)); ut_a(name_of_col_is(sys_fields, sys_index, 4, "COL_NAME")); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); buf = mem_heap_alloc(heap, 8); mach_write_to_8(buf, index->id); dfield_set_data(dfield, buf, 8); dict_index_copy_types(tuple, sys_index, 1); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); for (i = 0; i < index->n_fields; i++) { const char* err_msg; char addition_err_str[1024]; rec = btr_pcur_get_rec(&pcur); ut_a(btr_pcur_is_on_user_rec(&pcur)); err_msg = dict_load_field_low(buf, index, NULL, NULL, NULL, heap, rec, addition_err_str, sizeof(addition_err_str)); if (err_msg == dict_load_field_del) { /* There could be delete marked records in SYS_FIELDS because SYS_FIELDS.INDEX_ID can be updated by ALTER TABLE ADD INDEX. */ goto next_rec; } else if (err_msg) { if (err_msg == dict_load_field_too_big) { fprintf(stderr, "InnoDB: Error: load index" " '%s' failed.\n" "InnoDB: %s,\n" "InnoDB: which exceeds the" " maximum limit of %lu bytes.\n" "InnoDB: Please use server that" " supports long index prefix\n" "InnoDB: or turn on" " innodb_force_recovery to load" " the table\n", index->name, addition_err_str, (ulong) (REC_VERSION_56_MAX_INDEX_COL_LEN)); } else { fprintf(stderr, "InnoDB: %s\n", err_msg); } error = DB_CORRUPTION; goto func_exit; } next_rec: btr_pcur_move_to_next_user_rec(&pcur, &mtr); } error = DB_SUCCESS; func_exit: btr_pcur_close(&pcur); mtr_commit(&mtr); return(error); } /** Error message for a delete-marked record in dict_load_index_low() */ static const char* dict_load_index_del = "delete-marked record in SYS_INDEXES"; /** Error message for table->id mismatch in dict_load_index_low() */ static const char* dict_load_index_id_err = "SYS_INDEXES.TABLE_ID mismatch"; /********************************************************************//** Loads an index definition from a SYS_INDEXES record to dict_index_t. If allocate=TRUE, we will create a dict_index_t structure and fill it accordingly. If allocated=FALSE, the dict_index_t will be supplied by the caller and filled with information read from the record. @return error message, or NULL on success */ UNIV_INTERN const char* dict_load_index_low( /*================*/ byte* table_id, /*!< in/out: table id (8 bytes), an "in" value if allocate=TRUE and "out" when allocate=FALSE */ const char* table_name, /*!< in: table name */ mem_heap_t* heap, /*!< in/out: temporary memory heap */ const rec_t* rec, /*!< in: SYS_INDEXES record */ ibool allocate, /*!< in: TRUE=allocate *index, FALSE=fill in a pre-allocated *index */ dict_index_t** index) /*!< out,own: index, or NULL */ { const byte* field; ulint len; ulint name_len; char* name_buf; index_id_t id; ulint n_fields; ulint type; ulint space; if (allocate) { /* If allocate=TRUE, no dict_index_t will be supplied. Initialize "*index" to NULL */ *index = NULL; } if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) { return(dict_load_index_del); } if (UNIV_UNLIKELY(rec_get_n_fields_old(rec) != 9)) { return("wrong number of columns in SYS_INDEXES record"); } field = rec_get_nth_field_old(rec, 0/*TABLE_ID*/, &len); if (UNIV_UNLIKELY(len != 8)) { err_len: return("incorrect column length in SYS_INDEXES"); } if (!allocate) { /* We are reading a SYS_INDEXES record. Copy the table_id */ memcpy(table_id, (const char*)field, 8); } else if (memcmp(field, table_id, 8)) { /* Caller supplied table_id, verify it is the same id as on the index record */ return(dict_load_index_id_err); } field = rec_get_nth_field_old(rec, 1/*ID*/, &len); if (UNIV_UNLIKELY(len != 8)) { goto err_len; } id = mach_read_from_8(field); rec_get_nth_field_offs_old(rec, 2/*DB_TRX_ID*/, &len); if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) { goto err_len; } rec_get_nth_field_offs_old(rec, 3/*DB_ROLL_PTR*/, &len); if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) { goto err_len; } field = rec_get_nth_field_old(rec, 4/*NAME*/, &name_len); if (UNIV_UNLIKELY(name_len == UNIV_SQL_NULL)) { goto err_len; } name_buf = mem_heap_strdupl(heap, (const char*) field, name_len); field = rec_get_nth_field_old(rec, 5/*N_FIELDS*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } n_fields = mach_read_from_4(field); field = rec_get_nth_field_old(rec, 6/*TYPE*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } type = mach_read_from_4(field); field = rec_get_nth_field_old(rec, 7/*SPACE*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } space = mach_read_from_4(field); field = rec_get_nth_field_old(rec, 8/*PAGE_NO*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } if (allocate) { *index = dict_mem_index_create(table_name, name_buf, space, type, n_fields); } else { ut_a(*index); dict_mem_fill_index_struct(*index, NULL, NULL, name_buf, space, type, n_fields); } (*index)->id = id; (*index)->page = mach_read_from_4(field); ut_ad((*index)->page); return(NULL); } /********************************************************************//** Loads definitions for table indexes. Adds them to the data dictionary cache. @return DB_SUCCESS if ok, DB_CORRUPTION if corruption of dictionary table or DB_UNSUPPORTED if table has unknown index type */ static ulint dict_load_indexes( /*==============*/ dict_table_t* table, /*!< in/out: table */ mem_heap_t* heap, /*!< in: memory heap for temporary storage */ dict_err_ignore_t ignore_err) /*!< in: error to be ignored when loading the index definition */ { dict_table_t* sys_indexes; dict_index_t* sys_index; btr_pcur_t pcur; dtuple_t* tuple; dfield_t* dfield; const rec_t* rec; byte* buf; mtr_t mtr; ulint error = DB_SUCCESS; ut_ad(mutex_own(&(dict_sys->mutex))); mtr_start(&mtr); sys_indexes = dict_table_get_low("SYS_INDEXES"); sys_index = UT_LIST_GET_FIRST(sys_indexes->indexes); ut_a(!dict_table_is_comp(sys_indexes)); ut_a(name_of_col_is(sys_indexes, sys_index, 4, "NAME")); ut_a(name_of_col_is(sys_indexes, sys_index, 8, "PAGE_NO")); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); buf = mem_heap_alloc(heap, 8); mach_write_to_8(buf, table->id); dfield_set_data(dfield, buf, 8); dict_index_copy_types(tuple, sys_index, 1); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); for (;;) { dict_index_t* index = NULL; const char* err_msg; if (!btr_pcur_is_on_user_rec(&pcur)) { break; } rec = btr_pcur_get_rec(&pcur); err_msg = dict_load_index_low(buf, table->name, heap, rec, TRUE, &index); ut_ad((index == NULL) == (err_msg != NULL)); if (err_msg == dict_load_index_id_err) { /* TABLE_ID mismatch means that we have run out of index definitions for the table. */ break; } else if (err_msg == dict_load_index_del) { /* Skip delete-marked records. */ goto next_rec; } else if (err_msg) { fprintf(stderr, "InnoDB: %s\n", err_msg); error = DB_CORRUPTION; goto func_exit; } ut_ad(index); /* We check for unsupported types first, so that the subsequent checks are relevant for the supported types. */ if (index->type & ~(DICT_CLUSTERED | DICT_UNIQUE)) { fprintf(stderr, "InnoDB: Error: unknown type %lu" " of index %s of table %s\n", (ulong) index->type, index->name, table->name); error = DB_UNSUPPORTED; dict_mem_index_free(index); goto func_exit; } else if (index->page == FIL_NULL) { fprintf(stderr, "InnoDB: Error: trying to load index %s" " for table %s\n" "InnoDB: but the index tree has been freed!\n", index->name, table->name); if (ignore_err & DICT_ERR_IGNORE_INDEX_ROOT) { /* If caller can tolerate this error, we will continue to load the index and let caller deal with this error. However mark the index and table corrupted */ index->corrupted = TRUE; table->corrupted = TRUE; fprintf(stderr, "InnoDB: Index is corrupt but forcing" " load into data dictionary\n"); } else { corrupted: dict_mem_index_free(index); error = DB_CORRUPTION; goto func_exit; } } else if (!dict_index_is_clust(index) && NULL == dict_table_get_first_index(table)) { fputs("InnoDB: Error: trying to load index ", stderr); ut_print_name(stderr, NULL, FALSE, index->name); fputs(" for table ", stderr); ut_print_name(stderr, NULL, TRUE, table->name); fputs("\nInnoDB: but the first index" " is not clustered!\n", stderr); goto corrupted; } else if (table->id < DICT_HDR_FIRST_ID && (dict_index_is_clust(index) || ((table == dict_sys->sys_tables) && !strcmp("ID_IND", index->name)))) { /* The index was created in memory already at booting of the database server */ dict_mem_index_free(index); } else { error = dict_load_fields(index, heap); if (error != DB_SUCCESS) { fprintf(stderr, "InnoDB: Error: load index '%s'" " for table '%s' failed\n", index->name, table->name); /* If the force recovery flag is set, and if the failed index is not the primary index, we will continue and open other indexes */ if (srv_force_recovery && !dict_index_is_clust(index)) { error = DB_SUCCESS; goto next_rec; } else { goto func_exit; } } error = dict_index_add_to_cache(table, index, index->page, FALSE); /* The data dictionary tables should never contain invalid index definitions. If we ignored this error and simply did not load this index definition, the .frm file would disagree with the index definitions inside InnoDB. */ if (UNIV_UNLIKELY(error != DB_SUCCESS)) { goto func_exit; } } next_rec: btr_pcur_move_to_next_user_rec(&pcur, &mtr); } func_exit: btr_pcur_close(&pcur); mtr_commit(&mtr); return(error); } /********************************************************************//** Loads a table definition from a SYS_TABLES record to dict_table_t. Does not load any columns or indexes. @return error message, or NULL on success */ UNIV_INTERN const char* dict_load_table_low( /*================*/ const char* name, /*!< in: table name */ const rec_t* rec, /*!< in: SYS_TABLES record */ dict_table_t** table) /*!< out,own: table, or NULL */ { const byte* field; ulint len; ulint space; ulint n_cols; ulint flags; if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) { return("delete-marked record in SYS_TABLES"); } if (UNIV_UNLIKELY(rec_get_n_fields_old(rec) != 10)) { return("wrong number of columns in SYS_TABLES record"); } rec_get_nth_field_offs_old(rec, 0/*NAME*/, &len); if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) { err_len: return("incorrect column length in SYS_TABLES"); } rec_get_nth_field_offs_old(rec, 1/*DB_TRX_ID*/, &len); if (UNIV_UNLIKELY(len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL)) { goto err_len; } rec_get_nth_field_offs_old(rec, 2/*DB_ROLL_PTR*/, &len); if (UNIV_UNLIKELY(len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL)) { goto err_len; } rec_get_nth_field_offs_old(rec, 3/*ID*/, &len); if (UNIV_UNLIKELY(len != 8)) { goto err_len; } field = rec_get_nth_field_old(rec, 4/*N_COLS*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } n_cols = mach_read_from_4(field); rec_get_nth_field_offs_old(rec, 5/*TYPE*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } rec_get_nth_field_offs_old(rec, 6/*MIX_ID*/, &len); if (UNIV_UNLIKELY(len != 8)) { goto err_len; } rec_get_nth_field_offs_old(rec, 7/*MIX_LEN*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } rec_get_nth_field_offs_old(rec, 8/*CLUSTER_ID*/, &len); if (UNIV_UNLIKELY(len != UNIV_SQL_NULL)) { goto err_len; } field = rec_get_nth_field_old(rec, 9/*SPACE*/, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } space = mach_read_from_4(field); /* Check if the tablespace exists and has the right name */ if (space != 0) { flags = dict_sys_tables_get_flags(rec); if (UNIV_UNLIKELY(flags == ULINT_UNDEFINED)) { field = rec_get_nth_field_old(rec, 5/*TYPE*/, &len); ut_ad(len == 4); /* this was checked earlier */ flags = mach_read_from_4(field); ut_print_timestamp(stderr); fputs(" InnoDB: Error: table ", stderr); ut_print_filename(stderr, name); fprintf(stderr, "\n" "InnoDB: in InnoDB data dictionary" " has unknown type %lx.\n", (ulong) flags); return("incorrect flags in SYS_TABLES"); } } else { flags = 0; } /* The high-order bit of N_COLS is the "compact format" flag. For tables in that format, MIX_LEN may hold additional flags. */ if (n_cols & 0x80000000UL) { ulint flags2; flags |= DICT_TF_COMPACT; field = rec_get_nth_field_old(rec, 7, &len); if (UNIV_UNLIKELY(len != 4)) { goto err_len; } flags2 = mach_read_from_4(field); if (flags2 & (~0 << (DICT_TF2_BITS - DICT_TF2_SHIFT))) { ut_print_timestamp(stderr); fputs(" InnoDB: Warning: table ", stderr); ut_print_filename(stderr, name); fprintf(stderr, "\n" "InnoDB: in InnoDB data dictionary" " has unknown flags %lx.\n", (ulong) flags2); flags2 &= ~(~0 << (DICT_TF2_BITS - DICT_TF2_SHIFT)); } flags |= flags2 << DICT_TF2_SHIFT; } /* See if the tablespace is available. */ *table = dict_mem_table_create(name, space, n_cols & ~0x80000000UL, flags); field = rec_get_nth_field_old(rec, 3/*ID*/, &len); ut_ad(len == 8); /* this was checked earlier */ (*table)->id = mach_read_from_8(field); (*table)->ibd_file_missing = FALSE; return(NULL); } /********************************************************************//** Loads a table definition and also all its index definitions, and also the cluster definition if the table is a member in a cluster. Also loads all foreign key constraints where the foreign key is in the table or where a foreign key references columns in this table. Adds all these to the data dictionary cache. @return table, NULL if does not exist; if the table is stored in an .ibd file, but the file does not exist, then we set the ibd_file_missing flag TRUE in the table object we return */ UNIV_INTERN dict_table_t* dict_load_table( /*============*/ const char* name, /*!< in: table name in the databasename/tablename format */ ibool cached, /*!< in: TRUE=add to cache, FALSE=do not */ dict_err_ignore_t ignore_err) /*!< in: error to be ignored when loading table and its indexes' definition */ { dict_table_t* table; dict_table_t* sys_tables; btr_pcur_t pcur; dict_index_t* sys_index; dtuple_t* tuple; mem_heap_t* heap; dfield_t* dfield; const rec_t* rec; const byte* field; ulint len; ulint err; const char* err_msg; mtr_t mtr; ut_ad(mutex_own(&(dict_sys->mutex))); heap = mem_heap_create(32000); mtr_start(&mtr); sys_tables = dict_table_get_low("SYS_TABLES"); sys_index = UT_LIST_GET_FIRST(sys_tables->indexes); ut_a(!dict_table_is_comp(sys_tables)); ut_a(name_of_col_is(sys_tables, sys_index, 3, "ID")); ut_a(name_of_col_is(sys_tables, sys_index, 4, "N_COLS")); ut_a(name_of_col_is(sys_tables, sys_index, 5, "TYPE")); ut_a(name_of_col_is(sys_tables, sys_index, 7, "MIX_LEN")); ut_a(name_of_col_is(sys_tables, sys_index, 9, "SPACE")); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); dfield_set_data(dfield, name, ut_strlen(name)); dict_index_copy_types(tuple, sys_index, 1); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur) || rec_get_deleted_flag(rec, 0)) { /* Not found */ err_exit: btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); return(NULL); } field = rec_get_nth_field_old(rec, 0, &len); /* Check if the table name in record is the searched one */ if (len != ut_strlen(name) || ut_memcmp(name, field, len) != 0) { goto err_exit; } err_msg = dict_load_table_low(name, rec, &table); if (err_msg) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: %s\n", err_msg); goto err_exit; } if (table->space == 0) { /* The system tablespace is always available. */ } else if (!fil_space_for_table_exists_in_mem( table->space, name, (table->flags >> DICT_TF2_SHIFT) & DICT_TF2_TEMPORARY, FALSE, FALSE)) { if (table->flags & (DICT_TF2_TEMPORARY << DICT_TF2_SHIFT)) { /* Do not bother to retry opening temporary tables. */ table->ibd_file_missing = TRUE; } else { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: error: space object of table "); ut_print_filename(stderr, name); fprintf(stderr, ",\n" "InnoDB: space id %lu did not exist in memory." " Retrying an open.\n", (ulong) table->space); /* Try to open the tablespace */ if (!fil_open_single_table_tablespace( TRUE, table->space, table->flags == DICT_TF_COMPACT ? 0 : table->flags & ~(~0 << DICT_TF_BITS), name)) { /* We failed to find a sensible tablespace file */ table->ibd_file_missing = TRUE; } } } btr_pcur_close(&pcur); mtr_commit(&mtr); dict_load_columns(table, heap); if (cached) { dict_table_add_to_cache(table, heap); } else { dict_table_add_system_columns(table, heap); } mem_heap_empty(heap); err = dict_load_indexes(table, heap, ignore_err); /* Initialize table foreign_child value. Its value could be changed when dict_load_foreigns() is called below */ table->fk_max_recusive_level = 0; /* If the force recovery flag is set, we open the table irrespective of the error condition, since the user may want to dump data from the clustered index. However we load the foreign key information only if all indexes were loaded. */ if (!cached) { } else if (err == DB_SUCCESS) { err = dict_load_foreigns(table->name, TRUE, TRUE); if (err != DB_SUCCESS) { dict_table_remove_from_cache(table); table = NULL; } else { table->fk_max_recusive_level = 0; } } else { dict_index_t* index; /* Make sure that at least the clustered index was loaded. Otherwise refuse to load the table */ index = dict_table_get_first_index(table); if (!srv_force_recovery || !index || !dict_index_is_clust(index)) { dict_table_remove_from_cache(table); table = NULL; } } #if 0 if (err != DB_SUCCESS && table != NULL) { mutex_enter(&dict_foreign_err_mutex); ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error: could not make a foreign key" " definition to match\n" "InnoDB: the foreign key table" " or the referenced table!\n" "InnoDB: The data dictionary of InnoDB is corrupt." " You may need to drop\n" "InnoDB: and recreate the foreign key table" " or the referenced table.\n" "InnoDB: Submit a detailed bug report" " to http://bugs.mysql.com\n" "InnoDB: Latest foreign key error printout:\n%s\n", dict_foreign_err_buf); mutex_exit(&dict_foreign_err_mutex); } #endif /* 0 */ mem_heap_free(heap); return(table); } /***********************************************************************//** Loads a table object based on the table id. @return table; NULL if table does not exist */ UNIV_INTERN dict_table_t* dict_load_table_on_id( /*==================*/ table_id_t table_id) /*!< in: table id */ { byte id_buf[8]; btr_pcur_t pcur; mem_heap_t* heap; dtuple_t* tuple; dfield_t* dfield; dict_index_t* sys_table_ids; dict_table_t* sys_tables; const rec_t* rec; const byte* field; ulint len; dict_table_t* table; mtr_t mtr; ut_ad(mutex_own(&(dict_sys->mutex))); table = NULL; /* NOTE that the operation of this function is protected by the dictionary mutex, and therefore no deadlocks can occur with other dictionary operations. */ mtr_start(&mtr); /*---------------------------------------------------*/ /* Get the secondary index based on ID for table SYS_TABLES */ sys_tables = dict_sys->sys_tables; sys_table_ids = dict_table_get_next_index( dict_table_get_first_index(sys_tables)); ut_a(!dict_table_is_comp(sys_tables)); heap = mem_heap_create(256); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); /* Write the table id in byte format to id_buf */ mach_write_to_8(id_buf, table_id); dfield_set_data(dfield, id_buf, 8); dict_index_copy_types(tuple, sys_table_ids, 1); btr_pcur_open_on_user_rec(sys_table_ids, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur)) { /* Not found */ goto func_exit; } /* Find the first record that is not delete marked */ while (rec_get_deleted_flag(rec, 0)) { if (!btr_pcur_move_to_next_user_rec(&pcur, &mtr)) { goto func_exit; } rec = btr_pcur_get_rec(&pcur); } /*---------------------------------------------------*/ /* Now we have the record in the secondary index containing the table ID and NAME */ rec = btr_pcur_get_rec(&pcur); field = rec_get_nth_field_old(rec, 0, &len); ut_ad(len == 8); /* Check if the table id in record is the one searched for */ if (table_id != mach_read_from_8(field)) { goto func_exit; } /* Now we get the table name from the record */ field = rec_get_nth_field_old(rec, 1, &len); /* Load the table definition to memory */ table = dict_load_table(mem_heap_strdupl(heap, (char*) field, len), TRUE, DICT_ERR_IGNORE_NONE); func_exit: btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); return(table); } /********************************************************************//** This function is called when the database is booted. Loads system table index definitions except for the clustered index which is added to the dictionary cache at booting before calling this function. */ UNIV_INTERN void dict_load_sys_table( /*================*/ dict_table_t* table) /*!< in: system table */ { mem_heap_t* heap; ut_ad(mutex_own(&(dict_sys->mutex))); heap = mem_heap_create(1000); dict_load_indexes(table, heap, DICT_ERR_IGNORE_NONE); mem_heap_free(heap); } /********************************************************************//** Loads foreign key constraint col names (also for the referenced table). */ static void dict_load_foreign_cols( /*===================*/ const char* id, /*!< in: foreign constraint id as a null-terminated string */ dict_foreign_t* foreign)/*!< in: foreign constraint object */ { dict_table_t* sys_foreign_cols; dict_index_t* sys_index; btr_pcur_t pcur; dtuple_t* tuple; dfield_t* dfield; const rec_t* rec; const byte* field; ulint len; ulint i; mtr_t mtr; ut_ad(mutex_own(&(dict_sys->mutex))); foreign->foreign_col_names = mem_heap_alloc( foreign->heap, foreign->n_fields * sizeof(void*)); foreign->referenced_col_names = mem_heap_alloc( foreign->heap, foreign->n_fields * sizeof(void*)); mtr_start(&mtr); sys_foreign_cols = dict_table_get_low("SYS_FOREIGN_COLS"); sys_index = UT_LIST_GET_FIRST(sys_foreign_cols->indexes); ut_a(!dict_table_is_comp(sys_foreign_cols)); tuple = dtuple_create(foreign->heap, 1); dfield = dtuple_get_nth_field(tuple, 0); dfield_set_data(dfield, id, ut_strlen(id)); dict_index_copy_types(tuple, sys_index, 1); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); for (i = 0; i < foreign->n_fields; i++) { rec = btr_pcur_get_rec(&pcur); ut_a(btr_pcur_is_on_user_rec(&pcur)); ut_a(!rec_get_deleted_flag(rec, 0)); field = rec_get_nth_field_old(rec, 0, &len); ut_a(len == ut_strlen(id)); ut_a(ut_memcmp(id, field, len) == 0); field = rec_get_nth_field_old(rec, 1, &len); ut_a(len == 4); ut_a(i == mach_read_from_4(field)); field = rec_get_nth_field_old(rec, 4, &len); foreign->foreign_col_names[i] = mem_heap_strdupl( foreign->heap, (char*) field, len); field = rec_get_nth_field_old(rec, 5, &len); foreign->referenced_col_names[i] = mem_heap_strdupl( foreign->heap, (char*) field, len); btr_pcur_move_to_next_user_rec(&pcur, &mtr); } btr_pcur_close(&pcur); mtr_commit(&mtr); } /***********************************************************************//** Loads a foreign key constraint to the dictionary cache. @return DB_SUCCESS or error code */ static ulint dict_load_foreign( /*==============*/ const char* id, /*!< in: foreign constraint id as a null-terminated string */ ibool check_charsets, /*!< in: TRUE=check charset compatibility */ ibool check_recursive) /*!< in: Whether to record the foreign table parent count to avoid unlimited recursive load of chained foreign tables */ { dict_foreign_t* foreign; dict_table_t* sys_foreign; btr_pcur_t pcur; dict_index_t* sys_index; dtuple_t* tuple; mem_heap_t* heap2; dfield_t* dfield; const rec_t* rec; const byte* field; ulint len; ulint n_fields_and_type; mtr_t mtr; dict_table_t* for_table; dict_table_t* ref_table; ut_ad(mutex_own(&(dict_sys->mutex))); heap2 = mem_heap_create(1000); mtr_start(&mtr); sys_foreign = dict_table_get_low("SYS_FOREIGN"); sys_index = UT_LIST_GET_FIRST(sys_foreign->indexes); ut_a(!dict_table_is_comp(sys_foreign)); tuple = dtuple_create(heap2, 1); dfield = dtuple_get_nth_field(tuple, 0); dfield_set_data(dfield, id, ut_strlen(id)); dict_index_copy_types(tuple, sys_index, 1); btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur) || rec_get_deleted_flag(rec, 0)) { /* Not found */ fprintf(stderr, "InnoDB: Error A: cannot load foreign constraint %s\n", id); btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap2); return(DB_ERROR); } field = rec_get_nth_field_old(rec, 0, &len); /* Check if the id in record is the searched one */ if (len != ut_strlen(id) || ut_memcmp(id, field, len) != 0) { fprintf(stderr, "InnoDB: Error B: cannot load foreign constraint %s\n", id); btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap2); return(DB_ERROR); } /* Read the table names and the number of columns associated with the constraint */ mem_heap_free(heap2); foreign = dict_mem_foreign_create(); n_fields_and_type = mach_read_from_4( rec_get_nth_field_old(rec, 5, &len)); ut_a(len == 4); /* We store the type in the bits 24..29 of n_fields_and_type. */ foreign->type = (unsigned int) (n_fields_and_type >> 24); foreign->n_fields = (unsigned int) (n_fields_and_type & 0x3FFUL); foreign->id = mem_heap_strdup(foreign->heap, id); field = rec_get_nth_field_old(rec, 3, &len); foreign->foreign_table_name = mem_heap_strdupl( foreign->heap, (char*) field, len); dict_mem_foreign_table_name_lookup_set(foreign, TRUE); field = rec_get_nth_field_old(rec, 4, &len); foreign->referenced_table_name = mem_heap_strdupl( foreign->heap, (char*) field, len); dict_mem_referenced_table_name_lookup_set(foreign, TRUE); btr_pcur_close(&pcur); mtr_commit(&mtr); dict_load_foreign_cols(id, foreign); ref_table = dict_table_check_if_in_cache_low( foreign->referenced_table_name_lookup); /* We could possibly wind up in a deep recursive calls if we call dict_table_get_low() again here if there is a chain of tables concatenated together with foreign constraints. In such case, each table is both a parent and child of the other tables, and act as a "link" in such table chains. To avoid such scenario, we would need to check the number of ancesters the current table has. If that exceeds DICT_FK_MAX_CHAIN_LEN, we will stop loading the child table. Foreign constraints are loaded in a Breath First fashion, that is, the index on FOR_NAME is scanned first, and then index on REF_NAME. So foreign constrains in which current table is a child (foreign table) are loaded first, and then those constraints where current table is a parent (referenced) table. Thus we could check the parent (ref_table) table's reference count (fk_max_recusive_level) to know how deep the recursive call is. If the parent table (ref_table) is already loaded, and its fk_max_recusive_level is larger than DICT_FK_MAX_CHAIN_LEN, we will stop the recursive loading by skipping loading the child table. It will not affect foreign constraint check for DMLs since child table will be loaded at that time for the constraint check. */ if (!ref_table || ref_table->fk_max_recusive_level < DICT_FK_MAX_RECURSIVE_LOAD) { /* If the foreign table is not yet in the dictionary cache, we have to load it so that we are able to make type comparisons in the next function call. */ for_table = dict_table_get_low(foreign->foreign_table_name_lookup); if (for_table && ref_table && check_recursive) { /* This is to record the longest chain of ancesters this table has, if the parent has more ancesters than this table has, record it after add 1 (for this parent */ if (ref_table->fk_max_recusive_level >= for_table->fk_max_recusive_level) { for_table->fk_max_recusive_level = ref_table->fk_max_recusive_level + 1; } } } /* Note that there may already be a foreign constraint object in the dictionary cache for this constraint: then the following call only sets the pointers in it to point to the appropriate table and index objects and frees the newly created object foreign. Adding to the cache should always succeed since we are not creating a new foreign key constraint but loading one from the data dictionary. */ return(dict_foreign_add_to_cache(foreign, check_charsets)); } /***********************************************************************//** Loads foreign key constraints where the table is either the foreign key holder or where the table is referenced by a foreign key. Adds these constraints to the data dictionary. Note that we know that the dictionary cache already contains all constraints where the other relevant table is already in the dictionary cache. @return DB_SUCCESS or error code */ UNIV_INTERN ulint dict_load_foreigns( /*===============*/ const char* table_name, /*!< in: table name */ ibool check_recursive,/*!< in: Whether to check recursive load of tables chained by FK */ ibool check_charsets) /*!< in: TRUE=check charset compatibility */ { btr_pcur_t pcur; mem_heap_t* heap; dtuple_t* tuple; dfield_t* dfield; dict_index_t* sec_index; dict_table_t* sys_foreign; const rec_t* rec; const byte* field; ulint len; char* id ; ulint err; mtr_t mtr; ut_ad(mutex_own(&(dict_sys->mutex))); sys_foreign = dict_table_get_low("SYS_FOREIGN"); if (sys_foreign == NULL) { /* No foreign keys defined yet in this database */ fprintf(stderr, "InnoDB: Error: no foreign key system tables" " in the database\n"); return(DB_ERROR); } ut_a(!dict_table_is_comp(sys_foreign)); mtr_start(&mtr); /* Get the secondary index based on FOR_NAME from table SYS_FOREIGN */ sec_index = dict_table_get_next_index( dict_table_get_first_index(sys_foreign)); start_load: heap = mem_heap_create(256); tuple = dtuple_create(heap, 1); dfield = dtuple_get_nth_field(tuple, 0); dfield_set_data(dfield, table_name, ut_strlen(table_name)); dict_index_copy_types(tuple, sec_index, 1); btr_pcur_open_on_user_rec(sec_index, tuple, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); loop: rec = btr_pcur_get_rec(&pcur); if (!btr_pcur_is_on_user_rec(&pcur)) { /* End of index */ goto load_next_index; } /* Now we have the record in the secondary index containing a table name and a foreign constraint ID */ rec = btr_pcur_get_rec(&pcur); field = rec_get_nth_field_old(rec, 0, &len); /* Check if the table name in the record is the one searched for; the following call does the comparison in the latin1_swedish_ci charset-collation, in a case-insensitive way. */ if (0 != cmp_data_data(dfield_get_type(dfield)->mtype, dfield_get_type(dfield)->prtype, dfield_get_data(dfield), dfield_get_len(dfield), field, len)) { goto load_next_index; } /* Since table names in SYS_FOREIGN are stored in a case-insensitive order, we have to check that the table name matches also in a binary string comparison. On Unix, MySQL allows table names that only differ in character case. If lower_case_table_names=2 then what is stored may not be the same case, but the previous comparison showed that they match with no-case. */ if ((innobase_get_lower_case_table_names() != 2) && (0 != ut_memcmp(field, table_name, len))) { goto next_rec; } if (rec_get_deleted_flag(rec, 0)) { goto next_rec; } /* Now we get a foreign key constraint id */ field = rec_get_nth_field_old(rec, 1, &len); id = mem_heap_strdupl(heap, (char*) field, len); btr_pcur_store_position(&pcur, &mtr); mtr_commit(&mtr); /* Load the foreign constraint definition to the dictionary cache */ err = dict_load_foreign(id, check_charsets, check_recursive); if (err != DB_SUCCESS) { btr_pcur_close(&pcur); mem_heap_free(heap); return(err); } mtr_start(&mtr); btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr); next_rec: btr_pcur_move_to_next_user_rec(&pcur, &mtr); goto loop; load_next_index: btr_pcur_close(&pcur); mtr_commit(&mtr); mem_heap_free(heap); sec_index = dict_table_get_next_index(sec_index); if (sec_index != NULL) { mtr_start(&mtr); /* Switch to scan index on REF_NAME, fk_max_recusive_level already been updated when scanning FOR_NAME index, no need to update again */ check_recursive = FALSE; goto start_load; } return(DB_SUCCESS); }
Java
<html> <head> <title>A3 ALiVE</title> </head> <body> <h1>A3 ALiVE News</h1> <p> </p> <p> <br />Unable to retrieve the latest News Online!<br /><br /> <br /><a href="http://alivemod.com">Full Details</a> <br /></br ><br /> </p> <p> <br /> <br /> </p> </body> </html>
Java
<?php /* * * Copyright 2001, 2010 Thomas Belliard, Laurent Delineau, Edouard Hue, Eric Lebrun, Gabriel Fischer, Didier Blanqui * * This file is part of GEPI. * * GEPI is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GEPI is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GEPI; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // On empêche l'accès direct au fichier if (basename($_SERVER["SCRIPT_NAME"])==basename(__File__)){ die(); }; ?> <div id="result"> <div id="wrap" > <h3><font class="red">Bilans des incidents pour la période du: <?php echo $_SESSION['stats_periodes']['du'];?> au <?php echo $_SESSION['stats_periodes']['au'];?> </font> </h3> <?php ClassVue::afficheVue('parametres.php',$vars) ?> </div> <div id="tableaux"> <div id="banner"> <ul class="css-tabs" id="menutabs"> <?php $i=0; foreach ($incidents as $titre=>$incidents_titre) :?> <?php if($titre=='L\'Etablissement') { if($affichage_etab) : ?> <li><a href="#tab<?php echo $i;?>" title="Bilan des incidents" name="Etablissement-onglet-01"><?php echo $titre;?></a></li> <li><a href="#tab<?php echo $i+1;?>" name="Etablissement-onglet-02"><img src="apps/img/user.png" alt="Synthèse individuelle" title="Synthèse individuelle"/></a>&nbsp;&nbsp;</li> <?php $i=$i+2; endif; } else if ($titre=='Tous les élèves' ||$titre=='Tous les personnels' ) { ?> <li><a href="#tab<?php echo $i;?>" title="Bilan des incidents" name="<?php echo $titre;?>-onglet-01"><?php echo $titre;?></a></li> <li><a href="#tab<?php echo $i+1;?>" name="<?php echo $titre;?>-onglet-02"><img src="apps/img/user.png" alt="Synthèse individuelle" title="Synthèse individuelle"/></a>&nbsp;&nbsp;</li> <?php $i=$i+2; } else { ?> <li><a href="#tab<?php echo $i;?>" name="<?php echo $titre;?>-onglet-01" title="Bilan des incidents"> <?php if (isset($infos_individus[$titre])) { echo mb_substr($infos_individus[$titre]['prenom'],0,1).'.'.$infos_individus[$titre]['nom']; if (isset($infos_individus[$titre]['classe'])) echo'('.$infos_individus[$titre]['classe'].')'; } else echo $titre;?></a> </li> <?php if (isset($infos_individus[$titre]['classe'])|| !isset($infos_individus[$titre])) { ?> <li><a href="#tab<?php echo $i+1;?>" name="<?php echo $titre;?>-onglet-02"><img src="apps/img/user.png" alt="Synthèse par élève" title="Synthèse par élève"/></a>&nbsp;&nbsp;</li> <?php $i=$i+2; } else { $i=$i+1; } } endforeach ?> </ul> </div> <div class="css-panes" id="containDiv"> <?php $i=0; foreach ($incidents as $titre=>$incidents_titre) { if ($titre!=='L\'Etablissement' || ($titre=='L\'Etablissement' && !is_null($affichage_etab) ) ) {?> <div class="panel" id="tab<?php echo $i;?>"> <?php if (isset($incidents_titre['error'])) {?> <table class="boireaus"> <tr ><td class="nouveau"><font class='titre'>Bilan des incidents concernant :</font> <?php if (isset($infos_individus[$titre])) { echo $infos_individus[$titre]['prenom'].' '.$infos_individus[$titre]['nom']; if (isset($infos_individus[$titre]['classe'])) echo'('.$infos_individus[$titre]['classe'].')'; } else echo $titre;?> </td></tr> <tr><td class='nouveau'>Pas d'incidents avec les critères sélectionnés...</td></tr> </table><br /><br /> <?php echo'</div>';?> <?php if ($titre!=='L\'Etablissement' || $titre=='Tous les élèves' ||$titre=='Tous les personnels') {?> <div class="panel" id="tab<?php echo $i+1;?>"> <table class="boireaus"> <tr><td class="nouveau"><strong>Bilan individuel</strong> </td></tr> <tr><td class="nouveau">Pas d'incidents avec les critères sélectionnés...</td></tr> </table> </div> <?php $i=$i+2; } } else { ?> <table class="boireaus"> <tr > <td rowspan="6" colspan="5" class='nouveau'> <p><font class='titre'>Bilan des incidents concernant : </font> <?php if (isset($infos_individus[$titre])) { echo $infos_individus[$titre]['prenom'].' '.$infos_individus[$titre]['nom']; if (isset($infos_individus[$titre]['classe'])) echo'('.$infos_individus[$titre]['classe'].')'; } else echo $titre;?> </p> <?php if($filtres_categories||$filtres_mesures||$filtres_roles||$filtres_sanctions) { ?><p>avec les filtres selectionnés</p><?php }?> </td> <td <?php if ($titre=='L\'Etablissement' ) {?> colspan="3" <?php }?> class='nouveau'><font class='titre'>Nombres d'incidents sur la période:</font> <?php echo $totaux[$titre]['incidents']; ?></td><?php if ($titre!=='L\'Etablissement' ) {?> <td class='nouveau' > <font class='titre'>% sur la période/Etab: </font> <?php echo round((100*($totaux[$titre]['incidents']/$totaux['L\'Etablissement']['incidents'])),2);?></td><?php } ?></tr> <tr><td <?php if ($titre=='L\'Etablissement' ) {?> colspan="2" <?php }?> class='nouveau'><font class='titre'>Nombre total de mesures prises pour ces incidents :</font> <?php echo $totaux[$titre]['mesures_prises']; ?></td><?php if ($titre!=='L\'Etablissement' ) {?> <td class='nouveau' > <font class='titre'>% sur la période/Etab: </font> <?php if($totaux['L\'Etablissement']['mesures_prises']) echo round((100*($totaux[$titre]['mesures_prises']/$totaux['L\'Etablissement']['mesures_prises'])),2); else echo'0';?></td><?php } ?></tr> <tr><td <?php if ($titre=='L\'Etablissement' ) {?> colspan="2" <?php }?> class='nouveau'><font class='titre'>Nombre total de mesures demandées pour ces incidents :</font> <?php echo $totaux[$titre]['mesures_demandees']; ?></td><?php if ($titre!=='L\'Etablissement' ) {?> <td class='nouveau' > <font class='titre'>% sur la période/Etab: </font> <?php if($totaux['L\'Etablissement']['mesures_demandees']) echo round((100*($totaux[$titre]['mesures_demandees']/$totaux['L\'Etablissement']['mesures_demandees'])),2); else echo'0';?></td><?php } ?></tr> <tr><td <?php if ($titre=='L\'Etablissement' ) {?> colspan="2" <?php }?> class='nouveau'><font class='titre'>Nombre total de sanctions prises pour ces incidents:</font> <?php echo $totaux[$titre]['sanctions']; ?></td><?php if ($titre!=='L\'Etablissement' ) {?> <td class='nouveau' > <font class='titre'>% sur la période/Etab: </font> <?php if($totaux['L\'Etablissement']['sanctions']) echo round((100*($totaux[$titre]['sanctions']/$totaux['L\'Etablissement']['sanctions'])),2); else echo'0';?></td><?php } ?></tr> <tr><td <?php if ($titre=='L\'Etablissement' ) {?> colspan="2" <?php }?> class='nouveau'><font class='titre'>Nombre total d'heures de retenues pour ces incidents:</font> <?php echo $totaux[$titre]['heures_retenues']; ?></td><?php if ($titre!=='L\'Etablissement' ) {?> <td class='nouveau' > <font class='titre'>% sur la période/Etab: </font> <?php if($totaux['L\'Etablissement']['heures_retenues']) echo round((100*($totaux[$titre]['heures_retenues']/$totaux['L\'Etablissement']['heures_retenues'])),2); else echo '0'; ?></td><?php } ?></tr> <tr><td <?php if ($titre=='L\'Etablissement' ) {?> colspan="2" <?php }?> class='nouveau'><font class='titre'>Nombre total de jours d'exclusions pour ces incidents:</font> <?php echo $totaux[$titre]['jours_exclusions']; ?></td><?php if ($titre!=='L\'Etablissement' ) {?> <td class='nouveau' > <font class='titre'>% sur la période/Etab: </font> <?php if($totaux['L\'Etablissement']['jours_exclusions']) echo round((100*($totaux[$titre]['jours_exclusions']/$totaux['L\'Etablissement']['jours_exclusions'])),2); else echo '0'; ?></td><?php } ?></tr> </table> <?php if($mode_detaille) { ?> <table class="sortable resizable boireaus" id="table<?php echo $i;?>"> <thead> <tr><th><font class='titre'>Date</font></th><th class="text"><font class='titre'>Déclarant</font></th><th><font class='titre'>Heure</font></th><th class="text"><font class='titre'>Nature</font></th> <th><font class='titre' title="Catégories">Cat.</font></th><th class="text" ><font class='titre'>Description</font></th><th width="50%" class="nosort"><font class='titre'>Suivi</font></th></tr> </thead> <?php $alt_b=1; foreach($incidents_titre as $incident) { $alt_b=$alt_b*(-1);?> <tr class='lig<?php echo $alt_b;?>'><td><?php echo $incident->date; ?></td><td><?php echo $incident->declarant; ?></td><td><?php echo $incident->heure; ?></td> <td><?php echo $incident->nature; ?></td><td><?php if(!is_null($incident->id_categorie))echo $incident->sigle_categorie;else echo'-'; ?></td><td><?php echo $incident->description; ?></td> <td class="nouveau"><?php if(!isset($protagonistes[$incident->id_incident]))echo'<h3 class="red">Aucun protagoniste défini pour cet incident</h3>'; else { ?> <table class="boireaus" width="100%" > <?php foreach($protagonistes[$incident->id_incident] as $protagoniste) {?> <tr><td> <?php echo $protagoniste->prenom.' '.$protagoniste->nom.' <br/> '; echo $protagoniste->statut.' '; if($protagoniste->classe) echo $protagoniste->classe .' - '; else echo ' - ' ; if($protagoniste->qualite=="") echo'<font class="red">Aucun rôle affecté.</font><br />'; else echo $protagoniste->qualite.'<br />'; ?></td><td ><?php if (isset($mesures[$incident->id_incident][$protagoniste->login])) { ?> <p><strong>Mesures :</strong></p> <table class="boireaus" > <tr><th><font class='titre'>Nature</font></th><th><font class='titre'>Mesure</font></th></tr> <?php $alt_c=1; foreach ($mesures[$incident->id_incident][$protagoniste->login] as $mesure) { $alt_c=$alt_c*(-1); ?> <tr class="lig<?php echo $alt_c;?>"><td><?php echo $mesure->mesure; ?></td> <td><?php echo $mesure->type.' par '.$mesure->login_u; ?></td></tr> <?php } ?> </table> <?php } if (isset($sanctions[$incident->id_incident][$protagoniste->login])) { ?> <p><strong>Sanctions :</strong></p> <table class="boireaus" width="100%"> <tr><th><font class='titre'>Nature</font></th><th><font class='titre'>Effectuée</font></th><th><font class='titre'>Date</font></th> <th><font class='titre'>Durée</font></th> </tr> <?php $alt_d=1; foreach ($sanctions[$incident->id_incident][$protagoniste->login] as $sanction) { $alt_d=$alt_d*(-1); ?> <tr class="lig<?php echo $alt_d;?>"><td><?php echo $sanction->nature; ?></td> <td><?php echo $sanction->effectuee; ?></td> <td><?php if($sanction->nature=='retenue')echo $sanction->ret_date; if($sanction->nature=='exclusion')echo 'Du '.$sanction->exc_date_debut.' au '.$sanction->exc_date_fin; if($sanction->nature=='travail')echo 'Pour le '.$sanction->trv_date_retour;?> </td> <td><?php if($sanction->nature=='retenue') { echo $sanction->ret_duree.' heure'; if ($sanction->ret_duree >1) echo 's'; }else if($sanction->nature=='exclusion') { echo $sanction->exc_duree.' jour'; if ($sanction->exc_duree >1) echo 's'; }else{ echo'-'; } ?> </td> </tr> <?php } ?> </table> <?php } ?> </td></tr> <?php } ?></table> <?php } ?></td></tr> <?php } }?> </table> <br /><br /><a href="#wrap"><img src="apps/img/retour_haut.png" alt="simple" title="simplifié"/>Retour aux selections </a> </div> <?php if (isset($liste_eleves[$titre])): ?> <div class="panel" id="tab<?php echo $i+1;?>"> <table class="boireaus"> <tr><td class="nouveau" colspan="11"><strong>Bilan individuel</strong></td><td><a href="#" class="export_csv" name="<?php echo $temp_dir.'/separateur/'.$titre;?>"><img src="../../images/notes_app_csv.png" alt="export_csv"/></a></td></tr></table> <table class="sortable resizable "> <thead> <tr> <?php if($titre=='L\'Etablissement' || $titre=='Tous les élèves' ||$titre=='Tous les personnels' ){?> <th colspan="3" <?php } else { ?> <th colspan="2" <?php } ?> <?php if (!isset($totaux_indiv[$titre])) {?> <?php }?>>Individu</th> <th >Incidents</th><th colspan="2" <?php if (!isset($totaux_indiv[$titre])) {?> <?php }?>>Mesures prises</th> <th colspan="2" <?php if (!isset($totaux_indiv[$titre])) {?> <?php }?>>Sanctions prises</th> <th colspan="2" <?php if (!isset($totaux_indiv[$titre])) {?> <?php }?>>Heures de retenues</th> <th colspan="2" <?php if (!isset($totaux_indiv[$titre])) {?> <?php }?>>Jours d'exclusion</th> </tr> <tr> <th>Nom</th><th>Prénom</th> <?php if($titre=='L\'Etablissement' || $titre=='Tous les élèves' ||$titre=='Tous les personnels' ){?> <th class="text">Classe</th> <?php } ?> <th>Nombre</th><th>Nombre</th><th>%/Etab</th><th>Nombre</th><th>%/Etab</th><th>Nombre</th><th>%/Etab</th><th>Nombre</th><th>%/Etab</th> </tr> </thead> <tbody> <?php $alt_b=1; foreach ($liste_eleves[$titre] as $eleve) { $alt_b=$alt_b*(-1);?> <tr <?php if ($alt_b==1) echo"class='alt'";?>> <td><a href="index.php?ctrl=Bilans&action=add_selection&login=<?php echo $eleve?>"><?php echo $totaux_indiv[$eleve]['nom']; ?></a></td> <td><?php // 20200718 echo "<span style='display:none'>".$totaux_indiv[$eleve]['prenom']."</span>"; echo "<div style='float:right; width:16px; margin-left:3px;'> <a href='../../eleves/visu_eleve.php?ele_login=".$eleve."&onglet=discipline' target='_blank' title=\"Voir la fiche élève dans un nouvel onglet.\"><img src='../../images/icons/ele_onglets.png' class='icone16' /></a> </div>"; echo $totaux_indiv[$eleve]['prenom']; ?> </td> <?php if($titre=='L\'Etablissement' || $titre=='Tous les élèves' ||$titre=='Tous les personnels' ){?> <td><?php echo $totaux_indiv[$eleve]['classe']; ?></td> <?php } ?> <td><?php echo $totaux_indiv[$eleve]['incidents']; ?></td><td><?php if(isset($totaux_indiv[$eleve]['mesures'])) echo $totaux_indiv[$eleve]['mesures'];else echo'0'; ?></td><td><?php if($totaux['L\'Etablissement']['mesures_prises'])echo str_replace(",",".",round(100*($totaux_indiv[$eleve]['mesures']/$totaux['L\'Etablissement']['mesures_prises']),2)); else echo'0';?></td> <td><?php if(isset($totaux_indiv[$eleve]['sanctions'])) echo $totaux_indiv[$eleve]['sanctions']; else echo '0';?></td><td><?php if($totaux['L\'Etablissement']['sanctions']) echo str_replace(",",".",round(100* ($totaux_indiv[$eleve]['sanctions']/$totaux['L\'Etablissement']['sanctions']),2)); else echo'0';?></td> <td><?php if(isset($totaux_indiv[$eleve]['heures_retenues'])) echo $totaux_indiv[$eleve]['heures_retenues'];else echo '0'; ?></td><td><?php if($totaux['L\'Etablissement']['heures_retenues'])echo str_replace(",",".",round(100*($totaux_indiv[$eleve]['heures_retenues']/$totaux['L\'Etablissement']['heures_retenues']),2));else echo'0';?></td> <td><?php if(isset($totaux_indiv[$eleve]['jours_exclusions'])) echo $totaux_indiv[$eleve]['jours_exclusions'];else echo '0'; ?></td><td><?php if($totaux['L\'Etablissement']['jours_exclusions'])echo str_replace(",",".",round(100*($totaux_indiv[$eleve]['jours_exclusions']/$totaux['L\'Etablissement']['jours_exclusions']),2));else echo'0';?></td></tr> <?php }?> </tbody> <?php if (!isset($totaux_indiv[$titre])) { ?> <tfoot> <tr> <?php if($titre=='L\'Etablissement' || $titre=='Tous les élèves' ||$titre=='Tous les personnels' ){?> <td colspan="3"> <?php } else{ ?> <td colspan="2"> <?php } ?> Total</td> <td><?php if(isset($totaux_par_classe[$titre]['incidents']))echo $totaux_par_classe[$titre]['incidents']; else echo'0';?></td><td><?php if(isset($totaux['L\'Etablissement']['mesures_prises'])) echo $totaux_par_classe[$titre]['mesures']; else echo'0';?></td><td><?php if(isset($totaux['L\'Etablissement']['mesures_prises']) && $totaux['L\'Etablissement']['mesures_prises']>0) echo round(100*($totaux_par_classe[$titre]['mesures']/$totaux['L\'Etablissement']['mesures_prises']),2); else echo'0';?></td> <td><?php if(isset($totaux_par_classe[$titre]['sanctions'])) echo $totaux_par_classe[$titre]['sanctions']; else echo'0';?></td><td><?php if(isset($totaux['L\'Etablissement']['sanctions']) && $totaux['L\'Etablissement']['sanctions']>0) echo round(100*($totaux_par_classe[$titre]['sanctions']/$totaux['L\'Etablissement']['sanctions']),2); else echo'0';?></td> <td><?php if(isset($totaux_par_classe[$titre]['heures_retenues'])) echo $totaux_par_classe[$titre]['heures_retenues']; else echo'0';?></td><td><?php if(isset($totaux['L\'Etablissement']['heures_retenues']) && $totaux['L\'Etablissement']['heures_retenues']>0) echo round(100*($totaux_par_classe[$titre]['heures_retenues']/$totaux['L\'Etablissement']['heures_retenues']),2); else echo'0';?></td> <td><?php if(isset($totaux_par_classe[$titre]['jours_exclusions'])) echo $totaux_par_classe[$titre]['jours_exclusions']; else echo'0';?></td><td><?php if(isset($totaux['L\'Etablissement']['jours_exclusions']) && $totaux['L\'Etablissement']['jours_exclusions']>0) echo round(100*($totaux_par_classe[$titre]['jours_exclusions']/$totaux['L\'Etablissement']['jours_exclusions']),2);else echo'0';?></td> </tr> </tfoot> <?php }?> </table> </div> <?php $i=$i+2; else : $i=$i+1; endif; } } }?> </div> </div> </div>
Java
/* -*- compile-command: "cd ../../../../../; ant debug install"; -*- */ /* * Copyright 2010 by Eric House (xwords@eehouse.org). All rights * reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package com.oliversride.wordryo; import junit.framework.Assert; import android.app.Activity; import android.app.Dialog; import android.os.Bundle; public class XWActivity extends Activity implements DlgDelegate.DlgClickNotify, MultiService.MultiEventListener { private final static String TAG = "XWActivity"; private DlgDelegate m_delegate; @Override protected void onCreate( Bundle savedInstanceState ) { DbgUtils.logf( "%s.onCreate(this=%H)", getClass().getName(), this ); super.onCreate( savedInstanceState ); m_delegate = new DlgDelegate( this, this, savedInstanceState ); } @Override protected void onStart() { DbgUtils.logf( "%s.onStart(this=%H)", getClass().getName(), this ); super.onStart(); } @Override protected void onResume() { DbgUtils.logf( "%s.onResume(this=%H)", getClass().getName(), this ); BTService.setListener( this ); SMSService.setListener( this ); super.onResume(); } @Override protected void onPause() { DbgUtils.logf( "%s.onPause(this=%H)", getClass().getName(), this ); BTService.setListener( null ); SMSService.setListener( null ); super.onPause(); } @Override protected void onStop() { DbgUtils.logf( "%s.onStop(this=%H)", getClass().getName(), this ); super.onStop(); } @Override protected void onDestroy() { DbgUtils.logf( "%s.onDestroy(this=%H); isFinishing=%b", getClass().getName(), this, isFinishing() ); super.onDestroy(); } @Override protected void onSaveInstanceState( Bundle outState ) { super.onSaveInstanceState( outState ); m_delegate.onSaveInstanceState( outState ); } @Override protected Dialog onCreateDialog( int id ) { Dialog dialog = super.onCreateDialog( id ); if ( null == dialog ) { DbgUtils.logf( "%s.onCreateDialog() called", getClass().getName() ); dialog = m_delegate.onCreateDialog( id ); } return dialog; } // these are duplicated in XWListActivity -- sometimes multiple // inheritance would be nice to have... protected void showAboutDialog() { m_delegate.showAboutDialog(); } protected void showNotAgainDlgThen( int msgID, int prefsKey, int action ) { m_delegate.showNotAgainDlgThen( msgID, prefsKey, action ); } protected void showNotAgainDlgThen( int msgID, int prefsKey ) { m_delegate.showNotAgainDlgThen( msgID, prefsKey ); } protected void showOKOnlyDialog( int msgID ) { m_delegate.showOKOnlyDialog( msgID ); } protected void showOKOnlyDialog( String msg ) { m_delegate.showOKOnlyDialog( msg ); } protected void showDictGoneFinish() { m_delegate.showDictGoneFinish(); } protected void showConfirmThen( int msgID, int action ) { m_delegate.showConfirmThen( getString(msgID), action ); } protected void showConfirmThen( String msg, int action ) { m_delegate.showConfirmThen( msg, action ); } protected void showConfirmThen( int msg, int posButton, int action ) { m_delegate.showConfirmThen( getString(msg), posButton, action ); } public void showEmailOrSMSThen( int action ) { m_delegate.showEmailOrSMSThen( action ); } protected void doSyncMenuitem() { m_delegate.doSyncMenuitem(); } protected void launchLookup( String[] words, int lang ) { m_delegate.launchLookup( words, lang, false ); } protected void startProgress( int id ) { m_delegate.startProgress( id ); } protected void stopProgress() { m_delegate.stopProgress(); } protected boolean post( Runnable runnable ) { return m_delegate.post( runnable ); } // DlgDelegate.DlgClickNotify interface public void dlgButtonClicked( int id, int which ) { Assert.fail(); } // BTService.MultiEventListener interface public void eventOccurred( MultiService.MultiEvent event, final Object ... args ) { m_delegate.eventOccurred( event, args ); } }
Java
<?php /** * Twenty Fifteen Customizer functionality * * @package WordPress * @subpackage Twenty_Fifteen * @since Twenty Fifteen 1.0 */ /** * Add postMessage support for site title and description for the Customizer. * * @since Twenty Fifteen 1.0 * * @param WP_Customize_Manager $wp_customize * Customizer object. */ function twentyfifteen_customize_register($wp_customize) { $color_scheme = twentyfifteen_get_color_scheme (); $wp_customize->get_setting ( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting ( 'blogdescription' )->transport = 'postMessage'; // Add color scheme setting and control. $wp_customize->add_setting ( 'color_scheme', array ( 'default' => 'default', 'sanitize_callback' => 'twentyfifteen_sanitize_color_scheme', 'transport' => 'postMessage' ) ); $wp_customize->add_control ( 'color_scheme', array ( 'label' => __ ( 'Base Color Scheme', 'twentyfifteen' ), 'section' => 'colors', 'type' => 'select', 'choices' => twentyfifteen_get_color_scheme_choices (), 'priority' => 1 ) ); // Add custom header and sidebar text color setting and control. $wp_customize->add_setting ( 'sidebar_textcolor', array ( 'default' => $color_scheme [4], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_control ( new WP_Customize_Color_Control ( $wp_customize, 'sidebar_textcolor', array ( 'label' => __ ( 'Header and Sidebar Text Color', 'twentyfifteen' ), 'description' => __ ( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), 'section' => 'colors' ) ) ); // Remove the core header textcolor control, as it shares the sidebar text color. $wp_customize->remove_control ( 'header_textcolor' ); // Add custom header and sidebar background color setting and control. $wp_customize->add_setting ( 'header_background_color', array ( 'default' => $color_scheme [1], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage' ) ); $wp_customize->add_control ( new WP_Customize_Color_Control ( $wp_customize, 'header_background_color', array ( 'label' => __ ( 'Header and Sidebar Background Color', 'twentyfifteen' ), 'description' => __ ( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), 'section' => 'colors' ) ) ); // Add an additional description to the header image section. $wp_customize->get_section ( 'header_image' )->description = __ ( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ); } add_action ( 'customize_register', 'twentyfifteen_customize_register', 11 ); /** * Register color schemes for Twenty Fifteen. * * Can be filtered with {@see 'twentyfifteen_color_schemes'}. * * The order of colors in a colors array: * 1. Main Background Color. * 2. Sidebar Background Color. * 3. Box Background Color. * 4. Main Text and Link Color. * 5. Sidebar Text and Link Color. * 6. Meta Box Background Color. * * @since Twenty Fifteen 1.0 * * @return array An associative array of color scheme options. */ function twentyfifteen_get_color_schemes() { return apply_filters ( 'twentyfifteen_color_schemes', array ( 'default' => array ( 'label' => __ ( 'Default', 'twentyfifteen' ), 'colors' => array ( '#f1f1f1', '#ffffff', '#ffffff', '#333333', '#333333', '#f7f7f7' ) ), 'dark' => array ( 'label' => __ ( 'Dark', 'twentyfifteen' ), 'colors' => array ( '#111111', '#202020', '#202020', '#bebebe', '#bebebe', '#1b1b1b' ) ), 'yellow' => array ( 'label' => __ ( 'Yellow', 'twentyfifteen' ), 'colors' => array ( '#f4ca16', '#ffdf00', '#ffffff', '#111111', '#111111', '#f1f1f1' ) ), 'pink' => array ( 'label' => __ ( 'Pink', 'twentyfifteen' ), 'colors' => array ( '#ffe5d1', '#e53b51', '#ffffff', '#352712', '#ffffff', '#f1f1f1' ) ), 'purple' => array ( 'label' => __ ( 'Purple', 'twentyfifteen' ), 'colors' => array ( '#674970', '#2e2256', '#ffffff', '#2e2256', '#ffffff', '#f1f1f1' ) ), 'blue' => array ( 'label' => __ ( 'Blue', 'twentyfifteen' ), 'colors' => array ( '#e9f2f9', '#55c3dc', '#ffffff', '#22313f', '#ffffff', '#f1f1f1' ) ) ) ); } if (! function_exists ( 'twentyfifteen_get_color_scheme' )) : /** * Get the current Twenty Fifteen color scheme. * * @since Twenty Fifteen 1.0 * * @return array An associative array of either the current or default color scheme hex values. */ function twentyfifteen_get_color_scheme() { $color_scheme_option = get_theme_mod ( 'color_scheme', 'default' ); $color_schemes = twentyfifteen_get_color_schemes (); if (array_key_exists ( $color_scheme_option, $color_schemes )) { return $color_schemes [$color_scheme_option] ['colors']; } return $color_schemes ['default'] ['colors']; } endif; // twentyfifteen_get_color_scheme if (! function_exists ( 'twentyfifteen_get_color_scheme_choices' )) : /** * Returns an array of color scheme choices registered for Twenty Fifteen. * * @since Twenty Fifteen 1.0 * * @return array Array of color schemes. */ function twentyfifteen_get_color_scheme_choices() { $color_schemes = twentyfifteen_get_color_schemes (); $color_scheme_control_options = array (); foreach ( $color_schemes as $color_scheme => $value ) { $color_scheme_control_options [$color_scheme] = $value ['label']; } return $color_scheme_control_options; } endif; // twentyfifteen_get_color_scheme_choices if (! function_exists ( 'twentyfifteen_sanitize_color_scheme' )) : /** * Sanitization callback for color schemes. * * @since Twenty Fifteen 1.0 * * @param string $value * Color scheme name value. * @return string Color scheme name. */ function twentyfifteen_sanitize_color_scheme($value) { $color_schemes = twentyfifteen_get_color_scheme_choices (); if (! array_key_exists ( $value, $color_schemes )) { $value = 'default'; } return $value; } endif; // twentyfifteen_sanitize_color_scheme /** * Enqueues front-end CSS for color scheme. * * @since Twenty Fifteen 1.0 * * @see wp_add_inline_style() */ function twentyfifteen_color_scheme_css() { $color_scheme_option = get_theme_mod ( 'color_scheme', 'default' ); // Don't do anything if the default color scheme is selected. if ('default' === $color_scheme_option) { return; } $color_scheme = twentyfifteen_get_color_scheme (); // Convert main and sidebar text hex color to rgba. $color_textcolor_rgb = twentyfifteen_hex2rgb ( $color_scheme [3] ); $color_sidebar_textcolor_rgb = twentyfifteen_hex2rgb ( $color_scheme [4] ); $colors = array ( 'background_color' => $color_scheme [0], 'header_background_color' => $color_scheme [1], 'box_background_color' => $color_scheme [2], 'textcolor' => $color_scheme [3], 'secondary_textcolor' => vsprintf ( 'rgba( %1$s, %2$s, %3$s, 0.7)', $color_textcolor_rgb ), 'border_color' => vsprintf ( 'rgba( %1$s, %2$s, %3$s, 0.1)', $color_textcolor_rgb ), 'border_focus_color' => vsprintf ( 'rgba( %1$s, %2$s, %3$s, 0.3)', $color_textcolor_rgb ), 'sidebar_textcolor' => $color_scheme [4], 'sidebar_border_color' => vsprintf ( 'rgba( %1$s, %2$s, %3$s, 0.1)', $color_sidebar_textcolor_rgb ), 'sidebar_border_focus_color' => vsprintf ( 'rgba( %1$s, %2$s, %3$s, 0.3)', $color_sidebar_textcolor_rgb ), 'secondary_sidebar_textcolor' => vsprintf ( 'rgba( %1$s, %2$s, %3$s, 0.7)', $color_sidebar_textcolor_rgb ), 'meta_box_background_color' => $color_scheme [5] ); $color_scheme_css = twentyfifteen_get_color_scheme_css ( $colors ); wp_add_inline_style ( 'twentyfifteen-style', $color_scheme_css ); } add_action ( 'wp_enqueue_scripts', 'twentyfifteen_color_scheme_css' ); /** * Binds JS listener to make Customizer color_scheme control. * * Passes color scheme data as colorScheme global. * * @since Twenty Fifteen 1.0 */ function twentyfifteen_customize_control_js() { wp_enqueue_script ( 'color-scheme-control', get_template_directory_uri () . '/js/color-scheme-control.js', array ( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20141216', true ); wp_localize_script ( 'color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes () ); } add_action ( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js' ); /** * Binds JS handlers to make the Customizer preview reload changes asynchronously. * * @since Twenty Fifteen 1.0 */ function twentyfifteen_customize_preview_js() { wp_enqueue_script ( 'twentyfifteen-customize-preview', get_template_directory_uri () . '/js/customize-preview.js', array ( 'customize-preview' ), '20141216', true ); } add_action ( 'customize_preview_init', 'twentyfifteen_customize_preview_js' ); /** * Returns CSS for the color schemes. * * @since Twenty Fifteen 1.0 * * @param array $colors * Color scheme colors. * @return string Color scheme CSS. */ function twentyfifteen_get_color_scheme_css($colors) { $colors = wp_parse_args ( $colors, array ( 'background_color' => '', 'header_background_color' => '', 'box_background_color' => '', 'textcolor' => '', 'secondary_textcolor' => '', 'border_color' => '', 'border_focus_color' => '', 'sidebar_textcolor' => '', 'sidebar_border_color' => '', 'sidebar_border_focus_color' => '', 'secondary_sidebar_textcolor' => '', 'meta_box_background_color' => '' ) ); $css = <<<CSS /* Color Scheme */ /* Background Color */ body { background-color: {$colors['background_color']}; } /* Sidebar Background Color */ body:before, .site-header { background-color: {$colors['header_background_color']}; } /* Box Background Color */ .post-navigation, .pagination, .secondary, .site-footer, .hentry, .page-header, .page-content, .comments-area, .widecolumn { background-color: {$colors['box_background_color']}; } /* Box Background Color */ button, input[type="button"], input[type="reset"], input[type="submit"], .pagination .prev, .pagination .next, .widget_calendar tbody a, .widget_calendar tbody a:hover, .widget_calendar tbody a:focus, .page-links a, .page-links a:hover, .page-links a:focus, .sticky-post { color: {$colors['box_background_color']}; } /* Main Text Color */ button, input[type="button"], input[type="reset"], input[type="submit"], .pagination .prev, .pagination .next, .widget_calendar tbody a, .page-links a, .sticky-post { background-color: {$colors['textcolor']}; } /* Main Text Color */ body, blockquote cite, blockquote small, a, .dropdown-toggle:after, .image-navigation a:hover, .image-navigation a:focus, .comment-navigation a:hover, .comment-navigation a:focus, .widget-title, .entry-footer a:hover, .entry-footer a:focus, .comment-metadata a:hover, .comment-metadata a:focus, .pingback .edit-link a:hover, .pingback .edit-link a:focus, .comment-list .reply a:hover, .comment-list .reply a:focus, .site-info a:hover, .site-info a:focus { color: {$colors['textcolor']}; } /* Main Text Color */ .entry-content a, .entry-summary a, .page-content a, .comment-content a, .pingback .comment-body > a, .author-description a, .taxonomy-description a, .textwidget a, .entry-footer a:hover, .comment-metadata a:hover, .pingback .edit-link a:hover, .comment-list .reply a:hover, .site-info a:hover { border-color: {$colors['textcolor']}; } /* Secondary Text Color */ button:hover, button:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="reset"]:hover, input[type="reset"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, .pagination .prev:hover, .pagination .prev:focus, .pagination .next:hover, .pagination .next:focus, .widget_calendar tbody a:hover, .widget_calendar tbody a:focus, .page-links a:hover, .page-links a:focus { background-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ background-color: {$colors['secondary_textcolor']}; } /* Secondary Text Color */ blockquote, a:hover, a:focus, .main-navigation .menu-item-description, .post-navigation .meta-nav, .post-navigation a:hover .post-title, .post-navigation a:focus .post-title, .image-navigation, .image-navigation a, .comment-navigation, .comment-navigation a, .widget, .author-heading, .entry-footer, .entry-footer a, .taxonomy-description, .page-links > .page-links-title, .entry-caption, .comment-author, .comment-metadata, .comment-metadata a, .pingback .edit-link, .pingback .edit-link a, .post-password-form label, .comment-form label, .comment-notes, .comment-awaiting-moderation, .logged-in-as, .form-allowed-tags, .no-comments, .site-info, .site-info a, .wp-caption-text, .gallery-caption, .comment-list .reply a, .widecolumn label, .widecolumn .mu_register label { color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ color: {$colors['secondary_textcolor']}; } /* Secondary Text Color */ blockquote, .logged-in-as a:hover, .comment-author a:hover { border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ border-color: {$colors['secondary_textcolor']}; } /* Border Color */ hr, .dropdown-toggle:hover, .dropdown-toggle:focus { background-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ background-color: {$colors['border_color']}; } /* Border Color */ pre, abbr[title], table, th, td, input, textarea, .main-navigation ul, .main-navigation li, .post-navigation, .post-navigation div + div, .pagination, .comment-navigation, .widget li, .widget_categories .children, .widget_nav_menu .sub-menu, .widget_pages .children, .site-header, .site-footer, .hentry + .hentry, .author-info, .entry-content .page-links a, .page-links > span, .page-header, .comments-area, .comment-list + .comment-respond, .comment-list article, .comment-list .pingback, .comment-list .trackback, .comment-list .reply a, .no-comments { border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ border-color: {$colors['border_color']}; } /* Border Focus Color */ a:focus, button:focus, input:focus { outline-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ outline-color: {$colors['border_focus_color']}; } input:focus, textarea:focus { border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */ border-color: {$colors['border_focus_color']}; } /* Sidebar Link Color */ .secondary-toggle:before { color: {$colors['sidebar_textcolor']}; } .site-title a, .site-description { color: {$colors['sidebar_textcolor']}; } /* Sidebar Text Color */ .site-title a:hover, .site-title a:focus { color: {$colors['secondary_sidebar_textcolor']}; } /* Sidebar Border Color */ .secondary-toggle { border-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */ border-color: {$colors['sidebar_border_color']}; } /* Sidebar Border Focus Color */ .secondary-toggle:hover, .secondary-toggle:focus { border-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */ border-color: {$colors['sidebar_border_focus_color']}; } .site-title a { outline-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */ outline-color: {$colors['sidebar_border_focus_color']}; } /* Meta Background Color */ .entry-footer { background-color: {$colors['meta_box_background_color']}; } @media screen and (min-width: 38.75em) { /* Main Text Color */ .page-header { border-color: {$colors['textcolor']}; } } @media screen and (min-width: 59.6875em) { /* Make sure its transparent on desktop */ .site-header, .secondary { background-color: transparent; } /* Sidebar Background Color */ .widget button, .widget input[type="button"], .widget input[type="reset"], .widget input[type="submit"], .widget_calendar tbody a, .widget_calendar tbody a:hover, .widget_calendar tbody a:focus { color: {$colors['header_background_color']}; } /* Sidebar Link Color */ .secondary a, .dropdown-toggle:after, .widget-title, .widget blockquote cite, .widget blockquote small { color: {$colors['sidebar_textcolor']}; } .widget button, .widget input[type="button"], .widget input[type="reset"], .widget input[type="submit"], .widget_calendar tbody a { background-color: {$colors['sidebar_textcolor']}; } .textwidget a { border-color: {$colors['sidebar_textcolor']}; } /* Sidebar Text Color */ .secondary a:hover, .secondary a:focus, .main-navigation .menu-item-description, .widget, .widget blockquote, .widget .wp-caption-text, .widget .gallery-caption { color: {$colors['secondary_sidebar_textcolor']}; } .widget button:hover, .widget button:focus, .widget input[type="button"]:hover, .widget input[type="button"]:focus, .widget input[type="reset"]:hover, .widget input[type="reset"]:focus, .widget input[type="submit"]:hover, .widget input[type="submit"]:focus, .widget_calendar tbody a:hover, .widget_calendar tbody a:focus { background-color: {$colors['secondary_sidebar_textcolor']}; } .widget blockquote { border-color: {$colors['secondary_sidebar_textcolor']}; } /* Sidebar Border Color */ .main-navigation ul, .main-navigation li, .widget input, .widget textarea, .widget table, .widget th, .widget td, .widget pre, .widget li, .widget_categories .children, .widget_nav_menu .sub-menu, .widget_pages .children, .widget abbr[title] { border-color: {$colors['sidebar_border_color']}; } .dropdown-toggle:hover, .dropdown-toggle:focus, .widget hr { background-color: {$colors['sidebar_border_color']}; } .widget input:focus, .widget textarea:focus { border-color: {$colors['sidebar_border_focus_color']}; } .sidebar a:focus, .dropdown-toggle:focus { outline-color: {$colors['sidebar_border_focus_color']}; } } CSS; return $css; } /** * Output an Underscore template for generating CSS for the color scheme. * * The template generates the css dynamically for instant display in the Customizer * preview. * * @since Twenty Fifteen 1.0 */ function twentyfifteen_color_scheme_css_template() { $colors = array ( 'background_color' => '{{ data.background_color }}', 'header_background_color' => '{{ data.header_background_color }}', 'box_background_color' => '{{ data.box_background_color }}', 'textcolor' => '{{ data.textcolor }}', 'secondary_textcolor' => '{{ data.secondary_textcolor }}', 'border_color' => '{{ data.border_color }}', 'border_focus_color' => '{{ data.border_focus_color }}', 'sidebar_textcolor' => '{{ data.sidebar_textcolor }}', 'sidebar_border_color' => '{{ data.sidebar_border_color }}', 'sidebar_border_focus_color' => '{{ data.sidebar_border_focus_color }}', 'secondary_sidebar_textcolor' => '{{ data.secondary_sidebar_textcolor }}', 'meta_box_background_color' => '{{ data.meta_box_background_color }}' ); ?> <script type="text/html" id="tmpl-twentyfifteen-color-scheme"> <?php echo twentyfifteen_get_color_scheme_css( $colors ); ?> </script> <?php } add_action ( 'customize_controls_print_footer_scripts', 'twentyfifteen_color_scheme_css_template' );
Java
<?php //$Id: mod_form.php,v 1.2.2.3 2009/03/19 12:23:11 mudrd8mz Exp $ /** * This file defines the main deva configuration form * It uses the standard core Moodle (>1.8) formslib. For * more info about them, please visit: * * http://docs.moodle.org/en/Development:lib/formslib.php * * The form must provide support for, at least these fields: * - name: text element of 64cc max * * Also, it's usual to use these fields: * - intro: one htmlarea element to describe the activity * (will be showed in the list of activities of * deva type (index.php) and in the header * of the deva main page (view.php). * - introformat: The format used to write the contents * of the intro field. It automatically defaults * to HTML when the htmleditor is used and can be * manually selected if the htmleditor is not used * (standard formats are: MOODLE, HTML, PLAIN, MARKDOWN) * See lib/weblib.php Constants and the format_text() * function for more info */ require_once($CFG->dirroot.'/course/moodleform_mod.php'); class mod_deva_mod_form extends moodleform_mod { function definition() { global $COURSE; $mform =& $this->_form; //------------------------------------------------------------------------------- /// Adding the "general" fieldset, where all the common settings are showed $mform->addElement('header', 'general', get_string('general', 'form')); /// Adding the standard "name" field $mform->addElement('text', 'name', get_string('devaname', 'deva'), array('size'=>'64')); $mform->setType('name', PARAM_TEXT); $mform->addRule('name', null, 'required', null, 'client'); $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); /// Adding the required "intro" field to hold the description of the instance $mform->addElement('htmleditor', 'intro', get_string('devaintro', 'deva')); $mform->setType('intro', PARAM_RAW); $mform->addRule('intro', get_string('required'), 'required', null, 'client'); $mform->setHelpButton('intro', array('writing', 'richtext'), false, 'editorhelpbutton'); /// Adding "introformat" field $mform->addElement('format', 'introformat', get_string('format')); //------------------------------------------------------------------------------- /// Adding the rest of deva settings, spreeading all them into this fieldset /// or adding more fieldsets ('header' elements) if needed for better logic $mform->addElement('static', 'label1', 'devasetting1', 'Your deva fields go here. Replace me!'); $mform->addElement('header', 'devafieldset', get_string('devafieldset', 'deva')); $mform->addElement('static', 'label2', 'devasetting2', 'Your deva fields go here. Replace me!'); //------------------------------------------------------------------------------- // add standard elements, common to all modules $this->standard_coursemodule_elements(); //------------------------------------------------------------------------------- // add standard buttons, common to all modules $this->add_action_buttons(); } } ?>
Java
/* arch/arm/mach-rk29/vpu.c * * Copyright (C) 2010 ROCKCHIP, Inc. * author: chenhengming chm@rock-chips.com * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/clk.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/ioport.h> #include <linux/miscdevice.h> #include <linux/mm.h> #include <linux/poll.h> #include <linux/platform_device.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/wakelock.h> #include <linux/cdev.h> #include <linux/of.h> #include <linux/rockchip/cpu.h> #include <linux/rockchip/cru.h> #include <asm/cacheflush.h> #include <asm/uaccess.h> #if defined(CONFIG_ION_ROCKCHIP) #include <linux/rockchip_ion.h> #endif //#define CONFIG_VCODEC_MMU #ifdef CONFIG_VCODEC_MMU #include <linux/rockchip/iovmm.h> #include <linux/rockchip/sysmmu.h> #include <linux/dma-buf.h> #endif #ifdef CONFIG_DEBUG_FS #include <linux/debugfs.h> #endif #if defined(CONFIG_ARCH_RK319X) #include <mach/grf.h> #endif #include "vcodec_service.h" #define HEVC_TEST_ENABLE 0 #define HEVC_SIM_ENABLE 0 #define VCODEC_CLOCK_ENABLE 1 typedef enum { VPU_DEC_ID_9190 = 0x6731, VPU_ID_8270 = 0x8270, VPU_ID_4831 = 0x4831, HEVC_ID = 0x6867, } VPU_HW_ID; typedef enum { VPU_DEC_TYPE_9190 = 0, VPU_ENC_TYPE_8270 = 0x100, VPU_ENC_TYPE_4831 , } VPU_HW_TYPE_E; typedef enum VPU_FREQ { VPU_FREQ_200M, VPU_FREQ_266M, VPU_FREQ_300M, VPU_FREQ_400M, VPU_FREQ_500M, VPU_FREQ_600M, VPU_FREQ_DEFAULT, VPU_FREQ_BUT, } VPU_FREQ; typedef struct { VPU_HW_ID hw_id; unsigned long hw_addr; unsigned long enc_offset; unsigned long enc_reg_num; unsigned long enc_io_size; unsigned long dec_offset; unsigned long dec_reg_num; unsigned long dec_io_size; } VPU_HW_INFO_E; #define VPU_SERVICE_SHOW_TIME 0 #if VPU_SERVICE_SHOW_TIME static struct timeval enc_start, enc_end; static struct timeval dec_start, dec_end; static struct timeval pp_start, pp_end; #endif #define MHZ (1000*1000) #define REG_NUM_9190_DEC (60) #define REG_NUM_9190_PP (41) #define REG_NUM_9190_DEC_PP (REG_NUM_9190_DEC+REG_NUM_9190_PP) #define REG_NUM_DEC_PP (REG_NUM_9190_DEC+REG_NUM_9190_PP) #define REG_NUM_ENC_8270 (96) #define REG_SIZE_ENC_8270 (0x200) #define REG_NUM_ENC_4831 (164) #define REG_SIZE_ENC_4831 (0x400) #define REG_NUM_HEVC_DEC (68) #define SIZE_REG(reg) ((reg)*4) static VPU_HW_INFO_E vpu_hw_set[] = { [0] = { .hw_id = VPU_ID_8270, .hw_addr = 0, .enc_offset = 0x0, .enc_reg_num = REG_NUM_ENC_8270, .enc_io_size = REG_NUM_ENC_8270 * 4, .dec_offset = REG_SIZE_ENC_8270, .dec_reg_num = REG_NUM_9190_DEC_PP, .dec_io_size = REG_NUM_9190_DEC_PP * 4, }, [1] = { .hw_id = VPU_ID_4831, .hw_addr = 0, .enc_offset = 0x0, .enc_reg_num = REG_NUM_ENC_4831, .enc_io_size = REG_NUM_ENC_4831 * 4, .dec_offset = REG_SIZE_ENC_4831, .dec_reg_num = REG_NUM_9190_DEC_PP, .dec_io_size = REG_NUM_9190_DEC_PP * 4, }, [2] = { .hw_id = HEVC_ID, .hw_addr = 0, .dec_offset = 0x0, .dec_reg_num = REG_NUM_HEVC_DEC, .dec_io_size = REG_NUM_HEVC_DEC * 4, }, }; #define DEC_INTERRUPT_REGISTER 1 #define PP_INTERRUPT_REGISTER 60 #define ENC_INTERRUPT_REGISTER 1 #define DEC_INTERRUPT_BIT 0x100 #define DEC_BUFFER_EMPTY_BIT 0x4000 #define PP_INTERRUPT_BIT 0x100 #define ENC_INTERRUPT_BIT 0x1 #define HEVC_DEC_INT_RAW_BIT 0x200 #define HEVC_DEC_STR_ERROR_BIT 0x4000 #define HEVC_DEC_BUS_ERROR_BIT 0x2000 #define HEVC_DEC_BUFFER_EMPTY_BIT 0x10000 #define VPU_REG_EN_ENC 14 #define VPU_REG_ENC_GATE 2 #define VPU_REG_ENC_GATE_BIT (1<<4) #define VPU_REG_EN_DEC 1 #define VPU_REG_DEC_GATE 2 #define VPU_REG_DEC_GATE_BIT (1<<10) #define VPU_REG_EN_PP 0 #define VPU_REG_PP_GATE 1 #define VPU_REG_PP_GATE_BIT (1<<8) #define VPU_REG_EN_DEC_PP 1 #define VPU_REG_DEC_PP_GATE 61 #define VPU_REG_DEC_PP_GATE_BIT (1<<8) static u8 addr_tbl_vpu_dec[] = { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 40, 41 }; static u8 addr_tbl_vpu_enc[] = { 5, 6, 7, 8, 9, 10, 11, 12, 13, 51 }; static u8 addr_tbl_hevc_dec[] = { 4, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 42, 43 }; /** * struct for process session which connect to vpu * * @author ChenHengming (2011-5-3) */ typedef struct vpu_session { VPU_CLIENT_TYPE type; /* a linked list of data so we can access them for debugging */ struct list_head list_session; /* a linked list of register data waiting for process */ struct list_head waiting; /* a linked list of register data in processing */ struct list_head running; /* a linked list of register data processed */ struct list_head done; wait_queue_head_t wait; pid_t pid; atomic_t task_running; } vpu_session; /** * struct for process register set * * @author ChenHengming (2011-5-4) */ typedef struct vpu_reg { VPU_CLIENT_TYPE type; VPU_FREQ freq; vpu_session *session; struct list_head session_link; /* link to vpu service session */ struct list_head status_link; /* link to register set list */ unsigned long size; #if defined(CONFIG_VCODEC_MMU) struct list_head mem_region_list; #endif unsigned long *reg; } vpu_reg; typedef struct vpu_device { atomic_t irq_count_codec; atomic_t irq_count_pp; unsigned long iobaseaddr; unsigned int iosize; volatile u32 *hwregs; } vpu_device; enum vcodec_device_id { VCODEC_DEVICE_ID_VPU, VCODEC_DEVICE_ID_HEVC }; struct vcodec_mem_region { struct list_head srv_lnk; struct list_head reg_lnk; struct list_head session_lnk; dma_addr_t iova; /* virtual address for iommu */ struct dma_buf *buf; struct dma_buf_attachment *attachment; struct sg_table *sg_table; struct ion_handle *hdl; }; typedef struct vpu_service_info { struct wake_lock wake_lock; struct delayed_work power_off_work; struct mutex lock; struct list_head waiting; /* link to link_reg in struct vpu_reg */ struct list_head running; /* link to link_reg in struct vpu_reg */ struct list_head done; /* link to link_reg in struct vpu_reg */ struct list_head session; /* link to list_session in struct vpu_session */ atomic_t total_running; bool enabled; vpu_reg *reg_codec; vpu_reg *reg_pproc; vpu_reg *reg_resev; VPUHwDecConfig_t dec_config; VPUHwEncConfig_t enc_config; VPU_HW_INFO_E *hw_info; unsigned long reg_size; bool auto_freq; bool bug_dec_addr; atomic_t freq_status; struct clk *aclk_vcodec; struct clk *hclk_vcodec; struct clk *clk_core; struct clk *clk_cabac; int irq_dec; int irq_enc; vpu_device enc_dev; vpu_device dec_dev; struct device *dev; struct cdev cdev; dev_t dev_t; struct class *cls; struct device *child_dev; struct dentry *debugfs_dir; struct dentry *debugfs_file_regs; u32 irq_status; #if defined(CONFIG_ION_ROCKCHIP) struct ion_client * ion_client; #endif #if defined(CONFIG_VCODEC_MMU) struct list_head mem_region_list; #endif enum vcodec_device_id dev_id; struct delayed_work simulate_work; } vpu_service_info; typedef struct vpu_request { unsigned long *req; unsigned long size; } vpu_request; /// global variable //static struct clk *pd_video; static struct dentry *parent; // debugfs root directory for all device (vpu, hevc). #ifdef CONFIG_DEBUG_FS static int vcodec_debugfs_init(void); static void vcodec_debugfs_exit(void); static struct dentry* vcodec_debugfs_create_device_dir(char *dirname, struct dentry *parent); static int debug_vcodec_open(struct inode *inode, struct file *file); static const struct file_operations debug_vcodec_fops = { .open = debug_vcodec_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; #endif #define VPU_POWER_OFF_DELAY 4*HZ /* 4s */ #define VPU_TIMEOUT_DELAY 2*HZ /* 2s */ #define VPU_SIMULATE_DELAY msecs_to_jiffies(15) static void vpu_get_clk(struct vpu_service_info *pservice) { #if VCODEC_CLOCK_ENABLE /*pd_video = clk_get(NULL, "pd_video"); if (IS_ERR(pd_video)) { pr_err("failed on clk_get pd_video\n"); }*/ pservice->aclk_vcodec = devm_clk_get(pservice->dev, "aclk_vcodec"); if (IS_ERR(pservice->aclk_vcodec)) { dev_err(pservice->dev, "failed on clk_get aclk_vcodec\n"); } pservice->hclk_vcodec = devm_clk_get(pservice->dev, "hclk_vcodec"); if (IS_ERR(pservice->hclk_vcodec)) { dev_err(pservice->dev, "failed on clk_get hclk_vcodec\n"); } if (pservice->dev_id == VCODEC_DEVICE_ID_HEVC) { pservice->clk_core = devm_clk_get(pservice->dev, "clk_core"); if (IS_ERR(pservice->clk_core)) { dev_err(pservice->dev, "failed on clk_get clk_core\n"); } pservice->clk_cabac = devm_clk_get(pservice->dev, "clk_cabac"); if (IS_ERR(pservice->clk_cabac)) { dev_err(pservice->dev, "failed on clk_get clk_cabac\n"); } } #endif } static void vpu_put_clk(struct vpu_service_info *pservice) { #if VCODEC_CLOCK_ENABLE //clk_put(pd_video); if (pservice->aclk_vcodec) { devm_clk_put(pservice->dev, pservice->aclk_vcodec); } if (pservice->hclk_vcodec) { devm_clk_put(pservice->dev, pservice->hclk_vcodec); } if (pservice->dev_id == VCODEC_DEVICE_ID_HEVC) { if (pservice->clk_core) { devm_clk_put(pservice->dev, pservice->clk_core); } if (pservice->clk_cabac) { devm_clk_put(pservice->dev, pservice->clk_cabac); } } #endif } static void vpu_reset(struct vpu_service_info *pservice) { #if defined(CONFIG_ARCH_RK29) clk_disable(aclk_ddr_vepu); cru_set_soft_reset(SOFT_RST_CPU_VODEC_A2A_AHB, true); cru_set_soft_reset(SOFT_RST_DDR_VCODEC_PORT, true); cru_set_soft_reset(SOFT_RST_VCODEC_AHB_BUS, true); cru_set_soft_reset(SOFT_RST_VCODEC_AXI_BUS, true); mdelay(10); cru_set_soft_reset(SOFT_RST_VCODEC_AXI_BUS, false); cru_set_soft_reset(SOFT_RST_VCODEC_AHB_BUS, false); cru_set_soft_reset(SOFT_RST_DDR_VCODEC_PORT, false); cru_set_soft_reset(SOFT_RST_CPU_VODEC_A2A_AHB, false); clk_enable(aclk_ddr_vepu); #elif defined(CONFIG_ARCH_RK30) pmu_set_idle_request(IDLE_REQ_VIDEO, true); cru_set_soft_reset(SOFT_RST_CPU_VCODEC, true); cru_set_soft_reset(SOFT_RST_VCODEC_NIU_AXI, true); cru_set_soft_reset(SOFT_RST_VCODEC_AHB, true); cru_set_soft_reset(SOFT_RST_VCODEC_AXI, true); mdelay(1); cru_set_soft_reset(SOFT_RST_VCODEC_AXI, false); cru_set_soft_reset(SOFT_RST_VCODEC_AHB, false); cru_set_soft_reset(SOFT_RST_VCODEC_NIU_AXI, false); cru_set_soft_reset(SOFT_RST_CPU_VCODEC, false); pmu_set_idle_request(IDLE_REQ_VIDEO, false); #endif pservice->reg_codec = NULL; pservice->reg_pproc = NULL; pservice->reg_resev = NULL; } static void reg_deinit(struct vpu_service_info *pservice, vpu_reg *reg); static void vpu_service_session_clear(struct vpu_service_info *pservice, vpu_session *session) { vpu_reg *reg, *n; list_for_each_entry_safe(reg, n, &session->waiting, session_link) { reg_deinit(pservice, reg); } list_for_each_entry_safe(reg, n, &session->running, session_link) { reg_deinit(pservice, reg); } list_for_each_entry_safe(reg, n, &session->done, session_link) { reg_deinit(pservice, reg); } } static void vpu_service_dump(struct vpu_service_info *pservice) { int running; vpu_reg *reg, *reg_tmp; vpu_session *session, *session_tmp; running = atomic_read(&pservice->total_running); printk("total_running %d\n", running); printk("reg_codec 0x%.8x\n", (unsigned int)pservice->reg_codec); printk("reg_pproc 0x%.8x\n", (unsigned int)pservice->reg_pproc); printk("reg_resev 0x%.8x\n", (unsigned int)pservice->reg_resev); list_for_each_entry_safe(session, session_tmp, &pservice->session, list_session) { printk("session pid %d type %d:\n", session->pid, session->type); running = atomic_read(&session->task_running); printk("task_running %d\n", running); list_for_each_entry_safe(reg, reg_tmp, &session->waiting, session_link) { printk("waiting register set 0x%.8x\n", (unsigned int)reg); } list_for_each_entry_safe(reg, reg_tmp, &session->running, session_link) { printk("running register set 0x%.8x\n", (unsigned int)reg); } list_for_each_entry_safe(reg, reg_tmp, &session->done, session_link) { printk("done register set 0x%.8x\n", (unsigned int)reg); } } } static void vpu_service_power_off(struct vpu_service_info *pservice) { int total_running; if (!pservice->enabled) { return; } pservice->enabled = false; total_running = atomic_read(&pservice->total_running); if (total_running) { pr_alert("alert: power off when %d task running!!\n", total_running); mdelay(50); pr_alert("alert: delay 50 ms for running task\n"); vpu_service_dump(pservice); } printk("%s: power off...", dev_name(pservice->dev)); #ifdef CONFIG_ARCH_RK29 pmu_set_power_domain(PD_VCODEC, false); #else //clk_disable(pd_video); #endif udelay(10); #if VCODEC_CLOCK_ENABLE clk_disable_unprepare(pservice->hclk_vcodec); clk_disable_unprepare(pservice->aclk_vcodec); if (pservice->dev_id == VCODEC_DEVICE_ID_HEVC) { clk_disable_unprepare(pservice->clk_core); clk_disable_unprepare(pservice->clk_cabac); } #endif wake_unlock(&pservice->wake_lock); printk("done\n"); } static inline void vpu_queue_power_off_work(struct vpu_service_info *pservice) { queue_delayed_work(system_nrt_wq, &pservice->power_off_work, VPU_POWER_OFF_DELAY); } static void vpu_power_off_work(struct work_struct *work_s) { struct delayed_work *dlwork = container_of(work_s, struct delayed_work, work); struct vpu_service_info *pservice = container_of(dlwork, struct vpu_service_info, power_off_work); if (mutex_trylock(&pservice->lock)) { vpu_service_power_off(pservice); mutex_unlock(&pservice->lock); } else { /* Come back later if the device is busy... */ vpu_queue_power_off_work(pservice); } } static void vpu_service_power_on(struct vpu_service_info *pservice) { static ktime_t last; ktime_t now = ktime_get(); if (ktime_to_ns(ktime_sub(now, last)) > NSEC_PER_SEC) { cancel_delayed_work_sync(&pservice->power_off_work); vpu_queue_power_off_work(pservice); last = now; } if (pservice->enabled) return ; pservice->enabled = true; printk("%s: power on\n", dev_name(pservice->dev)); #if VCODEC_CLOCK_ENABLE clk_prepare_enable(pservice->aclk_vcodec); clk_prepare_enable(pservice->hclk_vcodec); if (pservice->dev_id == VCODEC_DEVICE_ID_HEVC) { clk_prepare_enable(pservice->clk_core); clk_prepare_enable(pservice->clk_cabac); } #endif #if defined(CONFIG_ARCH_RK319X) /// select aclk_vepu as vcodec clock source. #define BIT_VCODEC_SEL (1<<7) writel_relaxed(readl_relaxed(RK319X_GRF_BASE + GRF_SOC_CON1) | (BIT_VCODEC_SEL) | (BIT_VCODEC_SEL << 16), RK319X_GRF_BASE + GRF_SOC_CON1); #endif udelay(10); #ifdef CONFIG_ARCH_RK29 pmu_set_power_domain(PD_VCODEC, true); #else //clk_enable(pd_video); #endif udelay(10); wake_lock(&pservice->wake_lock); } static inline bool reg_check_rmvb_wmv(vpu_reg *reg) { unsigned long type = (reg->reg[3] & 0xF0000000) >> 28; return ((type == 8) || (type == 4)); } static inline bool reg_check_interlace(vpu_reg *reg) { unsigned long type = (reg->reg[3] & (1 << 23)); return (type > 0); } static inline bool reg_check_avc(vpu_reg *reg) { unsigned long type = (reg->reg[3] & 0xF0000000) >> 28; return (type == 0); } static inline int reg_probe_width(vpu_reg *reg) { int width_in_mb = reg->reg[4] >> 23; return width_in_mb * 16; } #if defined(CONFIG_VCODEC_MMU) static unsigned int vcodec_map_ion_handle(vpu_service_info *pservice, vpu_reg *reg, struct ion_handle *ion_handle, struct dma_buf *buf, int offset) { struct vcodec_mem_region *mem_region = kzalloc(sizeof(struct vcodec_mem_region), GFP_KERNEL); if (mem_region == NULL) { dev_err(pservice->dev, "allocate memory for iommu memory region failed\n"); return -1; } mem_region->buf = buf; mem_region->hdl = ion_handle; mem_region->attachment = dma_buf_attach(buf, pservice->dev); if (IS_ERR_OR_NULL(mem_region->attachment)) { dev_err(pservice->dev, "dma_buf_attach() failed: %ld\n", PTR_ERR(mem_region->attachment)); goto err_buf_map_attach; } mem_region->sg_table = dma_buf_map_attachment(mem_region->attachment, DMA_BIDIRECTIONAL); if (IS_ERR_OR_NULL(mem_region->sg_table)) { dev_err(pservice->dev, "dma_buf_map_attachment() failed: %ld\n", PTR_ERR(mem_region->sg_table)); goto err_buf_map_attachment; } mem_region->iova = iovmm_map(pservice->dev, mem_region->sg_table->sgl, offset, buf->size); if (mem_region->iova == 0 || IS_ERR_VALUE(mem_region->iova)) { dev_err(pservice->dev, "iovmm_map() failed: %d\n", mem_region->iova); goto err_iovmm_map; } INIT_LIST_HEAD(&mem_region->reg_lnk); list_add_tail(&mem_region->reg_lnk, &reg->mem_region_list); return mem_region->iova; err_iovmm_map: dma_buf_unmap_attachment(mem_region->attachment, mem_region->sg_table, DMA_BIDIRECTIONAL); err_buf_map_attachment: dma_buf_detach(buf, mem_region->attachment); err_buf_map_attach: kfree(mem_region); return 0; } static int vcodec_reg_address_translate(struct vpu_service_info *pservice, vpu_reg *reg) { VPU_HW_ID hw_id; int i; hw_id = pservice->hw_info->hw_id; if (hw_id == HEVC_ID) { } else { if (reg->type == VPU_DEC) { for (i=0; i<sizeof(addr_tbl_vpu_dec); i++) { int usr_fd; struct ion_handle *hdl; //ion_phys_addr_t phy_addr; struct dma_buf *buf; //size_t len; int offset; #if 0 if (copy_from_user(&usr_fd, &reg->reg[addr_tbl_vpu_dec[i]], sizeof(usr_fd))) return -EFAULT; #else usr_fd = reg->reg[addr_tbl_vpu_dec[i]] & 0xFF; offset = reg->reg[addr_tbl_vpu_dec[i]] >> 8; #endif if (usr_fd != 0) { hdl = ion_import_dma_buf(pservice->ion_client, usr_fd); if (IS_ERR(hdl)) { pr_err("import dma-buf from fd %d failed\n", usr_fd); return PTR_ERR(hdl); } #if 0 ion_phys(pservice->ion_client, hdl, &phy_addr, &len); reg->reg[addr_tbl_vpu_dec[i]] = phy_addr + offset; ion_free(pservice->ion_client, hdl); #else buf = ion_share_dma_buf(pservice->ion_client, hdl); if (IS_ERR_OR_NULL(buf)) { dev_err(pservice->dev, "ion_share_dma_buf() failed\n"); ion_free(pservice->ion_client, hdl); return PTR_ERR(buf); } reg->reg[addr_tbl_vpu_dec[i]] = vcodec_map_ion_handle(pservice, reg, hdl, buf, offset); #endif } } } else if (reg->type == VPU_ENC) { } } return 0; } #endif static vpu_reg *reg_init(struct vpu_service_info *pservice, vpu_session *session, void __user *src, unsigned long size) { vpu_reg *reg = kmalloc(sizeof(vpu_reg)+pservice->reg_size, GFP_KERNEL); if (NULL == reg) { pr_err("error: kmalloc fail in reg_init\n"); return NULL; } if (size > pservice->reg_size) { printk("warning: vpu reg size %lu is larger than hw reg size %lu\n", size, pservice->reg_size); size = pservice->reg_size; } reg->session = session; reg->type = session->type; reg->size = size; reg->freq = VPU_FREQ_DEFAULT; reg->reg = (unsigned long *)&reg[1]; INIT_LIST_HEAD(&reg->session_link); INIT_LIST_HEAD(&reg->status_link); #if defined(CONFIG_VCODEC_MMU) INIT_LIST_HEAD(&reg->mem_region_list); #endif if (copy_from_user(&reg->reg[0], (void __user *)src, size)) { pr_err("error: copy_from_user failed in reg_init\n"); kfree(reg); return NULL; } #if defined(CONFIG_VCODEC_MMU) if (0 > vcodec_reg_address_translate(pservice, reg)) { pr_err("error: translate reg address failed\n"); kfree(reg); return NULL; } #endif mutex_lock(&pservice->lock); list_add_tail(&reg->status_link, &pservice->waiting); list_add_tail(&reg->session_link, &session->waiting); mutex_unlock(&pservice->lock); if (pservice->auto_freq) { if (!soc_is_rk2928g()) { if (reg->type == VPU_DEC || reg->type == VPU_DEC_PP) { if (reg_check_rmvb_wmv(reg)) { reg->freq = VPU_FREQ_200M; } else if (reg_check_avc(reg)) { if (reg_probe_width(reg) > 3200) { // raise frequency for 4k avc. reg->freq = VPU_FREQ_500M; } } else { if (reg_check_interlace(reg)) { reg->freq = VPU_FREQ_400M; } } } if (reg->type == VPU_PP) { reg->freq = VPU_FREQ_400M; } } } return reg; } static void reg_deinit(struct vpu_service_info *pservice, vpu_reg *reg) { #if defined(CONFIG_VCODEC_MMU) struct vcodec_mem_region *mem_region = NULL, *n; #endif list_del_init(&reg->session_link); list_del_init(&reg->status_link); if (reg == pservice->reg_codec) pservice->reg_codec = NULL; if (reg == pservice->reg_pproc) pservice->reg_pproc = NULL; #if defined(CONFIG_VCODEC_MMU) // release memory region attach to this registers table. list_for_each_entry_safe(mem_region, n, &reg->mem_region_list, reg_lnk) { iovmm_unmap(pservice->dev, mem_region->iova); dma_buf_unmap_attachment(mem_region->attachment, mem_region->sg_table, DMA_BIDIRECTIONAL); dma_buf_detach(mem_region->buf, mem_region->attachment); dma_buf_put(mem_region->buf); ion_free(pservice->ion_client, mem_region->hdl); list_del_init(&mem_region->reg_lnk); kfree(mem_region); } #endif kfree(reg); } static void reg_from_wait_to_run(struct vpu_service_info *pservice, vpu_reg *reg) { list_del_init(&reg->status_link); list_add_tail(&reg->status_link, &pservice->running); list_del_init(&reg->session_link); list_add_tail(&reg->session_link, &reg->session->running); } static void reg_copy_from_hw(vpu_reg *reg, volatile u32 *src, u32 count) { int i; u32 *dst = (u32 *)&reg->reg[0]; for (i = 0; i < count; i++) *dst++ = *src++; } static void reg_from_run_to_done(struct vpu_service_info *pservice, vpu_reg *reg) { int irq_reg = -1; list_del_init(&reg->status_link); list_add_tail(&reg->status_link, &pservice->done); list_del_init(&reg->session_link); list_add_tail(&reg->session_link, &reg->session->done); switch (reg->type) { case VPU_ENC : { pservice->reg_codec = NULL; reg_copy_from_hw(reg, pservice->enc_dev.hwregs, pservice->hw_info->enc_reg_num); irq_reg = ENC_INTERRUPT_REGISTER; break; } case VPU_DEC : { int reg_len = pservice->hw_info->hw_id == HEVC_ID ? REG_NUM_HEVC_DEC : REG_NUM_9190_DEC; pservice->reg_codec = NULL; reg_copy_from_hw(reg, pservice->dec_dev.hwregs, reg_len); irq_reg = DEC_INTERRUPT_REGISTER; break; } case VPU_PP : { pservice->reg_pproc = NULL; reg_copy_from_hw(reg, pservice->dec_dev.hwregs + PP_INTERRUPT_REGISTER, REG_NUM_9190_PP); pservice->dec_dev.hwregs[PP_INTERRUPT_REGISTER] = 0; break; } case VPU_DEC_PP : { pservice->reg_codec = NULL; pservice->reg_pproc = NULL; reg_copy_from_hw(reg, pservice->dec_dev.hwregs, REG_NUM_9190_DEC_PP); pservice->dec_dev.hwregs[PP_INTERRUPT_REGISTER] = 0; break; } default : { pr_err("error: copy reg from hw with unknown type %d\n", reg->type); break; } } if (irq_reg != -1) { reg->reg[irq_reg] = pservice->irq_status; } atomic_sub(1, &reg->session->task_running); atomic_sub(1, &pservice->total_running); wake_up(&reg->session->wait); } static void vpu_service_set_freq(struct vpu_service_info *pservice, vpu_reg *reg) { VPU_FREQ curr = atomic_read(&pservice->freq_status); if (curr == reg->freq) { return ; } atomic_set(&pservice->freq_status, reg->freq); switch (reg->freq) { case VPU_FREQ_200M : { clk_set_rate(pservice->aclk_vcodec, 200*MHZ); //printk("default: 200M\n"); } break; case VPU_FREQ_266M : { clk_set_rate(pservice->aclk_vcodec, 266*MHZ); //printk("default: 266M\n"); } break; case VPU_FREQ_300M : { clk_set_rate(pservice->aclk_vcodec, 300*MHZ); //printk("default: 300M\n"); } break; case VPU_FREQ_400M : { clk_set_rate(pservice->aclk_vcodec, 400*MHZ); //printk("default: 400M\n"); } break; case VPU_FREQ_500M : { clk_set_rate(pservice->aclk_vcodec, 500*MHZ); } break; case VPU_FREQ_600M : { clk_set_rate(pservice->aclk_vcodec, 600*MHZ); } break; default : { if (soc_is_rk2928g()) { clk_set_rate(pservice->aclk_vcodec, 400*MHZ); } else { clk_set_rate(pservice->aclk_vcodec, 300*MHZ); } //printk("default: 300M\n"); } break; } } #if HEVC_SIM_ENABLE static void simulate_start(struct vpu_service_info *pservice); #endif static void reg_copy_to_hw(struct vpu_service_info *pservice, vpu_reg *reg) { int i; u32 *src = (u32 *)&reg->reg[0]; atomic_add(1, &pservice->total_running); atomic_add(1, &reg->session->task_running); if (pservice->auto_freq) { vpu_service_set_freq(pservice, reg); } switch (reg->type) { case VPU_ENC : { int enc_count = pservice->hw_info->enc_reg_num; u32 *dst = (u32 *)pservice->enc_dev.hwregs; #if 0 if (pservice->bug_dec_addr) { #if !defined(CONFIG_ARCH_RK319X) cru_set_soft_reset(SOFT_RST_CPU_VCODEC, true); #endif cru_set_soft_reset(SOFT_RST_VCODEC_AHB, true); cru_set_soft_reset(SOFT_RST_VCODEC_AHB, false); #if !defined(CONFIG_ARCH_RK319X) cru_set_soft_reset(SOFT_RST_CPU_VCODEC, false); #endif } #endif pservice->reg_codec = reg; dst[VPU_REG_EN_ENC] = src[VPU_REG_EN_ENC] & 0x6; for (i = 0; i < VPU_REG_EN_ENC; i++) dst[i] = src[i]; for (i = VPU_REG_EN_ENC + 1; i < enc_count; i++) dst[i] = src[i]; dsb(); dst[VPU_REG_ENC_GATE] = src[VPU_REG_ENC_GATE] | VPU_REG_ENC_GATE_BIT; dst[VPU_REG_EN_ENC] = src[VPU_REG_EN_ENC]; #if VPU_SERVICE_SHOW_TIME do_gettimeofday(&enc_start); #endif } break; case VPU_DEC : { u32 *dst = (u32 *)pservice->dec_dev.hwregs; pservice->reg_codec = reg; if (pservice->hw_info->hw_id != HEVC_ID) { for (i = REG_NUM_9190_DEC - 1; i > VPU_REG_DEC_GATE; i--) dst[i] = src[i]; } else { for (i = REG_NUM_HEVC_DEC - 1; i > VPU_REG_EN_DEC; i--) { dst[i] = src[i]; } } dsb(); if (pservice->hw_info->hw_id != HEVC_ID) { dst[VPU_REG_DEC_GATE] = src[VPU_REG_DEC_GATE] | VPU_REG_DEC_GATE_BIT; dst[VPU_REG_EN_DEC] = src[VPU_REG_EN_DEC]; } else { dst[VPU_REG_EN_DEC] = src[VPU_REG_EN_DEC]; } dsb(); dmb(); #if VPU_SERVICE_SHOW_TIME do_gettimeofday(&dec_start); #endif } break; case VPU_PP : { u32 *dst = (u32 *)pservice->dec_dev.hwregs + PP_INTERRUPT_REGISTER; pservice->reg_pproc = reg; dst[VPU_REG_PP_GATE] = src[VPU_REG_PP_GATE] | VPU_REG_PP_GATE_BIT; for (i = VPU_REG_PP_GATE + 1; i < REG_NUM_9190_PP; i++) dst[i] = src[i]; dsb(); dst[VPU_REG_EN_PP] = src[VPU_REG_EN_PP]; #if VPU_SERVICE_SHOW_TIME do_gettimeofday(&pp_start); #endif } break; case VPU_DEC_PP : { u32 *dst = (u32 *)pservice->dec_dev.hwregs; pservice->reg_codec = reg; pservice->reg_pproc = reg; for (i = VPU_REG_EN_DEC_PP + 1; i < REG_NUM_9190_DEC_PP; i++) dst[i] = src[i]; dst[VPU_REG_EN_DEC_PP] = src[VPU_REG_EN_DEC_PP] | 0x2; dsb(); dst[VPU_REG_DEC_PP_GATE] = src[VPU_REG_DEC_PP_GATE] | VPU_REG_PP_GATE_BIT; dst[VPU_REG_DEC_GATE] = src[VPU_REG_DEC_GATE] | VPU_REG_DEC_GATE_BIT; dst[VPU_REG_EN_DEC] = src[VPU_REG_EN_DEC]; #if VPU_SERVICE_SHOW_TIME do_gettimeofday(&dec_start); #endif } break; default : { pr_err("error: unsupport session type %d", reg->type); atomic_sub(1, &pservice->total_running); atomic_sub(1, &reg->session->task_running); break; } } #if HEVC_SIM_ENABLE if (pservice->hw_info->hw_id == HEVC_ID) { simulate_start(pservice); } #endif } static void try_set_reg(struct vpu_service_info *pservice) { // first get reg from reg list if (!list_empty(&pservice->waiting)) { int can_set = 0; vpu_reg *reg = list_entry(pservice->waiting.next, vpu_reg, status_link); vpu_service_power_on(pservice); switch (reg->type) { case VPU_ENC : { if ((NULL == pservice->reg_codec) && (NULL == pservice->reg_pproc)) can_set = 1; } break; case VPU_DEC : { if (NULL == pservice->reg_codec) can_set = 1; if (pservice->auto_freq && (NULL != pservice->reg_pproc)) { can_set = 0; } } break; case VPU_PP : { if (NULL == pservice->reg_codec) { if (NULL == pservice->reg_pproc) can_set = 1; } else { if ((VPU_DEC == pservice->reg_codec->type) && (NULL == pservice->reg_pproc)) can_set = 1; // can not charge frequency when vpu is working if (pservice->auto_freq) { can_set = 0; } } } break; case VPU_DEC_PP : { if ((NULL == pservice->reg_codec) && (NULL == pservice->reg_pproc)) can_set = 1; } break; default : { printk("undefined reg type %d\n", reg->type); } break; } if (can_set) { reg_from_wait_to_run(pservice, reg); reg_copy_to_hw(pservice, reg); } } } static int return_reg(struct vpu_service_info *pservice, vpu_reg *reg, u32 __user *dst) { int ret = 0; switch (reg->type) { case VPU_ENC : { if (copy_to_user(dst, &reg->reg[0], pservice->hw_info->enc_io_size)) ret = -EFAULT; break; } case VPU_DEC : { int reg_len = pservice->hw_info->hw_id == HEVC_ID ? REG_NUM_HEVC_DEC : REG_NUM_9190_DEC; if (copy_to_user(dst, &reg->reg[0], SIZE_REG(reg_len))) ret = -EFAULT; break; } case VPU_PP : { if (copy_to_user(dst, &reg->reg[0], SIZE_REG(REG_NUM_9190_PP))) ret = -EFAULT; break; } case VPU_DEC_PP : { if (copy_to_user(dst, &reg->reg[0], SIZE_REG(REG_NUM_9190_DEC_PP))) ret = -EFAULT; break; } default : { ret = -EFAULT; pr_err("error: copy reg to user with unknown type %d\n", reg->type); break; } } reg_deinit(pservice, reg); return ret; } static long vpu_service_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct vpu_service_info *pservice = container_of(filp->f_dentry->d_inode->i_cdev, struct vpu_service_info, cdev); vpu_session *session = (vpu_session *)filp->private_data; if (NULL == session) { return -EINVAL; } switch (cmd) { case VPU_IOC_SET_CLIENT_TYPE : { session->type = (VPU_CLIENT_TYPE)arg; break; } case VPU_IOC_GET_HW_FUSE_STATUS : { vpu_request req; if (copy_from_user(&req, (void __user *)arg, sizeof(vpu_request))) { pr_err("error: VPU_IOC_GET_HW_FUSE_STATUS copy_from_user failed\n"); return -EFAULT; } else { if (VPU_ENC != session->type) { if (copy_to_user((void __user *)req.req, &pservice->dec_config, sizeof(VPUHwDecConfig_t))) { pr_err("error: VPU_IOC_GET_HW_FUSE_STATUS copy_to_user failed type %d\n", session->type); return -EFAULT; } } else { if (copy_to_user((void __user *)req.req, &pservice->enc_config, sizeof(VPUHwEncConfig_t))) { pr_err("error: VPU_IOC_GET_HW_FUSE_STATUS copy_to_user failed type %d\n", session->type); return -EFAULT; } } } break; } case VPU_IOC_SET_REG : { vpu_request req; vpu_reg *reg; if (copy_from_user(&req, (void __user *)arg, sizeof(vpu_request))) { pr_err("error: VPU_IOC_SET_REG copy_from_user failed\n"); return -EFAULT; } reg = reg_init(pservice, session, (void __user *)req.req, req.size); if (NULL == reg) { return -EFAULT; } else { mutex_lock(&pservice->lock); try_set_reg(pservice); mutex_unlock(&pservice->lock); } break; } case VPU_IOC_GET_REG : { vpu_request req; vpu_reg *reg; if (copy_from_user(&req, (void __user *)arg, sizeof(vpu_request))) { pr_err("error: VPU_IOC_GET_REG copy_from_user failed\n"); return -EFAULT; } else { int ret = wait_event_timeout(session->wait, !list_empty(&session->done), VPU_TIMEOUT_DELAY); if (!list_empty(&session->done)) { if (ret < 0) { pr_err("warning: pid %d wait task sucess but wait_evernt ret %d\n", session->pid, ret); } ret = 0; } else { if (unlikely(ret < 0)) { pr_err("error: pid %d wait task ret %d\n", session->pid, ret); } else if (0 == ret) { pr_err("error: pid %d wait %d task done timeout\n", session->pid, atomic_read(&session->task_running)); ret = -ETIMEDOUT; } } if (ret < 0) { int task_running = atomic_read(&session->task_running); mutex_lock(&pservice->lock); vpu_service_dump(pservice); if (task_running) { atomic_set(&session->task_running, 0); atomic_sub(task_running, &pservice->total_running); printk("%d task is running but not return, reset hardware...", task_running); vpu_reset(pservice); printk("done\n"); } vpu_service_session_clear(pservice, session); mutex_unlock(&pservice->lock); return ret; } } mutex_lock(&pservice->lock); reg = list_entry(session->done.next, vpu_reg, session_link); return_reg(pservice, reg, (u32 __user *)req.req); mutex_unlock(&pservice->lock); break; } default : { pr_err("error: unknow vpu service ioctl cmd %x\n", cmd); break; } } return 0; } static int vpu_service_check_hw(vpu_service_info *p, unsigned long hw_addr) { int ret = -EINVAL, i = 0; volatile u32 *tmp = (volatile u32 *)ioremap_nocache(hw_addr, 0x4); u32 enc_id = *tmp; #if HEVC_SIM_ENABLE /// temporary, hevc driver test. if (strncmp(dev_name(p->dev), "hevc_service", strlen("hevc_service")) == 0) { p->hw_info = &vpu_hw_set[2]; return 0; } #endif enc_id = (enc_id >> 16) & 0xFFFF; pr_info("checking hw id %x\n", enc_id); p->hw_info = NULL; for (i = 0; i < ARRAY_SIZE(vpu_hw_set); i++) { if (enc_id == vpu_hw_set[i].hw_id) { p->hw_info = &vpu_hw_set[i]; ret = 0; break; } } iounmap((void *)tmp); return ret; } static int vpu_service_open(struct inode *inode, struct file *filp) { struct vpu_service_info *pservice = container_of(inode->i_cdev, struct vpu_service_info, cdev); vpu_session *session = (vpu_session *)kmalloc(sizeof(vpu_session), GFP_KERNEL); if (NULL == session) { pr_err("error: unable to allocate memory for vpu_session."); return -ENOMEM; } session->type = VPU_TYPE_BUTT; session->pid = current->pid; INIT_LIST_HEAD(&session->waiting); INIT_LIST_HEAD(&session->running); INIT_LIST_HEAD(&session->done); INIT_LIST_HEAD(&session->list_session); init_waitqueue_head(&session->wait); atomic_set(&session->task_running, 0); mutex_lock(&pservice->lock); list_add_tail(&session->list_session, &pservice->session); filp->private_data = (void *)session; mutex_unlock(&pservice->lock); pr_debug("dev opened\n"); return nonseekable_open(inode, filp); } static int vpu_service_release(struct inode *inode, struct file *filp) { struct vpu_service_info *pservice = container_of(inode->i_cdev, struct vpu_service_info, cdev); int task_running; vpu_session *session = (vpu_session *)filp->private_data; if (NULL == session) return -EINVAL; task_running = atomic_read(&session->task_running); if (task_running) { pr_err("error: vpu_service session %d still has %d task running when closing\n", session->pid, task_running); msleep(50); } wake_up(&session->wait); mutex_lock(&pservice->lock); /* remove this filp from the asynchronusly notified filp's */ list_del_init(&session->list_session); vpu_service_session_clear(pservice, session); kfree(session); filp->private_data = NULL; mutex_unlock(&pservice->lock); pr_debug("dev closed\n"); return 0; } static const struct file_operations vpu_service_fops = { .unlocked_ioctl = vpu_service_ioctl, .open = vpu_service_open, .release = vpu_service_release, //.fasync = vpu_service_fasync, }; static irqreturn_t vdpu_irq(int irq, void *dev_id); static irqreturn_t vdpu_isr(int irq, void *dev_id); static irqreturn_t vepu_irq(int irq, void *dev_id); static irqreturn_t vepu_isr(int irq, void *dev_id); static void get_hw_info(struct vpu_service_info *pservice); #if HEVC_SIM_ENABLE static void simulate_work(struct work_struct *work_s) { struct delayed_work *dlwork = container_of(work_s, struct delayed_work, work); struct vpu_service_info *pservice = container_of(dlwork, struct vpu_service_info, simulate_work); vpu_device *dev = &pservice->dec_dev; if (!list_empty(&pservice->running)) { atomic_add(1, &dev->irq_count_codec); vdpu_isr(0, (void*)pservice); } else { //simulate_start(pservice); pr_err("empty running queue\n"); } } static void simulate_init(struct vpu_service_info *pservice) { INIT_DELAYED_WORK(&pservice->simulate_work, simulate_work); } static void simulate_start(struct vpu_service_info *pservice) { cancel_delayed_work_sync(&pservice->power_off_work); queue_delayed_work(system_nrt_wq, &pservice->simulate_work, VPU_SIMULATE_DELAY); } #endif #if HEVC_TEST_ENABLE static int hevc_test_case0(vpu_service_info *pservice); #endif #if defined(CONFIG_VCODEC_MMU) & defined(CONFIG_ION_ROCKCHIP) extern struct ion_client *rockchip_ion_client_create(const char * name); #endif static int vcodec_probe(struct platform_device *pdev) { int ret = 0; struct resource *res = NULL; struct device *dev = &pdev->dev; void __iomem *regs = NULL; struct device_node *np = pdev->dev.of_node; struct vpu_service_info *pservice = devm_kzalloc(dev, sizeof(struct vpu_service_info), GFP_KERNEL); char *prop = (char*)dev_name(dev); #if defined(CONFIG_VCODEC_MMU) struct device *mmu_dev = NULL; char mmu_dev_dts_name[40]; #endif pr_info("probe device %s\n", dev_name(dev)); of_property_read_string(np, "name", (const char**)&prop); dev_set_name(dev, prop); if (strcmp(dev_name(dev), "hevc_service") == 0) { pservice->dev_id = VCODEC_DEVICE_ID_HEVC; } else if (strcmp(dev_name(dev), "vpu_service") == 0) { pservice->dev_id = VCODEC_DEVICE_ID_VPU; } else { dev_err(dev, "Unknown device %s to probe\n", dev_name(dev)); return -1; } wake_lock_init(&pservice->wake_lock, WAKE_LOCK_SUSPEND, "vpu"); INIT_LIST_HEAD(&pservice->waiting); INIT_LIST_HEAD(&pservice->running); INIT_LIST_HEAD(&pservice->done); INIT_LIST_HEAD(&pservice->session); mutex_init(&pservice->lock); pservice->reg_codec = NULL; pservice->reg_pproc = NULL; atomic_set(&pservice->total_running, 0); pservice->enabled = false; pservice->dev = dev; vpu_get_clk(pservice); INIT_DELAYED_WORK(&pservice->power_off_work, vpu_power_off_work); vpu_service_power_on(pservice); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(pservice->dev, res); if (IS_ERR(regs)) { ret = PTR_ERR(regs); goto err; } ret = vpu_service_check_hw(pservice, res->start); if (ret < 0) { pr_err("error: hw info check faild\n"); goto err; } /// define regs address. pservice->dec_dev.iobaseaddr = res->start + pservice->hw_info->dec_offset; pservice->dec_dev.iosize = pservice->hw_info->dec_io_size; pservice->dec_dev.hwregs = (volatile u32 *)((u8 *)regs + pservice->hw_info->dec_offset); pservice->reg_size = pservice->dec_dev.iosize; if (pservice->hw_info->hw_id != HEVC_ID) { pservice->enc_dev.iobaseaddr = res->start + pservice->hw_info->enc_offset; pservice->enc_dev.iosize = pservice->hw_info->enc_io_size; pservice->reg_size = pservice->reg_size > pservice->enc_dev.iosize ? pservice->reg_size : pservice->enc_dev.iosize; pservice->enc_dev.hwregs = (volatile u32 *)((u8 *)regs + pservice->hw_info->enc_offset); pservice->irq_enc = platform_get_irq_byname(pdev, "irq_enc"); if (pservice->irq_enc < 0) { dev_err(pservice->dev, "cannot find IRQ encoder\n"); ret = -ENXIO; goto err; } ret = devm_request_threaded_irq(pservice->dev, pservice->irq_enc, vepu_irq, vepu_isr, 0, dev_name(pservice->dev), (void *)pservice); if (ret) { dev_err(pservice->dev, "error: can't request vepu irq %d\n", pservice->irq_enc); goto err; } } pservice->irq_dec = platform_get_irq_byname(pdev, "irq_dec"); if (pservice->irq_dec < 0) { dev_err(pservice->dev, "cannot find IRQ decoder\n"); ret = -ENXIO; goto err; } /* get the IRQ line */ ret = devm_request_threaded_irq(pservice->dev, pservice->irq_dec, vdpu_irq, vdpu_isr, 0, dev_name(pservice->dev), (void *)pservice); if (ret) { dev_err(pservice->dev, "error: can't request vdpu irq %d\n", pservice->irq_dec); goto err; } atomic_set(&pservice->dec_dev.irq_count_codec, 0); atomic_set(&pservice->dec_dev.irq_count_pp, 0); atomic_set(&pservice->enc_dev.irq_count_codec, 0); atomic_set(&pservice->enc_dev.irq_count_pp, 0); /// create device ret = alloc_chrdev_region(&pservice->dev_t, 0, 1, dev_name(dev)); if (ret) { dev_err(dev, "alloc dev_t failed\n"); goto err; } cdev_init(&pservice->cdev, &vpu_service_fops); pservice->cdev.owner = THIS_MODULE; pservice->cdev.ops = &vpu_service_fops; ret = cdev_add(&pservice->cdev, pservice->dev_t, 1); if (ret) { dev_err(dev, "add dev_t failed\n"); goto err; } pservice->cls = class_create(THIS_MODULE, dev_name(dev)); if (IS_ERR(pservice->cls)) { ret = PTR_ERR(pservice->cls); dev_err(dev, "class_create err:%d\n", ret); goto err; } pservice->child_dev = device_create(pservice->cls, dev, pservice->dev_t, NULL, dev_name(dev)); platform_set_drvdata(pdev, pservice); get_hw_info(pservice); #ifdef CONFIG_DEBUG_FS pservice->debugfs_dir = vcodec_debugfs_create_device_dir((char*)dev_name(dev), parent); if (pservice->debugfs_dir == NULL) { pr_err("create debugfs dir %s failed\n", dev_name(dev)); } pservice->debugfs_file_regs = debugfs_create_file("regs", 0664, pservice->debugfs_dir, pservice, &debug_vcodec_fops); #endif vpu_service_power_off(pservice); pr_info("init success\n"); #if defined(CONFIG_VCODEC_MMU) & defined(CONFIG_ION_ROCKCHIP) pservice->ion_client = rockchip_ion_client_create("vpu"); if (IS_ERR(pservice->ion_client)) { dev_err(&pdev->dev, "failed to create ion client for vcodec"); return PTR_ERR(pservice->ion_client); } else { dev_info(&pdev->dev, "vcodec ion client create success!\n"); } sprintf(mmu_dev_dts_name, "iommu,%s", dev_name(dev)); mmu_dev = rockchip_get_sysmmu_device_by_compatible(mmu_dev_dts_name); platform_set_sysmmu(mmu_dev, pservice->dev); iovmm_activate(pservice->dev); #endif #if HEVC_SIM_ENABLE if (pservice->hw_info->hw_id == HEVC_ID) { simulate_init(pservice); } #endif #if HEVC_TEST_ENABLE hevc_test_case0(pservice); #endif return 0; err: pr_info("init failed\n"); vpu_service_power_off(pservice); vpu_put_clk(pservice); wake_lock_destroy(&pservice->wake_lock); if (res) { if (regs) { devm_ioremap_release(&pdev->dev, res); } devm_release_mem_region(&pdev->dev, res->start, resource_size(res)); } if (pservice->irq_enc > 0) { free_irq(pservice->irq_enc, (void *)pservice); } if (pservice->irq_dec > 0) { free_irq(pservice->irq_dec, (void *)pservice); } if (pservice->child_dev) { device_destroy(pservice->cls, pservice->dev_t); cdev_del(&pservice->cdev); unregister_chrdev_region(pservice->dev_t, 1); } if (pservice->cls) { class_destroy(pservice->cls); } return ret; } static int vcodec_remove(struct platform_device *pdev) { struct vpu_service_info *pservice = platform_get_drvdata(pdev); struct resource *res; device_destroy(pservice->cls, pservice->dev_t); class_destroy(pservice->cls); cdev_del(&pservice->cdev); unregister_chrdev_region(pservice->dev_t, 1); free_irq(pservice->irq_enc, (void *)&pservice->enc_dev); free_irq(pservice->irq_dec, (void *)&pservice->dec_dev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); devm_ioremap_release(&pdev->dev, res); devm_release_mem_region(&pdev->dev, res->start, resource_size(res)); vpu_put_clk(pservice); wake_lock_destroy(&pservice->wake_lock); #ifdef CONFIG_DEBUG_FS if (pservice->debugfs_file_regs) { debugfs_remove(pservice->debugfs_file_regs); } if (pservice->debugfs_dir) { debugfs_remove(pservice->debugfs_dir); } #endif return 0; } #if defined(CONFIG_OF) static const struct of_device_id vcodec_service_dt_ids[] = { {.compatible = "vpu_service",}, {.compatible = "rockchip,hevc_service",}, {}, }; #endif static struct platform_driver vcodec_driver = { .probe = vcodec_probe, .remove = vcodec_remove, .driver = { .name = "vcodec", .owner = THIS_MODULE, #if defined(CONFIG_OF) .of_match_table = of_match_ptr(vcodec_service_dt_ids), #endif }, }; static void get_hw_info(struct vpu_service_info *pservice) { VPUHwDecConfig_t *dec = &pservice->dec_config; VPUHwEncConfig_t *enc = &pservice->enc_config; if (pservice->dev_id == VCODEC_DEVICE_ID_VPU) { u32 configReg = pservice->dec_dev.hwregs[VPU_DEC_HWCFG0]; u32 asicID = pservice->dec_dev.hwregs[0]; dec->h264Support = (configReg >> DWL_H264_E) & 0x3U; dec->jpegSupport = (configReg >> DWL_JPEG_E) & 0x01U; if (dec->jpegSupport && ((configReg >> DWL_PJPEG_E) & 0x01U)) dec->jpegSupport = JPEG_PROGRESSIVE; dec->mpeg4Support = (configReg >> DWL_MPEG4_E) & 0x3U; dec->vc1Support = (configReg >> DWL_VC1_E) & 0x3U; dec->mpeg2Support = (configReg >> DWL_MPEG2_E) & 0x01U; dec->sorensonSparkSupport = (configReg >> DWL_SORENSONSPARK_E) & 0x01U; dec->refBufSupport = (configReg >> DWL_REF_BUFF_E) & 0x01U; dec->vp6Support = (configReg >> DWL_VP6_E) & 0x01U; if (!soc_is_rk3190() && !soc_is_rk3288()) { dec->maxDecPicWidth = configReg & 0x07FFU; } else { dec->maxDecPicWidth = 4096; } /* 2nd Config register */ configReg = pservice->dec_dev.hwregs[VPU_DEC_HWCFG1]; if (dec->refBufSupport) { if ((configReg >> DWL_REF_BUFF_ILACE_E) & 0x01U) dec->refBufSupport |= 2; if ((configReg >> DWL_REF_BUFF_DOUBLE_E) & 0x01U) dec->refBufSupport |= 4; } dec->customMpeg4Support = (configReg >> DWL_MPEG4_CUSTOM_E) & 0x01U; dec->vp7Support = (configReg >> DWL_VP7_E) & 0x01U; dec->vp8Support = (configReg >> DWL_VP8_E) & 0x01U; dec->avsSupport = (configReg >> DWL_AVS_E) & 0x01U; /* JPEG xtensions */ if (((asicID >> 16) >= 0x8190U) || ((asicID >> 16) == 0x6731U)) { dec->jpegESupport = (configReg >> DWL_JPEG_EXT_E) & 0x01U; } else { dec->jpegESupport = JPEG_EXT_NOT_SUPPORTED; } if (((asicID >> 16) >= 0x9170U) || ((asicID >> 16) == 0x6731U) ) { dec->rvSupport = (configReg >> DWL_RV_E) & 0x03U; } else { dec->rvSupport = RV_NOT_SUPPORTED; } dec->mvcSupport = (configReg >> DWL_MVC_E) & 0x03U; if (dec->refBufSupport && (asicID >> 16) == 0x6731U ) { dec->refBufSupport |= 8; /* enable HW support for offset */ } /// invalidate fuse register value in rk319x vpu and following. if (!soc_is_rk3190() && !soc_is_rk3288()) { VPUHwFuseStatus_t hwFuseSts; /* Decoder fuse configuration */ u32 fuseReg = pservice->dec_dev.hwregs[VPU_DEC_HW_FUSE_CFG]; hwFuseSts.h264SupportFuse = (fuseReg >> DWL_H264_FUSE_E) & 0x01U; hwFuseSts.mpeg4SupportFuse = (fuseReg >> DWL_MPEG4_FUSE_E) & 0x01U; hwFuseSts.mpeg2SupportFuse = (fuseReg >> DWL_MPEG2_FUSE_E) & 0x01U; hwFuseSts.sorensonSparkSupportFuse = (fuseReg >> DWL_SORENSONSPARK_FUSE_E) & 0x01U; hwFuseSts.jpegSupportFuse = (fuseReg >> DWL_JPEG_FUSE_E) & 0x01U; hwFuseSts.vp6SupportFuse = (fuseReg >> DWL_VP6_FUSE_E) & 0x01U; hwFuseSts.vc1SupportFuse = (fuseReg >> DWL_VC1_FUSE_E) & 0x01U; hwFuseSts.jpegProgSupportFuse = (fuseReg >> DWL_PJPEG_FUSE_E) & 0x01U; hwFuseSts.rvSupportFuse = (fuseReg >> DWL_RV_FUSE_E) & 0x01U; hwFuseSts.avsSupportFuse = (fuseReg >> DWL_AVS_FUSE_E) & 0x01U; hwFuseSts.vp7SupportFuse = (fuseReg >> DWL_VP7_FUSE_E) & 0x01U; hwFuseSts.vp8SupportFuse = (fuseReg >> DWL_VP8_FUSE_E) & 0x01U; hwFuseSts.customMpeg4SupportFuse = (fuseReg >> DWL_CUSTOM_MPEG4_FUSE_E) & 0x01U; hwFuseSts.mvcSupportFuse = (fuseReg >> DWL_MVC_FUSE_E) & 0x01U; /* check max. decoder output width */ if (fuseReg & 0x8000U) hwFuseSts.maxDecPicWidthFuse = 1920; else if (fuseReg & 0x4000U) hwFuseSts.maxDecPicWidthFuse = 1280; else if (fuseReg & 0x2000U) hwFuseSts.maxDecPicWidthFuse = 720; else if (fuseReg & 0x1000U) hwFuseSts.maxDecPicWidthFuse = 352; else /* remove warning */ hwFuseSts.maxDecPicWidthFuse = 352; hwFuseSts.refBufSupportFuse = (fuseReg >> DWL_REF_BUFF_FUSE_E) & 0x01U; /* Pp configuration */ configReg = pservice->dec_dev.hwregs[VPU_PP_HW_SYNTH_CFG]; if ((configReg >> DWL_PP_E) & 0x01U) { dec->ppSupport = 1; dec->maxPpOutPicWidth = configReg & 0x07FFU; /*pHwCfg->ppConfig = (configReg >> DWL_CFG_E) & 0x0FU; */ dec->ppConfig = configReg; } else { dec->ppSupport = 0; dec->maxPpOutPicWidth = 0; dec->ppConfig = 0; } /* check the HW versio */ if (((asicID >> 16) >= 0x8190U) || ((asicID >> 16) == 0x6731U)) { /* Pp configuration */ configReg = pservice->dec_dev.hwregs[VPU_DEC_HW_FUSE_CFG]; if ((configReg >> DWL_PP_E) & 0x01U) { /* Pp fuse configuration */ u32 fuseRegPp = pservice->dec_dev.hwregs[VPU_PP_HW_FUSE_CFG]; if ((fuseRegPp >> DWL_PP_FUSE_E) & 0x01U) { hwFuseSts.ppSupportFuse = 1; /* check max. pp output width */ if (fuseRegPp & 0x8000U) hwFuseSts.maxPpOutPicWidthFuse = 1920; else if (fuseRegPp & 0x4000U) hwFuseSts.maxPpOutPicWidthFuse = 1280; else if (fuseRegPp & 0x2000U) hwFuseSts.maxPpOutPicWidthFuse = 720; else if (fuseRegPp & 0x1000U) hwFuseSts.maxPpOutPicWidthFuse = 352; else hwFuseSts.maxPpOutPicWidthFuse = 352; hwFuseSts.ppConfigFuse = fuseRegPp; } else { hwFuseSts.ppSupportFuse = 0; hwFuseSts.maxPpOutPicWidthFuse = 0; hwFuseSts.ppConfigFuse = 0; } } else { hwFuseSts.ppSupportFuse = 0; hwFuseSts.maxPpOutPicWidthFuse = 0; hwFuseSts.ppConfigFuse = 0; } if (dec->maxDecPicWidth > hwFuseSts.maxDecPicWidthFuse) dec->maxDecPicWidth = hwFuseSts.maxDecPicWidthFuse; if (dec->maxPpOutPicWidth > hwFuseSts.maxPpOutPicWidthFuse) dec->maxPpOutPicWidth = hwFuseSts.maxPpOutPicWidthFuse; if (!hwFuseSts.h264SupportFuse) dec->h264Support = H264_NOT_SUPPORTED; if (!hwFuseSts.mpeg4SupportFuse) dec->mpeg4Support = MPEG4_NOT_SUPPORTED; if (!hwFuseSts.customMpeg4SupportFuse) dec->customMpeg4Support = MPEG4_CUSTOM_NOT_SUPPORTED; if (!hwFuseSts.jpegSupportFuse) dec->jpegSupport = JPEG_NOT_SUPPORTED; if ((dec->jpegSupport == JPEG_PROGRESSIVE) && !hwFuseSts.jpegProgSupportFuse) dec->jpegSupport = JPEG_BASELINE; if (!hwFuseSts.mpeg2SupportFuse) dec->mpeg2Support = MPEG2_NOT_SUPPORTED; if (!hwFuseSts.vc1SupportFuse) dec->vc1Support = VC1_NOT_SUPPORTED; if (!hwFuseSts.vp6SupportFuse) dec->vp6Support = VP6_NOT_SUPPORTED; if (!hwFuseSts.vp7SupportFuse) dec->vp7Support = VP7_NOT_SUPPORTED; if (!hwFuseSts.vp8SupportFuse) dec->vp8Support = VP8_NOT_SUPPORTED; if (!hwFuseSts.ppSupportFuse) dec->ppSupport = PP_NOT_SUPPORTED; /* check the pp config vs fuse status */ if ((dec->ppConfig & 0xFC000000) && ((hwFuseSts.ppConfigFuse & 0xF0000000) >> 5)) { u32 deInterlace = ((dec->ppConfig & PP_DEINTERLACING) >> 25); u32 alphaBlend = ((dec->ppConfig & PP_ALPHA_BLENDING) >> 24); u32 deInterlaceFuse = (((hwFuseSts.ppConfigFuse >> 5) & PP_DEINTERLACING) >> 25); u32 alphaBlendFuse = (((hwFuseSts.ppConfigFuse >> 5) & PP_ALPHA_BLENDING) >> 24); if (deInterlace && !deInterlaceFuse) dec->ppConfig &= 0xFD000000; if (alphaBlend && !alphaBlendFuse) dec->ppConfig &= 0xFE000000; } if (!hwFuseSts.sorensonSparkSupportFuse) dec->sorensonSparkSupport = SORENSON_SPARK_NOT_SUPPORTED; if (!hwFuseSts.refBufSupportFuse) dec->refBufSupport = REF_BUF_NOT_SUPPORTED; if (!hwFuseSts.rvSupportFuse) dec->rvSupport = RV_NOT_SUPPORTED; if (!hwFuseSts.avsSupportFuse) dec->avsSupport = AVS_NOT_SUPPORTED; if (!hwFuseSts.mvcSupportFuse) dec->mvcSupport = MVC_NOT_SUPPORTED; } } configReg = pservice->enc_dev.hwregs[63]; enc->maxEncodedWidth = configReg & ((1 << 11) - 1); enc->h264Enabled = (configReg >> 27) & 1; enc->mpeg4Enabled = (configReg >> 26) & 1; enc->jpegEnabled = (configReg >> 25) & 1; enc->vsEnabled = (configReg >> 24) & 1; enc->rgbEnabled = (configReg >> 28) & 1; //enc->busType = (configReg >> 20) & 15; //enc->synthesisLanguage = (configReg >> 16) & 15; //enc->busWidth = (configReg >> 12) & 15; enc->reg_size = pservice->reg_size; enc->reserv[0] = enc->reserv[1] = 0; pservice->auto_freq = soc_is_rk2928g() || soc_is_rk2928l() || soc_is_rk2926() || soc_is_rk3288(); if (pservice->auto_freq) { pr_info("vpu_service set to auto frequency mode\n"); atomic_set(&pservice->freq_status, VPU_FREQ_BUT); } pservice->bug_dec_addr = cpu_is_rk30xx(); //printk("cpu 3066b bug %d\n", service.bug_dec_addr); } else { // disable frequency switch in hevc. pservice->auto_freq = false; } } static irqreturn_t vdpu_irq(int irq, void *dev_id) { struct vpu_service_info *pservice = (struct vpu_service_info*)dev_id; vpu_device *dev = &pservice->dec_dev; u32 raw_status; u32 irq_status = raw_status = readl(dev->hwregs + DEC_INTERRUPT_REGISTER); pr_debug("dec_irq\n"); if (irq_status & DEC_INTERRUPT_BIT) { pr_debug("dec_isr dec %x\n", irq_status); if ((irq_status & 0x40001) == 0x40001) { do { irq_status = readl(dev->hwregs + DEC_INTERRUPT_REGISTER); } while ((irq_status & 0x40001) == 0x40001); } /* clear dec IRQ */ if (pservice->hw_info->hw_id != HEVC_ID) { writel(irq_status & (~DEC_INTERRUPT_BIT|DEC_BUFFER_EMPTY_BIT), dev->hwregs + DEC_INTERRUPT_REGISTER); } else { /*writel(irq_status & (~(DEC_INTERRUPT_BIT|HEVC_DEC_INT_RAW_BIT|HEVC_DEC_STR_ERROR_BIT|HEVC_DEC_BUS_ERROR_BIT|HEVC_DEC_BUFFER_EMPTY_BIT)), dev->hwregs + DEC_INTERRUPT_REGISTER);*/ writel(0, dev->hwregs + DEC_INTERRUPT_REGISTER); } atomic_add(1, &dev->irq_count_codec); } if (pservice->hw_info->hw_id != HEVC_ID) { irq_status = readl(dev->hwregs + PP_INTERRUPT_REGISTER); if (irq_status & PP_INTERRUPT_BIT) { pr_debug("vdpu_isr pp %x\n", irq_status); /* clear pp IRQ */ writel(irq_status & (~DEC_INTERRUPT_BIT), dev->hwregs + PP_INTERRUPT_REGISTER); atomic_add(1, &dev->irq_count_pp); } } pservice->irq_status = raw_status; return IRQ_WAKE_THREAD; } static irqreturn_t vdpu_isr(int irq, void *dev_id) { struct vpu_service_info *pservice = (struct vpu_service_info*)dev_id; vpu_device *dev = &pservice->dec_dev; mutex_lock(&pservice->lock); if (atomic_read(&dev->irq_count_codec)) { #if VPU_SERVICE_SHOW_TIME do_gettimeofday(&dec_end); pr_info("dec task: %ld ms\n", (dec_end.tv_sec - dec_start.tv_sec) * 1000 + (dec_end.tv_usec - dec_start.tv_usec) / 1000); #endif atomic_sub(1, &dev->irq_count_codec); if (NULL == pservice->reg_codec) { pr_err("error: dec isr with no task waiting\n"); } else { reg_from_run_to_done(pservice, pservice->reg_codec); } } if (atomic_read(&dev->irq_count_pp)) { #if VPU_SERVICE_SHOW_TIME do_gettimeofday(&pp_end); printk("pp task: %ld ms\n", (pp_end.tv_sec - pp_start.tv_sec) * 1000 + (pp_end.tv_usec - pp_start.tv_usec) / 1000); #endif atomic_sub(1, &dev->irq_count_pp); if (NULL == pservice->reg_pproc) { pr_err("error: pp isr with no task waiting\n"); } else { reg_from_run_to_done(pservice, pservice->reg_pproc); } } try_set_reg(pservice); mutex_unlock(&pservice->lock); return IRQ_HANDLED; } static irqreturn_t vepu_irq(int irq, void *dev_id) { //struct vpu_device *dev = (struct vpu_device *) dev_id; struct vpu_service_info *pservice = (struct vpu_service_info*)dev_id; vpu_device *dev = &pservice->enc_dev; u32 irq_status = readl(dev->hwregs + ENC_INTERRUPT_REGISTER); pr_debug("vepu_irq irq status %x\n", irq_status); #if VPU_SERVICE_SHOW_TIME do_gettimeofday(&enc_end); pr_info("enc task: %ld ms\n", (enc_end.tv_sec - enc_start.tv_sec) * 1000 + (enc_end.tv_usec - enc_start.tv_usec) / 1000); #endif if (likely(irq_status & ENC_INTERRUPT_BIT)) { /* clear enc IRQ */ writel(irq_status & (~ENC_INTERRUPT_BIT), dev->hwregs + ENC_INTERRUPT_REGISTER); atomic_add(1, &dev->irq_count_codec); } pservice->irq_status = irq_status; return IRQ_WAKE_THREAD; } static irqreturn_t vepu_isr(int irq, void *dev_id) { //struct vpu_device *dev = (struct vpu_device *) dev_id; struct vpu_service_info *pservice = (struct vpu_service_info*)dev_id; vpu_device *dev = &pservice->enc_dev; mutex_lock(&pservice->lock); if (atomic_read(&dev->irq_count_codec)) { atomic_sub(1, &dev->irq_count_codec); if (NULL == pservice->reg_codec) { pr_err("error: enc isr with no task waiting\n"); } else { reg_from_run_to_done(pservice, pservice->reg_codec); } } try_set_reg(pservice); mutex_unlock(&pservice->lock); return IRQ_HANDLED; } static int __init vcodec_service_init(void) { int ret; if ((ret = platform_driver_register(&vcodec_driver)) != 0) { pr_err("Platform device register failed (%d).\n", ret); return ret; } #ifdef CONFIG_DEBUG_FS vcodec_debugfs_init(); #endif return ret; } static void __exit vcodec_service_exit(void) { #ifdef CONFIG_DEBUG_FS vcodec_debugfs_exit(); #endif platform_driver_unregister(&vcodec_driver); } module_init(vcodec_service_init); module_exit(vcodec_service_exit); #ifdef CONFIG_DEBUG_FS #include <linux/seq_file.h> static int vcodec_debugfs_init() { parent = debugfs_create_dir("vcodec", NULL); if (!parent) return -1; return 0; } static void vcodec_debugfs_exit() { debugfs_remove(parent); } static struct dentry* vcodec_debugfs_create_device_dir(char *dirname, struct dentry *parent) { return debugfs_create_dir(dirname, parent); } static int debug_vcodec_show(struct seq_file *s, void *unused) { struct vpu_service_info *pservice = s->private; unsigned int i, n; vpu_reg *reg, *reg_tmp; vpu_session *session, *session_tmp; mutex_lock(&pservice->lock); vpu_service_power_on(pservice); if (pservice->hw_info->hw_id != HEVC_ID) { seq_printf(s, "\nENC Registers:\n"); n = pservice->enc_dev.iosize >> 2; for (i = 0; i < n; i++) { seq_printf(s, "\tswreg%d = %08X\n", i, readl(pservice->enc_dev.hwregs + i)); } } seq_printf(s, "\nDEC Registers:\n"); n = pservice->dec_dev.iosize >> 2; for (i = 0; i < n; i++) { seq_printf(s, "\tswreg%d = %08X\n", i, readl(pservice->dec_dev.hwregs + i)); } seq_printf(s, "\nvpu service status:\n"); list_for_each_entry_safe(session, session_tmp, &pservice->session, list_session) { seq_printf(s, "session pid %d type %d:\n", session->pid, session->type); //seq_printf(s, "waiting reg set %d\n"); list_for_each_entry_safe(reg, reg_tmp, &session->waiting, session_link) { seq_printf(s, "waiting register set\n"); } list_for_each_entry_safe(reg, reg_tmp, &session->running, session_link) { seq_printf(s, "running register set\n"); } list_for_each_entry_safe(reg, reg_tmp, &session->done, session_link) { seq_printf(s, "done register set\n"); } } mutex_unlock(&pservice->lock); return 0; } static int debug_vcodec_open(struct inode *inode, struct file *file) { return single_open(file, debug_vcodec_show, inode->i_private); } #endif #if HEVC_TEST_ENABLE & defined(CONFIG_ION_ROCKCHIP) #include "hevc_test_inc/pps_00.h" #include "hevc_test_inc/register_00.h" #include "hevc_test_inc/rps_00.h" #include "hevc_test_inc/scaling_list_00.h" #include "hevc_test_inc/stream_00.h" #include "hevc_test_inc/pps_01.h" #include "hevc_test_inc/register_01.h" #include "hevc_test_inc/rps_01.h" #include "hevc_test_inc/scaling_list_01.h" #include "hevc_test_inc/stream_01.h" #include "hevc_test_inc/cabac.h" extern struct ion_client *rockchip_ion_client_create(const char * name); static struct ion_client *ion_client = NULL; u8* get_align_ptr(u8* tbl, int len, u32 *phy) { int size = (len+15) & (~15); struct ion_handle *handle; u8 *ptr;// = (u8*)kzalloc(size, GFP_KERNEL); if (ion_client == NULL) { ion_client = rockchip_ion_client_create("vcodec"); } handle = ion_alloc(ion_client, (size_t)len, 16, ION_HEAP(ION_CMA_HEAP_ID), 0); ptr = ion_map_kernel(ion_client, handle); ion_phys(ion_client, handle, phy, &size); memcpy(ptr, tbl, len); return ptr; } u8* get_align_ptr_no_copy(int len, u32 *phy) { int size = (len+15) & (~15); struct ion_handle *handle; u8 *ptr;// = (u8*)kzalloc(size, GFP_KERNEL); if (ion_client == NULL) { ion_client = rockchip_ion_client_create("vcodec"); } handle = ion_alloc(ion_client, (size_t)len, 16, ION_HEAP(ION_CMA_HEAP_ID), 0); ptr = ion_map_kernel(ion_client, handle); ion_phys(ion_client, handle, phy, &size); return ptr; } #define TEST_CNT 2 static int hevc_test_case0(vpu_service_info *pservice) { vpu_session session; vpu_reg *reg; unsigned long size = 272;//sizeof(register_00); // registers array length int testidx = 0; int ret = 0; u8 *pps_tbl[TEST_CNT]; u8 *register_tbl[TEST_CNT]; u8 *rps_tbl[TEST_CNT]; u8 *scaling_list_tbl[TEST_CNT]; u8 *stream_tbl[TEST_CNT]; int stream_size[2]; int pps_size[2]; int rps_size[2]; int scl_size[2]; int cabac_size[2]; u32 phy_pps; u32 phy_rps; u32 phy_scl; u32 phy_str; u32 phy_yuv; u32 phy_ref; u32 phy_cabac; volatile u8 *stream_buf; volatile u8 *pps_buf; volatile u8 *rps_buf; volatile u8 *scl_buf; volatile u8 *yuv_buf; volatile u8 *cabac_buf; volatile u8 *ref_buf; u8 *pps; u8 *yuv[2]; int i; pps_tbl[0] = pps_00; pps_tbl[1] = pps_01; register_tbl[0] = register_00; register_tbl[1] = register_01; rps_tbl[0] = rps_00; rps_tbl[1] = rps_01; scaling_list_tbl[0] = scaling_list_00; scaling_list_tbl[1] = scaling_list_01; stream_tbl[0] = stream_00; stream_tbl[1] = stream_01; stream_size[0] = sizeof(stream_00); stream_size[1] = sizeof(stream_01); pps_size[0] = sizeof(pps_00); pps_size[1] = sizeof(pps_01); rps_size[0] = sizeof(rps_00); rps_size[1] = sizeof(rps_01); scl_size[0] = sizeof(scaling_list_00); scl_size[1] = sizeof(scaling_list_01); cabac_size[0] = sizeof(Cabac_table); cabac_size[1] = sizeof(Cabac_table); // create session session.pid = current->pid; session.type = VPU_DEC; INIT_LIST_HEAD(&session.waiting); INIT_LIST_HEAD(&session.running); INIT_LIST_HEAD(&session.done); INIT_LIST_HEAD(&session.list_session); init_waitqueue_head(&session.wait); atomic_set(&session.task_running, 0); list_add_tail(&session.list_session, &pservice->session); yuv[0] = get_align_ptr_no_copy(256*256*2, &phy_yuv); yuv[1] = get_align_ptr_no_copy(256*256*2, &phy_ref); while (testidx < TEST_CNT) { // create registers reg = kmalloc(sizeof(vpu_reg)+pservice->reg_size, GFP_KERNEL); if (NULL == reg) { pr_err("error: kmalloc fail in reg_init\n"); return -1; } if (size > pservice->reg_size) { printk("warning: vpu reg size %lu is larger than hw reg size %lu\n", size, pservice->reg_size); size = pservice->reg_size; } reg->session = &session; reg->type = session.type; reg->size = size; reg->freq = VPU_FREQ_DEFAULT; reg->reg = (unsigned long *)&reg[1]; INIT_LIST_HEAD(&reg->session_link); INIT_LIST_HEAD(&reg->status_link); // TODO: stuff registers memcpy(&reg->reg[0], register_tbl[testidx], /*sizeof(register_00)*/ 176); stream_buf = get_align_ptr(stream_tbl[testidx], stream_size[testidx], &phy_str); pps_buf = get_align_ptr(pps_tbl[0], pps_size[0], &phy_pps); rps_buf = get_align_ptr(rps_tbl[testidx], rps_size[testidx], &phy_rps); scl_buf = get_align_ptr(scaling_list_tbl[testidx], scl_size[testidx], &phy_scl); cabac_buf = get_align_ptr(Cabac_table, cabac_size[testidx], &phy_cabac); pps = pps_buf; // TODO: replace reigster address for (i=0; i<64; i++) { u32 scaling_offset; u32 tmp; scaling_offset = (u32)pps[i*80+74]; scaling_offset += (u32)pps[i*80+75] << 8; scaling_offset += (u32)pps[i*80+76] << 16; scaling_offset += (u32)pps[i*80+77] << 24; tmp = phy_scl + scaling_offset; pps[i*80+74] = tmp & 0xff; pps[i*80+75] = (tmp >> 8) & 0xff; pps[i*80+76] = (tmp >> 16) & 0xff; pps[i*80+77] = (tmp >> 24) & 0xff; } printk("%s %d, phy stream %08x, phy pps %08x, phy rps %08x\n", __func__, __LINE__, phy_str, phy_pps, phy_rps); reg->reg[1] = 0x21; reg->reg[4] = phy_str; reg->reg[5] = ((stream_size[testidx]+15)&(~15))+64; reg->reg[6] = phy_cabac; reg->reg[7] = testidx?phy_ref:phy_yuv; reg->reg[42] = phy_pps; reg->reg[43] = phy_rps; for (i = 10; i <= 24; i++) { reg->reg[i] = phy_yuv; } mutex_lock(&pservice->lock); list_add_tail(&reg->status_link, &pservice->waiting); list_add_tail(&reg->session_link, &session.waiting); mutex_unlock(&pservice->lock); printk("%s %d %p\n", __func__, __LINE__, pservice); // stuff hardware try_set_reg(pservice); // wait for result ret = wait_event_timeout(session.wait, !list_empty(&session.done), VPU_TIMEOUT_DELAY); if (!list_empty(&session.done)) { if (ret < 0) { pr_err("warning: pid %d wait task sucess but wait_evernt ret %d\n", session.pid, ret); } ret = 0; } else { if (unlikely(ret < 0)) { pr_err("error: pid %d wait task ret %d\n", session.pid, ret); } else if (0 == ret) { pr_err("error: pid %d wait %d task done timeout\n", session.pid, atomic_read(&session.task_running)); ret = -ETIMEDOUT; } } if (ret < 0) { int task_running = atomic_read(&session.task_running); int n; mutex_lock(&pservice->lock); vpu_service_dump(pservice); if (task_running) { atomic_set(&session.task_running, 0); atomic_sub(task_running, &pservice->total_running); printk("%d task is running but not return, reset hardware...", task_running); vpu_reset(pservice); printk("done\n"); } vpu_service_session_clear(pservice, &session); mutex_unlock(&pservice->lock); printk("\nDEC Registers:\n"); n = pservice->dec_dev.iosize >> 2; for (i=0; i<n; i++) { printk("\tswreg%d = %08X\n", i, readl(pservice->dec_dev.hwregs + i)); } pr_err("test index %d failed\n", testidx); break; } else { pr_info("test index %d success\n", testidx); vpu_reg *reg = list_entry(session.done.next, vpu_reg, session_link); for (i=0; i<68; i++) { if (i % 4 == 0) { printk("%02d: ", i); } printk("%08x ", reg->reg[i]); if ((i+1) % 4 == 0) { printk("\n"); } } testidx++; } reg_deinit(pservice, reg); } return 0; } #endif
Java
<?php /** * Order tracking form * * @author WooThemes * @package WooCommerce/Templates * @version 2.0.0 * * Edited by WebMan */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly global $woocommerce, $post; ?> <form action="<?php echo esc_url( get_permalink($post->ID) ); ?>" method="post" class="track_order"> <p><?php _e( 'To track your order please enter your Order ID in the box below and press return. This was given to you on your receipt and in the confirmation email you should have received.', 'woocommerce' ); ?></p> <div class="clear mt20"></div> <p class="form-row column col-12"><label for="orderid"><?php _e('Order ID', 'woocommerce'); ?></label> <input class="input-text" type="text" name="orderid" id="orderid" placeholder="<?php _e('Found in your order confirmation email.', 'woocommerce'); ?>" /></p> <p class="form-row column col-12 last"><label for="order_email"><?php _e('Billing Email', 'woocommerce'); ?></label> <input class="input-text" type="text" name="order_email" id="order_email" placeholder="<?php _e('Email you used during checkout.', 'woocommerce'); ?>" /></p> <div class="clear"></div> <p class="form-row"><input type="submit" class="button" name="track" value="<?php _e( 'Track', 'woocommerce' ); ?>" /></p> <?php $woocommerce->nonce_field('order_tracking') ?> </form>
Java
<?php // no direct access defined('_JEXEC') or die('Restricted access'); ?> <script language="javascript" type="text/javascript"> function tableOrdering( order, dir, task ) { var form = document.adminForm; form.filter_order.value = order; form.filter_order_Dir.value = dir; document.adminForm.submit( task ); } </script> <form action="<?php echo $this->action; ?>" method="post" name="adminForm"> <?php if ($this->params->get('filter') || $this->params->get('show_pagination_limit')) : ?> <?php if ($this->params->get('show_pagination_limit')) : ?> <div class="jsn-infofilter"> <?php if ($this->params->get('filter')) : ?> <span class="jsn-titlefilter"> <?php echo JText::_($this->params->get('filter_type') . ' Filter').'&nbsp;'; ?> <input type="text" name="filter" value="<?php echo $this->escape($this->lists['filter']);?>" class="inputbox" onchange="document.adminForm.submit();" /> </span> <?php endif; ?> <?php echo '&nbsp;&nbsp;&nbsp;'.JText::_('Display Num').'&nbsp;'; echo $this->pagination->getLimitBox(); ?> </div> <?php endif; ?> <?php endif; ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="jsn-infotable"> <?php if ($this->params->get('show_headings')) : ?> <tr class="jsn-tableheader"> <td class="sectiontableheader" align="right" width="5%"> <?php echo JText::_('Num'); ?> </td> <?php if ($this->params->get('show_title')) : ?> <td class="sectiontableheader" width="45%"> <?php echo JHTML::_('grid.sort', 'Item Title', 'a.title', $this->lists['order_Dir'], $this->lists['order'] ); ?> </td> <?php endif; ?> <?php if ($this->params->get('show_date')) : ?> <td class="sectiontableheader" width="25%"> <?php echo JHTML::_('grid.sort', 'Date', 'a.created', $this->lists['order_Dir'], $this->lists['order'] ); ?> </td> <?php endif; ?> <?php if ($this->params->get('show_author')) : ?> <td class="sectiontableheader" width="20%"> <?php echo JHTML::_('grid.sort', 'Author', 'author', $this->lists['order_Dir'], $this->lists['order'] ); ?> </td> <?php endif; ?> <?php if ($this->params->get('show_hits')) : ?> <td align="center" class="sectiontableheader" width="5%" nowrap="nowrap"> <?php echo JHTML::_('grid.sort', 'Hits', 'a.hits', $this->lists['order_Dir'], $this->lists['order'] ); ?> </td> <?php endif; ?> </tr> <?php endif; ?> <?php foreach ($this->items as $item) : ?> <tr class="sectiontableentry<?php echo ($item->odd +1 ) ." ". $this->params->get( 'pageclass_sfx' ); ?>" > <td align="right"> <?php echo $this->pagination->getRowOffset( $item->count ); ?> </td> <?php if ($this->params->get('show_title')) : ?> <?php if ($item->access <= $this->user->get('aid', 0)) : ?> <td> <a href="<?php echo $item->link; ?>"> <?php echo $item->title; ?></a> <?php $this->item = $item; echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?> </td> <?php else : ?> <td> <?php echo $this->escape($item->title).' : '; $link = JRoute::_('index.php?option=com_user&view=login'); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid), false); $fullURL = new JURI($link); $fullURL->setVar('return', base64_encode($returnURL)); $link = $fullURL->toString(); ?> <a href="<?php echo $link; ?>"> <?php echo JText::_( 'Register to read more...' ); ?></a> </td> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_date')) : ?> <td> <?php echo $item->created; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_author')) : ?> <td > <?php echo $item->created_by_alias ? $item->created_by_alias : $item->author; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_hits')) : ?> <td align="center"> <?php echo $item->hits ? $item->hits : '-'; ?> </td> <?php endif; ?> </tr> <?php endforeach; ?> </table> <?php if ($this->params->get('show_pagination', 2)) : ?> <div class="jsn-pagination"><?php echo $this->pagination->getPagesLinks(); ?></div> <?php endif; ?> <?php if ($this->params->get('show_pagination_results', 1)) : ?> <p class="jsn-pageinfo"><?php echo $this->pagination->getPagesCounter(); ?></p> <?php endif; ?> <input type="hidden" name="id" value="<?php echo $this->category->id; ?>" /> <input type="hidden" name="sectionid" value="<?php echo $this->category->sectionid; ?>" /> <input type="hidden" name="task" value="<?php echo $this->lists['task']; ?>" /> <input type="hidden" name="filter_order" value="" /> <input type="hidden" name="filter_order_Dir" value="" /> <input type="hidden" name="limitstart" value="0" /> </form>
Java
package kc.spark.pixels.android.ui.assets; import static org.solemnsilence.util.Py.map; import java.util.Map; import android.content.Context; import android.graphics.Typeface; public class Typefaces { // NOTE: this is tightly coupled to the filenames in assets/fonts public static enum Style { BOLD("Arial.ttf"), BOLD_ITALIC("Arial.ttf"), BOOK("Arial.ttf"), BOOK_ITALIC("Arial.ttf"), LIGHT("Arial.ttf"), LIGHT_ITALIC("Arial.ttf"), MEDIUM("Arial.ttf"), MEDIUM_ITALIC("Arial.ttf"); // BOLD("gotham_bold.otf"), // BOLD_ITALIC("gotham_bold_ita.otf"), // BOOK("gotham_book.otf"), // BOOK_ITALIC("gotham_book_ita.otf"), // LIGHT("gotham_light.otf"), // LIGHT_ITALIC("gotham_light_ita.otf"), // MEDIUM("gotham_medium.otf"), // MEDIUM_ITALIC("gotham_medium_ita.otf"); public final String fileName; private Style(String name) { fileName = name; } } private static final Map<Style, Typeface> typefaces = map(); public static Typeface getTypeface(Context ctx, Style style) { Typeface face = typefaces.get(style); if (face == null) { face = Typeface.createFromAsset(ctx.getAssets(), "fonts/" + style.fileName); typefaces.put(style, face); } return face; } }
Java
/* * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* @test @bug 4922813 @summary Check the new impl of encodePath will not cause regression @key randomness */ import java.util.BitSet; import java.io.File; import java.util.Random; import sun.net.www.ParseUtil; public class ParseUtil_4922813 { public static void main(String[] argv) throws Exception { int num = 400; while (num-- >= 0) { String source = getTestSource(); String ec = sun.net.www.ParseUtil.encodePath(source); String v117 = ParseUtil_V117.encodePath(source); if (!ec.equals(v117)) { throw new RuntimeException("Test Failed for : \n" + " source =<" + getUnicodeString(source) + ">"); } } } static int maxCharCount = 200; static int maxCodePoint = 0x10ffff; static Random random; static String getTestSource() { if (random == null) { long seed = System.currentTimeMillis(); random = new Random(seed); } String source = ""; int i = 0; int count = random.nextInt(maxCharCount) + 1; while (i < count) { int codepoint = random.nextInt(127); source = source + String.valueOf((char)codepoint); codepoint = random.nextInt(0x7ff); source = source + String.valueOf((char)codepoint); codepoint = random.nextInt(maxCodePoint); source = source + new String(Character.toChars(codepoint)); i += 3; } return source; } static String getUnicodeString(String s){ String unicodeString = ""; for(int j=0; j< s.length(); j++){ unicodeString += "0x"+ Integer.toString(s.charAt(j), 16); } return unicodeString; } } class ParseUtil_V117 { static BitSet encodedInPath; static { encodedInPath = new BitSet(256); // Set the bits corresponding to characters that are encoded in the // path component of a URI. // These characters are reserved in the path segment as described in // RFC2396 section 3.3. encodedInPath.set('='); encodedInPath.set(';'); encodedInPath.set('?'); encodedInPath.set('/'); // These characters are defined as excluded in RFC2396 section 2.4.3 // and must be escaped if they occur in the data part of a URI. encodedInPath.set('#'); encodedInPath.set(' '); encodedInPath.set('<'); encodedInPath.set('>'); encodedInPath.set('%'); encodedInPath.set('"'); encodedInPath.set('{'); encodedInPath.set('}'); encodedInPath.set('|'); encodedInPath.set('\\'); encodedInPath.set('^'); encodedInPath.set('['); encodedInPath.set(']'); encodedInPath.set('`'); // US ASCII control characters 00-1F and 7F. for (int i=0; i<32; i++) encodedInPath.set(i); encodedInPath.set(127); } /** * Constructs an encoded version of the specified path string suitable * for use in the construction of a URL. * * A path separator is replaced by a forward slash. The string is UTF8 * encoded. The % escape sequence is used for characters that are above * 0x7F or those defined in RFC2396 as reserved or excluded in the path * component of a URL. */ public static String encodePath(String path) { StringBuffer sb = new StringBuffer(); int n = path.length(); for (int i=0; i<n; i++) { char c = path.charAt(i); if (c == File.separatorChar) sb.append('/'); else { if (c <= 0x007F) { if (encodedInPath.get(c)) escape(sb, c); else sb.append(c); } else if (c > 0x07FF) { escape(sb, (char)(0xE0 | ((c >> 12) & 0x0F))); escape(sb, (char)(0x80 | ((c >> 6) & 0x3F))); escape(sb, (char)(0x80 | ((c >> 0) & 0x3F))); } else { escape(sb, (char)(0xC0 | ((c >> 6) & 0x1F))); escape(sb, (char)(0x80 | ((c >> 0) & 0x3F))); } } } return sb.toString(); } /** * Appends the URL escape sequence for the specified char to the * specified StringBuffer. */ private static void escape(StringBuffer s, char c) { s.append('%'); s.append(Character.forDigit((c >> 4) & 0xF, 16)); s.append(Character.forDigit(c & 0xF, 16)); } }
Java
#ifndef __ASM_MAPLE_H #define __ASM_MAPLE_H #define MAPLE_PORTS 4 #define MAPLE_PNP_INTERVAL HZ #define MAPLE_MAXPACKETS 8 #define MAPLE_DMA_ORDER 14 #define MAPLE_DMA_SIZE (1 << MAPLE_DMA_ORDER) #define MAPLE_DMA_PAGES ((MAPLE_DMA_ORDER > PAGE_SHIFT) ? \ MAPLE_DMA_ORDER - PAGE_SHIFT : 0) /* Maple Bus registers */ #define MAPLE_BASE 0xa05f6c00 #define MAPLE_DMAADDR (MAPLE_BASE+0x04) #define MAPLE_TRIGTYPE (MAPLE_BASE+0x10) #define MAPLE_ENABLE (MAPLE_BASE+0x14) #define MAPLE_STATE (MAPLE_BASE+0x18) #define MAPLE_SPEED (MAPLE_BASE+0x80) #define MAPLE_RESET (MAPLE_BASE+0x8c) #define MAPLE_MAGIC 0x6155404f #define MAPLE_2MBPS 0 #define MAPLE_TIMEOUT(n) ((n)<<15) /* Function codes */ #define MAPLE_FUNC_CONTROLLER 0x001 #define MAPLE_FUNC_MEMCARD 0x002 #define MAPLE_FUNC_LCD 0x004 #define MAPLE_FUNC_CLOCK 0x008 #define MAPLE_FUNC_MICROPHONE 0x010 #define MAPLE_FUNC_ARGUN 0x020 #define MAPLE_FUNC_KEYBOARD 0x040 #define MAPLE_FUNC_LIGHTGUN 0x080 #define MAPLE_FUNC_PURUPURU 0x100 #define MAPLE_FUNC_MOUSE 0x200 #endif /* __ASM_MAPLE_H */
Java
import random from collections import namedtuple import dateparser import pytest from cfme import test_requirements from cfme.containers.image import Image from cfme.containers.provider import ContainersProvider from cfme.containers.provider import ContainersTestItem from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.wait import wait_for pytestmark = [ pytest.mark.meta(server_roles='+smartproxy'), pytest.mark.usefixtures('setup_provider'), pytest.mark.tier(1), pytest.mark.provider([ContainersProvider], scope='function'), test_requirements.containers ] AttributeToVerify = namedtuple('AttributeToVerify', ['table', 'attr', 'verifier']) TESTED_ATTRIBUTES__openscap_off = ( AttributeToVerify('configuration', 'OpenSCAP Results', bool), AttributeToVerify('configuration', 'OpenSCAP HTML', lambda val: val == 'Available'), AttributeToVerify('configuration', 'Last scan', dateparser.parse) ) TESTED_ATTRIBUTES__openscap_on = TESTED_ATTRIBUTES__openscap_off + ( AttributeToVerify('compliance', 'Status', lambda val: val.lower() != 'never verified'), AttributeToVerify('compliance', 'History', lambda val: val == 'Available') ) TEST_ITEMS = ( ContainersTestItem(Image, 'openscap_off', is_openscap=False, tested_attr=TESTED_ATTRIBUTES__openscap_off), ContainersTestItem(Image, 'openscap_on', is_openscap=True, tested_attr=TESTED_ATTRIBUTES__openscap_on) ) NUM_SELECTED_IMAGES = 1 @pytest.fixture(scope='function') def delete_all_container_tasks(appliance): col = appliance.collections.tasks.filter({'tab': 'AllTasks'}) col.delete_all() @pytest.fixture(scope='function') def random_image_instance(appliance): collection = appliance.collections.container_images # add filter for select only active(not archived) images from redHat registry filter_image_collection = collection.filter({'active': True, 'redhat_registry': True}) return random.sample(filter_image_collection.all(), NUM_SELECTED_IMAGES).pop() @pytest.mark.polarion('10030') def test_manage_policies_navigation(random_image_instance): """ Polarion: assignee: juwatts caseimportance: high casecomponent: Containers initialEstimate: 1/6h """ random_image_instance.assign_policy_profiles('OpenSCAP profile') @pytest.mark.polarion('10031') def test_check_compliance(random_image_instance): """ Polarion: assignee: juwatts caseimportance: high casecomponent: Containers initialEstimate: 1/6h """ random_image_instance.assign_policy_profiles('OpenSCAP profile') random_image_instance.check_compliance() def get_table_attr(instance, table_name, attr): # Trying to read the table <table_name> attribute <attr> view = navigate_to(instance, 'Details', force=True) table = getattr(view.entities, table_name, None) if table: return table.read().get(attr) @pytest.mark.parametrize(('test_item'), TEST_ITEMS) def test_containers_smartstate_analysis(provider, test_item, soft_assert, delete_all_container_tasks, random_image_instance): """ Polarion: assignee: juwatts caseimportance: high casecomponent: Containers initialEstimate: 1/6h """ if test_item.is_openscap: random_image_instance.assign_policy_profiles('OpenSCAP profile') else: random_image_instance.unassign_policy_profiles('OpenSCAP profile') random_image_instance.perform_smartstate_analysis(wait_for_finish=True) view = navigate_to(random_image_instance, 'Details') for tbl, attr, verifier in test_item.tested_attr: table = getattr(view.entities, tbl) table_data = {k.lower(): v for k, v in table.read().items()} if not soft_assert(attr.lower() in table_data, f'{tbl} table has missing attribute \'{attr}\''): continue provider.refresh_provider_relationships() wait_for_retval = wait_for(lambda: get_table_attr(random_image_instance, tbl, attr), message='Trying to get attribute "{}" of table "{}"'.format( attr, tbl), delay=5, num_sec=120, silent_failure=True) if not wait_for_retval: soft_assert(False, 'Could not get attribute "{}" for "{}" table.' .format(attr, tbl)) continue value = wait_for_retval.out soft_assert(verifier(value), f'{tbl}.{attr} attribute has unexpected value ({value})') @pytest.mark.parametrize(('test_item'), TEST_ITEMS) def test_containers_smartstate_analysis_api(provider, test_item, soft_assert, delete_all_container_tasks, random_image_instance): """ Test initiating a SmartState Analysis scan via the CFME API through the ManageIQ API Client entity class. RFE: BZ 1486362 Polarion: assignee: juwatts caseimportance: high casecomponent: Containers initialEstimate: 1/6h """ if test_item.is_openscap: random_image_instance.assign_policy_profiles('OpenSCAP profile') else: random_image_instance.unassign_policy_profiles('OpenSCAP profile') original_scan = random_image_instance.last_scan_attempt_on random_image_instance.scan() task = provider.appliance.collections.tasks.instantiate( name=f"Container Image Analysis: '{random_image_instance.name}'", tab='AllTasks') task.wait_for_finished() soft_assert(original_scan != random_image_instance.last_scan_attempt_on, 'SmartState Anaysis scan has failed')
Java
/* * jMemorize - Learning made easy (and fun) - A Leitner flashcards tool * Copyright(C) 2004-2006 Riad Djemili * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package jmemorize.core.test; import java.io.File; import java.io.IOException; import java.util.List; import jmemorize.core.Card; import jmemorize.core.Lesson; import jmemorize.core.LessonObserver; import jmemorize.core.LessonProvider; import jmemorize.core.Main; import junit.framework.TestCase; public class LessonProviderTest extends TestCase implements LessonObserver { private LessonProvider m_lessonProvider; private StringBuffer m_log; protected void setUp() throws Exception { m_lessonProvider = new Main(); m_lessonProvider.addLessonObserver(this); m_log = new StringBuffer(); } public void testLessonNewEvent() { m_lessonProvider.createNewLesson(); assertEquals("loaded ", m_log.toString()); } public void testLessonLoadedEvent() throws IOException { m_lessonProvider.loadLesson(new File("test/fixtures/simple_de.jml")); assertEquals("loaded ", m_log.toString()); } public void testLessonLoadedCardsAlwaysHaveExpiration() throws IOException { m_lessonProvider.loadLesson(new File("test/fixtures/no_expiration.jml")); Lesson lesson = m_lessonProvider.getLesson(); List<Card> cards = lesson.getRootCategory().getCards(); for (Card card : cards) { if (card.getLevel() > 0) assertNotNull(card.getDateExpired()); else assertNull(card.getDateExpired()); } } public void testLessonLoadedClosedNewEvents() throws IOException { m_lessonProvider.loadLesson(new File("test/fixtures/simple_de.jml")); m_lessonProvider.createNewLesson(); assertEquals("loaded closed loaded ", m_log.toString()); // TODO also check lesson param } public void testLessonLoadedClosedLoadEvents() throws IOException { m_lessonProvider.loadLesson(new File("test/fixtures/simple_de.jml")); m_lessonProvider.loadLesson(new File("test/fixtures/test.jml")); assertEquals("loaded closed loaded ", m_log.toString()); // TODO also check lesson param } public void testLessonSavedEvent() throws Exception { m_lessonProvider.loadLesson( new File("test/fixtures/simple_de.jml")); Lesson lesson = m_lessonProvider.getLesson(); m_lessonProvider.saveLesson(lesson, new File("./test.jml")); assertEquals("loaded saved ", m_log.toString()); } public void testLessonModifiedEvent() throws Exception { m_lessonProvider.loadLesson( new File("test/fixtures/simple_de.jml")); Lesson lesson = m_lessonProvider.getLesson(); lesson.getRootCategory().addCard(new Card("front", "flip")); assertEquals("loaded modified ", m_log.toString()); } /* (non-Javadoc) * @see jmemorize.core.LessonObserver */ public void lessonLoaded(Lesson lesson) { m_log.append("loaded "); } /* (non-Javadoc) * @see jmemorize.core.LessonObserver */ public void lessonModified(Lesson lesson) { m_log.append("modified "); } /* (non-Javadoc) * @see jmemorize.core.LessonObserver */ public void lessonSaved(Lesson lesson) { m_log.append("saved "); } /* (non-Javadoc) * @see jmemorize.core.LessonObserver */ public void lessonClosed(Lesson lesson) { m_log.append("closed "); } }
Java
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. currentmodule:: __init__.py .. moduleauthor:: Pat Daburu <pat@daburu.net> Provide a brief description of the module. """
Java
/* * ************************************************************************************* * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * * ************************************************************************************* */ package com.espertech.esper.multithread; import junit.framework.TestCase; import com.espertech.esper.client.EPServiceProvider; import com.espertech.esper.client.EPServiceProviderManager; import com.espertech.esper.client.EPStatement; import com.espertech.esper.client.Configuration; import com.espertech.esper.support.bean.SupportTradeEvent; import com.espertech.esper.multithread.TwoPatternRunnable; /** * Test for multithread-safety for case of 2 patterns: * 1. Thread 1 starts pattern "every event1=SupportEvent(userID in ('100','101'), amount>=1000)" * 2. Thread 1 repeats sending 100 events and tests 5% received * 3. Main thread starts pattern: * ( every event1=SupportEvent(userID in ('100','101')) -> (SupportEvent(userID in ('100','101'), direction = event1.direction ) -> SupportEvent(userID in ('100','101'), direction = event1.direction ) ) where timer:within(8 hours) and not eventNC=SupportEvent(userID in ('100','101'), direction!= event1.direction ) ) -> eventFinal=SupportEvent(userID in ('100','101'), direction != event1.direction ) where timer:within(1 hour) * 4. Main thread waits for 2 seconds and stops all threads */ public class TestMTStmtTwoPatternsStartStop extends TestCase { private EPServiceProvider engine; public void setUp() { Configuration config = new Configuration(); config.addEventType("SupportEvent", SupportTradeEvent.class); engine = EPServiceProviderManager.getDefaultProvider(config); engine.initialize(); } public void tearDown() { engine.initialize(); } public void test2Patterns() throws Exception { String statementTwo = "( every event1=SupportEvent(userId in ('100','101')) ->\n" + " (SupportEvent(userId in ('100','101'), direction = event1.direction ) ->\n" + " SupportEvent(userId in ('100','101'), direction = event1.direction )\n" + " ) where timer:within(8 hours)\n" + " and not eventNC=SupportEvent(userId in ('100','101'), direction!= event1.direction )\n" + " ) -> eventFinal=SupportEvent(userId in ('100','101'), direction != event1.direction ) where timer:within(1 hour)"; TwoPatternRunnable runnable = new TwoPatternRunnable(engine); Thread t = new Thread(runnable); t.start(); Thread.sleep(200); // Create a second pattern, wait 200 msec, destroy second pattern in a loop for (int i = 0; i < 10; i++) { EPStatement statement = engine.getEPAdministrator().createPattern(statementTwo); Thread.sleep(200); statement.destroy(); } runnable.setShutdown(true); Thread.sleep(1000); assertFalse(t.isAlive()); } }
Java
/*****************************************************************************\ * $Id: genders_test_functionality.h,v 1.7 2010-02-02 00:04:34 chu11 Exp $ ***************************************************************************** * Copyright (C) 2007-2019 Lawrence Livermore National Security, LLC. * Copyright (C) 2001-2007 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick <garlick@llnl.gov> and Albert Chu <chu11@llnl.gov>. * UCRL-CODE-2003-004. * * This file is part of Genders, a cluster configuration database. * For details, see <http://www.llnl.gov/linux/genders/>. * * Genders is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * Genders is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along * with Genders. If not, see <http://www.gnu.org/licenses/>. \*****************************************************************************/ #ifndef _GENDERS_TEST_FUNCTIONALITY_H #define _GENDERS_TEST_FUNCTIONALITY_H 1 #include "genders.h" #include "genders_testlib.h" typedef int (*GendersFunctionalityFunc)(int); int genders_handle_create_functionality(int verbose); int genders_handle_destroy_functionality(int verbose); int genders_load_data_functionality(int verbose); int genders_errnum_functionality(int verbose); int genders_strerror_functionality(int verbose); int genders_errormsg_functionality(int verbose); int genders_perror_functionality(int verbose); int genders_get_flags_functionality(int verbose); int genders_set_flags_functionality(int verbose); int genders_getnumnodes_functionality(int verbose); int genders_getnumattrs_functionality(int verbose); int genders_getmaxattrs_functionality(int verbose); int genders_getmaxnodelen_functionality(int verbose); int genders_getmaxattrlen_functionality(int verbose); int genders_getmaxvallen_functionality(int verbose); int genders_nodelist_create_functionality(int verbose); int genders_nodelist_clear_functionality(int verbose); int genders_nodelist_destroy_functionality(int verbose); int genders_attrlist_create_functionality(int verbose); int genders_attrlist_clear_functionality(int verbose); int genders_attrlist_destroy_functionality(int verbose); int genders_vallist_create_functionality(int verbose); int genders_vallist_clear_functionality(int verbose); int genders_vallist_destroy_functionality(int verbose); int genders_getnodename_functionality(int verbose); int genders_getnodes_functionality(int verbose); int genders_getattr_functionality(int verbose); int genders_getattr_all_functionality(int verbose); int genders_testattr_functionality(int verbose); int genders_testattrval_functionality(int verbose); int genders_isnode_functionality(int verbose); int genders_isattr_functionality(int verbose); int genders_isattrval_functionality(int verbose); int genders_index_attrvals_functionality(int verbose); int genders_query_functionality(int verbose); int genders_testquery_functionality(int verbose); int genders_parse_functionality(int verbose); int genders_set_errnum_functionality(int verbose); int genders_copy_functionality(int verbose); #endif /* _GENDERS_TEST_FUNCTIONALITY_H */
Java
VFS.Include("LuaRules/Utilities/numberfunctions.lua") -- math.triangulate local GRP = Spring.GetGameRulesParam local function GetRawBoxes() local ret = {} local boxCount = GRP("startbox_max_n") if not boxCount then return ret end for boxID = 0, boxCount do local polies = {} local polyCount = GRP("startbox_n_" .. boxID) if polyCount then for polyID = 1, polyCount do local poly = {} local vertexCount = GRP("startbox_polygon_" .. boxID .. "_" .. polyID) for vertexID = 1, vertexCount do local vertex = {} vertex[1] = GRP("startbox_polygon_x_" .. boxID .. "_" .. polyID .. "_" .. vertexID) vertex[2] = GRP("startbox_polygon_z_" .. boxID .. "_" .. polyID .. "_" .. vertexID) poly[vertexID] = vertex end polies[polyID] = poly end end local startpoints = {} local posCount = GRP("startpos_n_" .. boxID) if posCount then startpoints = {} for posID = 1, posCount do local pos = {} pos[1] = GRP("startpos_x_" .. boxID .. "_" .. posID) pos[2] = GRP("startpos_z_" .. boxID .. "_" .. posID) startpoints[posID] = pos end end if posCount or polyCount then ret[boxID] = { boxes = polies, startpoints = startpoints } end end return ret end local function GetTriangulatedBoxes() local boxes = GetRawBoxes() for boxID, box in pairs(boxes) do box.boxes = math.triangulate(box.boxes) end return boxes end return GetRawBoxes, GetTriangulatedBoxes
Java
<?php /** * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; under version 2 * of the License (non-upgradable). * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Copyright (c) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); * * @author Jérôme Bogaerts, <jerome@taotesting.com> * @license GPLv2 * @package */ namespace qtism\data\storage\xml\marshalling; use qtism\data\content\ModalFeedbackCollection; use qtism\data\content\StylesheetCollection; use qtism\data\state\OutcomeDeclarationCollection; use qtism\data\state\ResponseDeclarationCollection; use qtism\data\state\TemplateDeclarationCollection; use qtism\data\QtiComponent; use qtism\data\AssessmentItem; use \DOMElement; /** * Marshalling/Unmarshalling implementation for AssessmentItem. * * @author Jérôme Bogaerts <jerome@taotesting.com> * */ class AssessmentItemMarshaller extends Marshaller { /** * Marshall an AssessmentItem object into a DOMElement object. * * @param QtiComponent $component An AssessmentItem object. * @return DOMElement The according DOMElement object. */ protected function marshall(QtiComponent $component) { $element = static::getDOMCradle()->createElement($component->getQtiClassName()); self::setDOMElementAttribute($element, 'identifier', $component->getIdentifier()); self::setDOMElementAttribute($element, 'title', $component->getTitle()); self::setDOMElementAttribute($element, 'timeDependent', $component->isTimeDependent()); self::setDOMElementAttribute($element, 'adaptive', $component->isAdaptive()); if ($component->hasLang() === true) { self::setDOMElementAttribute($element, 'lang', $component->getLang()); } if ($component->hasLabel() === true) { self::setDOMElementAttribute($element, 'label', $component->getLabel()); } if ($component->hasToolName() === true) { self::setDOMElementAttribute($element, 'toolName', $component->getToolName()); } if ($component->hasToolVersion() === true) { self::setDOMElementAttribute($element, 'toolVersion', $component->getToolVersion()); } foreach ($component->getResponseDeclarations() as $responseDeclaration) { $marshaller = $this->getMarshallerFactory()->createMarshaller($responseDeclaration); $element->appendChild($marshaller->marshall($responseDeclaration)); } foreach ($component->getOutcomeDeclarations() as $outcomeDeclaration) { $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeDeclaration); $element->appendChild($marshaller->marshall($outcomeDeclaration)); } foreach ($component->getTemplateDeclarations() as $templateDeclaration) { $marshaller = $this->getMarshallerFactory()->createMarshaller($templateDeclaration); $element->appendChild($marshaller->marshall($templateDeclaration)); } if ($component->hasTemplateProcessing() === true) { $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getTemplateProcessing()); $element->appendChild($marshaller->marshall($component->getTemplateProcessing())); } foreach ($component->getStylesheets() as $stylesheet) { $marshaller = $this->getMarshallerFactory()->createMarshaller($stylesheet); $element->appendChild($marshaller->marshall($stylesheet)); } if ($component->hasItemBody() === true) { $itemBody = $component->getItemBody(); $marshaller = $this->getMarshallerFactory()->createMarshaller($itemBody); $element->appendChild($marshaller->marshall($itemBody)); } if ($component->hasResponseProcessing() === true) { $marshaller = $this->getMarshallerFactory()->createMarshaller($component->getResponseProcessing()); $element->appendChild($marshaller->marshall($component->getResponseProcessing())); } foreach ($component->getModalFeedbacks() as $modalFeedback) { $marshaller = $this->getMarshallerFactory()->createMarshaller($modalFeedback); $element->appendChild($marshaller->marshall($modalFeedback)); } return $element; } /** * Unmarshall a DOMElement object corresponding to a QTI assessmentItem element. * * If $assessmentItem is provided, it will be used as the unmarshalled component instead of creating * a new one. * * @param DOMElement $element A DOMElement object. * @param AssessmentItem $assessmentItem An optional AssessmentItem object to be decorated. * @return QtiComponent An AssessmentItem object. * @throws UnmarshallingException */ protected function unmarshall(DOMElement $element, AssessmentItem $assessmentItem = null) { if (($identifier = static::getDOMElementAttributeAs($element, 'identifier')) !== null) { if (($timeDependent = static::getDOMElementAttributeAs($element, 'timeDependent', 'boolean')) !== null) { if (($title= static::getDOMElementAttributeAs($element, 'title')) !== null) { if (empty($assessmentItem)) { $object = new AssessmentItem($identifier, $title, $timeDependent); } else { $object = $assessmentItem; $object->setIdentifier($identifier); $object->setTimeDependent($timeDependent); } if (($lang = static::getDOMElementAttributeAs($element, 'lang')) !== null) { $object->setLang($lang); } if (($label = static::getDOMElementAttributeAs($element, 'label')) !== null) { $object->setLabel($label); } if (($adaptive = static::getDOMElementAttributeAs($element, 'adaptive', 'boolean')) !== null) { $object->setAdaptive($adaptive); } if (($toolName = static::getDOMElementAttributeAs($element, 'toolName')) !== null) { $object->setToolName($toolName); } if (($toolVersion = static::getDOMElementAttributeAs($element, 'toolVersion')) !== null) { $object->setToolVersion($toolVersion); } $responseDeclarationElts = static::getChildElementsByTagName($element, 'responseDeclaration'); if (!empty($responseDeclarationElts)) { $responseDeclarations = new ResponseDeclarationCollection(); foreach ($responseDeclarationElts as $responseDeclarationElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($responseDeclarationElt); $responseDeclarations[] = $marshaller->unmarshall($responseDeclarationElt); } $object->setResponseDeclarations($responseDeclarations); } $outcomeDeclarationElts = static::getChildElementsByTagName($element, 'outcomeDeclaration'); if (!empty($outcomeDeclarationElts)) { $outcomeDeclarations = new OutcomeDeclarationCollection(); foreach ($outcomeDeclarationElts as $outcomeDeclarationElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($outcomeDeclarationElt); $outcomeDeclarations[] = $marshaller->unmarshall($outcomeDeclarationElt); } $object->setOutcomeDeclarations($outcomeDeclarations); } $templateDeclarationElts = static::getChildElementsByTagName($element, 'templateDeclaration'); if (!empty($templateDeclarationElts)) { $templateDeclarations = new TemplateDeclarationCollection(); foreach ($templateDeclarationElts as $templateDeclarationElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($templateDeclarationElt); $templateDeclarations[] = $marshaller->unmarshall($templateDeclarationElt); } $object->setTemplateDeclarations($templateDeclarations); } $templateProcessingElts = static::getChildElementsByTagName($element, 'templateProcessing'); if (!empty($templateProcessingElts)) { $marshaller = $this->getMarshallerFactory()->createMarshaller($templateProcessingElts[0]); $object->setTemplateProcessing($marshaller->unmarshall($templateProcessingElts[0])); } $stylesheetElts = static::getChildElementsByTagName($element, 'stylesheet'); if (!empty($stylesheetElts)) { $stylesheets = new StylesheetCollection(); foreach ($stylesheetElts as $stylesheetElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($stylesheetElt); $stylesheets[] = $marshaller->unmarshall($stylesheetElt); } $object->setStylesheets($stylesheets); } $itemBodyElts = static::getChildElementsByTagName($element, 'itemBody'); if (count($itemBodyElts) > 0) { $marshaller = $this->getMarshallerFactory()->createMarshaller($itemBodyElts[0]); $object->setItemBody($marshaller->unmarshall($itemBodyElts[0])); } $responseProcessingElts = static::getChildElementsByTagName($element, 'responseProcessing'); if (!empty($responseProcessingElts)) { $marshaller = $this->getMarshallerFactory()->createMarshaller($responseProcessingElts[0]); $object->setResponseProcessing($marshaller->unmarshall($responseProcessingElts[0])); } $modalFeedbackElts = static::getChildElementsByTagName($element, 'modalFeedback'); if (!empty($modalFeedbackElts)) { $modalFeedbacks = new ModalFeedbackCollection(); foreach ($modalFeedbackElts as $modalFeedbackElt) { $marshaller = $this->getMarshallerFactory()->createMarshaller($modalFeedbackElt); $modalFeedbacks[] = $marshaller->unmarshall($modalFeedbackElt); } $object->setModalFeedbacks($modalFeedbacks); } return $object; } else { $msg = "The mandatory attribute 'title' is missing from element '" . $element->localName . "'."; throw new UnmarshallingException($msg, $element); } } else { $msg = "The mandatory attribute 'timeDependent' is missing from element '" . $element->localName . "'."; throw new UnmarshallingException($msg, $element); } } else { $msg = "The mandatory attribute 'identifier' is missing from element '" . $element->localName . "'."; throw new UnmarshallingException($msg, $element); } } public function getExpectedQtiClassName() { return 'assessmentItem'; } }
Java
<?php /* * @package Joomla.Framework * @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * @component Phoca Component * @copyright Copyright (C) Jan Pavelka www.phoca.cz * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; */ defined('_JEXEC') or die(); jimport('joomla.application.component.modellist'); class PhocaGalleryCpModelPhocaGalleryRa extends JModelList { protected $option = 'com_phocagallery'; public function __construct($config = array()) { if (empty($config['filter_fields'])) { $config['filter_fields'] = array( 'id', 'a.id', 'title', 'a.title', 'username','ua.username', 'date', 'a.date', 'alias', 'a.alias', 'checked_out', 'a.checked_out', 'checked_out_time', 'a.checked_out_time', 'category_id', 'category_id', 'state', 'a.state', 'ordering', 'a.ordering', 'language', 'a.language', 'hits', 'a.hits', 'published','a.published', 'rating', 'a.rating', 'category_title', 'category_title' ); } parent::__construct($config); } protected function populateState($ordering = null, $direction = null) { // Initialise variables. $app = JFactory::getApplication('administrator'); // Load the filter state. $search = $app->getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); $this->setState('filter.search', $search); /* $accessId = $app->getUserStateFromRequest($this->context.'.filter.access', 'filter_access', null, 'int'); $this->setState('filter.access', $accessId); $state = $app->getUserStateFromRequest($this->context.'.filter.state', 'filter_published', '', 'string'); $this->setState('filter.state', $state); */ $categoryId = $app->getUserStateFromRequest($this->context.'.filter.category_id', 'filter_category_id', null); $this->setState('filter.category_id', $categoryId); /* $language = $app->getUserStateFromRequest($this->context.'.filter.language', 'filter_language', ''); $this->setState('filter.language', $language); */ // Load the parameters. $params = JComponentHelper::getParams('com_phocagallery'); $this->setState('params', $params); // List state information. parent::populateState('ua.username', 'asc'); } protected function getStoreId($id = '') { // Compile the store id. $id .= ':'.$this->getState('filter.search'); //$id .= ':'.$this->getState('filter.access'); //$id .= ':'.$this->getState('filter.state'); $id .= ':'.$this->getState('filter.category_id'); return parent::getStoreId($id); } protected function getListQuery() { /* $query = ' SELECT a.*, cc.title AS category, ua.name AS editor, u.id AS ratinguserid, u.username AS ratingusername ' . ' FROM #__phocagallery_votes AS a ' . ' LEFT JOIN #__phocagallery_categories AS cc ON cc.id = a.catid ' . ' LEFT JOIN #__users AS ua ON ua.id = a.checked_out ' . ' LEFT JOIN #__users AS u ON u.id = a.userid' . $where . ' GROUP by a.id' . $orderby ; */ // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.*' ) ); $query->from('`#__phocagallery_votes` AS a'); // Join over the language $query->select('l.title AS language_title'); $query->join('LEFT', '`#__languages` AS l ON l.lang_code = a.language'); // Join over the users for the checked out user. $query->select('ua.id AS ratinguserid, ua.username AS ratingusername, ua.name AS ratingname'); $query->join('LEFT', '#__users AS ua ON ua.id=a.userid'); $query->select('uc.name AS editor'); $query->join('LEFT', '#__users AS uc ON uc.id=a.checked_out'); /* // Join over the asset groups. $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); */ // Join over the categories. $query->select('c.title AS category_title, c.id AS category_id'); $query->join('LEFT', '#__phocagallery_categories AS c ON c.id = a.catid'); // Filter by access level. /* if ($access = $this->getState('filter.access')) { $query->where('a.access = '.(int) $access); }*/ // Filter by published state. $published = $this->getState('filter.state'); if (is_numeric($published)) { $query->where('a.published = '.(int) $published); } else if ($published === '') { $query->where('(a.published IN (0, 1))'); } // Filter by category. $categoryId = $this->getState('filter.category_id'); if (is_numeric($categoryId)) { $query->where('a.catid = ' . (int) $categoryId); } // Filter by search in title $search = $this->getState('filter.search'); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('( ua.name LIKE '.$search.' OR ua.username LIKE '.$search.')'); } } //$query->group('a.id'); // Add the list ordering clause. $orderCol = $this->state->get('list.ordering'); $orderDirn = $this->state->get('list.direction'); if ($orderCol == 'a.ordering' || $orderCol == 'category_title') { $orderCol = 'category_title '.$orderDirn.', a.ordering'; } $query->order($db->escape($orderCol.' '.$orderDirn)); //echo nl2br(str_replace('#__','jos_',$query)); return $query; } function delete($cid = array()) { if (count( $cid )) { \Joomla\Utilities\ArrayHelper::toInteger($cid); $cids = implode( ',', $cid ); //Select affected catids $query = 'SELECT v.catid AS catid' . ' FROM #__phocagallery_votes AS v' . ' WHERE v.id IN ( '.$cids.' )'; $catids = $this->_getList($query); //Delete it from DB $query = 'DELETE FROM #__phocagallery_votes' . ' WHERE id IN ( '.$cids.' )'; $this->_db->setQuery( $query ); if(!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } phocagalleryimport('phocagallery.rate.ratecategory'); foreach ($catids as $valueCatid) { $updated = PhocaGalleryRateCategory::updateVoteStatistics( $valueCatid->catid ); if(!$updated) { return false; } } } return true; } protected function prepareTable($table) { jimport('joomla.filter.output'); $date = JFactory::getDate(); $user = JFactory::getUser(); $table->title = htmlspecialchars_decode($table->title, ENT_QUOTES); $table->alias = \JApplicationHelper::stringURLSafe($table->alias); if (empty($table->alias)) { $table->alias = \JApplicationHelper::stringURLSafe($table->title); } if (empty($table->id)) { // Set the values //$table->created = $date->toSql(); // Set ordering to the last item if not set if (empty($table->ordering)) { $db = JFactory::getDbo(); $db->setQuery('SELECT MAX(ordering) FROM #__phocagallery_votes WHERE catid = '.(int) $table->catid); $max = $db->loadResult(); $table->ordering = $max+1; } } else { // Set the values //$table->modified = $date->toSql(); //$table->modified_by = $user->get('id'); } } } ?>
Java
/************************************************************************** Copyright (C) 2000 - 2010 Novell, Inc. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. **************************************************************************/ /*---------------------------------------------------------------------\ | | | __ __ ____ _____ ____ | | \ \ / /_ _/ ___|_ _|___ \ | | \ V / _` \___ \ | | __) | | | | | (_| |___) || | / __/ | | |_|\__,_|____/ |_| |_____| | | | | core system | | (c) SuSE Linux AG | \----------------------------------------------------------------------/ File: YQZyppSolverDialogPluginStub.cc Authors: Stefan Schubert <schubi@suse.de> Textdomain "qt-pkg" /-*/ #include <qmessagebox.h> #include "YQZyppSolverDialogPluginStub.h" #define YUILogComponent "qt-ui" #include "YUILog.h" #include "YQi18n.h" #define PLUGIN_BASE_NAME "qt_zypp_solver_dialog" using std::endl; YQZyppSolverDialogPluginStub::YQZyppSolverDialogPluginStub() : YUIPlugin( PLUGIN_BASE_NAME ) { if ( success() ) { yuiMilestone() << "Loaded " << PLUGIN_BASE_NAME << " plugin successfully from " << pluginLibFullPath() << endl; } impl = (YQZyppSolverDialogPluginIf*) locateSymbol("ZYPPDIALOGP"); if ( ! impl ) { yuiError() << "Plugin " << PLUGIN_BASE_NAME << " does not provide ZYPPP symbol" << endl; } } YQZyppSolverDialogPluginStub::~YQZyppSolverDialogPluginStub() { // NOP } bool YQZyppSolverDialogPluginStub::createZyppSolverDialog( const zypp::PoolItem item ) { if ( ! impl ) { QMessageBox::information( 0, _("Missing package") , _("Package libqdialogsolver is required for this feature.")); return false; } return impl->createZyppSolverDialog( item ); }
Java
//===-- PPCISelLowering.h - PPC32 DAG Lowering Interface --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the interfaces that PPC uses to lower LLVM code into a // selection DAG. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_POWERPC_PPCISELLOWERING_H #define LLVM_LIB_TARGET_POWERPC_PPCISELLOWERING_H #include "PPC.h" #include "PPCInstrInfo.h" #include "PPCRegisterInfo.h" #include "llvm/CodeGen/CallingConvLower.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/Target/TargetLowering.h" namespace llvm { namespace PPCISD { enum NodeType : unsigned { // Start the numbering where the builtin ops and target ops leave off. FIRST_NUMBER = ISD::BUILTIN_OP_END, /// FSEL - Traditional three-operand fsel node. /// FSEL, /// FCFID - The FCFID instruction, taking an f64 operand and producing /// and f64 value containing the FP representation of the integer that /// was temporarily in the f64 operand. FCFID, /// Newer FCFID[US] integer-to-floating-point conversion instructions for /// unsigned integers and single-precision outputs. FCFIDU, FCFIDS, FCFIDUS, /// FCTI[D,W]Z - The FCTIDZ and FCTIWZ instructions, taking an f32 or f64 /// operand, producing an f64 value containing the integer representation /// of that FP value. FCTIDZ, FCTIWZ, /// Newer FCTI[D,W]UZ floating-point-to-integer conversion instructions for /// unsigned integers. FCTIDUZ, FCTIWUZ, /// Reciprocal estimate instructions (unary FP ops). FRE, FRSQRTE, // VMADDFP, VNMSUBFP - The VMADDFP and VNMSUBFP instructions, taking // three v4f32 operands and producing a v4f32 result. VMADDFP, VNMSUBFP, /// VPERM - The PPC VPERM Instruction. /// VPERM, /// The CMPB instruction (takes two operands of i32 or i64). CMPB, /// Hi/Lo - These represent the high and low 16-bit parts of a global /// address respectively. These nodes have two operands, the first of /// which must be a TargetGlobalAddress, and the second of which must be a /// Constant. Selected naively, these turn into 'lis G+C' and 'li G+C', /// though these are usually folded into other nodes. Hi, Lo, /// The following two target-specific nodes are used for calls through /// function pointers in the 64-bit SVR4 ABI. /// OPRC, CHAIN = DYNALLOC(CHAIN, NEGSIZE, FRAME_INDEX) /// This instruction is lowered in PPCRegisterInfo::eliminateFrameIndex to /// compute an allocation on the stack. DYNALLOC, /// GlobalBaseReg - On Darwin, this node represents the result of the mflr /// at function entry, used for PIC code. GlobalBaseReg, /// These nodes represent the 32-bit PPC shifts that operate on 6-bit /// shift amounts. These nodes are generated by the multi-precision shift /// code. SRL, SRA, SHL, /// The combination of sra[wd]i and addze used to implemented signed /// integer division by a power of 2. The first operand is the dividend, /// and the second is the constant shift amount (representing the /// divisor). SRA_ADDZE, /// CALL - A direct function call. /// CALL_NOP is a call with the special NOP which follows 64-bit /// SVR4 calls. CALL, CALL_NOP, /// CHAIN,FLAG = MTCTR(VAL, CHAIN[, INFLAG]) - Directly corresponds to a /// MTCTR instruction. MTCTR, /// CHAIN,FLAG = BCTRL(CHAIN, INFLAG) - Directly corresponds to a /// BCTRL instruction. BCTRL, /// CHAIN,FLAG = BCTRL(CHAIN, ADDR, INFLAG) - The combination of a bctrl /// instruction and the TOC reload required on SVR4 PPC64. BCTRL_LOAD_TOC, /// Return with a flag operand, matched by 'blr' RET_FLAG, /// R32 = MFOCRF(CRREG, INFLAG) - Represents the MFOCRF instruction. /// This copies the bits corresponding to the specified CRREG into the /// resultant GPR. Bits corresponding to other CR regs are undefined. MFOCRF, /// Direct move from a VSX register to a GPR MFVSR, /// Direct move from a GPR to a VSX register (algebraic) MTVSRA, /// Direct move from a GPR to a VSX register (zero) MTVSRZ, // FIXME: Remove these once the ANDI glue bug is fixed: /// i1 = ANDIo_1_[EQ|GT]_BIT(i32 or i64 x) - Represents the result of the /// eq or gt bit of CR0 after executing andi. x, 1. This is used to /// implement truncation of i32 or i64 to i1. ANDIo_1_EQ_BIT, ANDIo_1_GT_BIT, // READ_TIME_BASE - A read of the 64-bit time-base register on a 32-bit // target (returns (Lo, Hi)). It takes a chain operand. READ_TIME_BASE, // EH_SJLJ_SETJMP - SjLj exception handling setjmp. EH_SJLJ_SETJMP, // EH_SJLJ_LONGJMP - SjLj exception handling longjmp. EH_SJLJ_LONGJMP, /// RESVEC = VCMP(LHS, RHS, OPC) - Represents one of the altivec VCMP* /// instructions. For lack of better number, we use the opcode number /// encoding for the OPC field to identify the compare. For example, 838 /// is VCMPGTSH. VCMP, /// RESVEC, OUTFLAG = VCMPo(LHS, RHS, OPC) - Represents one of the /// altivec VCMP*o instructions. For lack of better number, we use the /// opcode number encoding for the OPC field to identify the compare. For /// example, 838 is VCMPGTSH. VCMPo, /// CHAIN = COND_BRANCH CHAIN, CRRC, OPC, DESTBB [, INFLAG] - This /// corresponds to the COND_BRANCH pseudo instruction. CRRC is the /// condition register to branch on, OPC is the branch opcode to use (e.g. /// PPC::BLE), DESTBB is the destination block to branch to, and INFLAG is /// an optional input flag argument. COND_BRANCH, /// CHAIN = BDNZ CHAIN, DESTBB - These are used to create counter-based /// loops. BDNZ, BDZ, /// F8RC = FADDRTZ F8RC, F8RC - This is an FADD done with rounding /// towards zero. Used only as part of the long double-to-int /// conversion sequence. FADDRTZ, /// F8RC = MFFS - This moves the FPSCR (not modeled) into the register. MFFS, /// TC_RETURN - A tail call return. /// operand #0 chain /// operand #1 callee (register or absolute) /// operand #2 stack adjustment /// operand #3 optional in flag TC_RETURN, /// ch, gl = CR6[UN]SET ch, inglue - Toggle CR bit 6 for SVR4 vararg calls CR6SET, CR6UNSET, /// GPRC = address of _GLOBAL_OFFSET_TABLE_. Used by initial-exec TLS /// on PPC32. PPC32_GOT, /// GPRC = address of _GLOBAL_OFFSET_TABLE_. Used by general dynamic and /// local dynamic TLS on PPC32. PPC32_PICGOT, /// G8RC = ADDIS_GOT_TPREL_HA %X2, Symbol - Used by the initial-exec /// TLS model, produces an ADDIS8 instruction that adds the GOT /// base to sym\@got\@tprel\@ha. ADDIS_GOT_TPREL_HA, /// G8RC = LD_GOT_TPREL_L Symbol, G8RReg - Used by the initial-exec /// TLS model, produces a LD instruction with base register G8RReg /// and offset sym\@got\@tprel\@l. This completes the addition that /// finds the offset of "sym" relative to the thread pointer. LD_GOT_TPREL_L, /// G8RC = ADD_TLS G8RReg, Symbol - Used by the initial-exec TLS /// model, produces an ADD instruction that adds the contents of /// G8RReg to the thread pointer. Symbol contains a relocation /// sym\@tls which is to be replaced by the thread pointer and /// identifies to the linker that the instruction is part of a /// TLS sequence. ADD_TLS, /// G8RC = ADDIS_TLSGD_HA %X2, Symbol - For the general-dynamic TLS /// model, produces an ADDIS8 instruction that adds the GOT base /// register to sym\@got\@tlsgd\@ha. ADDIS_TLSGD_HA, /// %X3 = ADDI_TLSGD_L G8RReg, Symbol - For the general-dynamic TLS /// model, produces an ADDI8 instruction that adds G8RReg to /// sym\@got\@tlsgd\@l and stores the result in X3. Hidden by /// ADDIS_TLSGD_L_ADDR until after register assignment. ADDI_TLSGD_L, /// %X3 = GET_TLS_ADDR %X3, Symbol - For the general-dynamic TLS /// model, produces a call to __tls_get_addr(sym\@tlsgd). Hidden by /// ADDIS_TLSGD_L_ADDR until after register assignment. GET_TLS_ADDR, /// G8RC = ADDI_TLSGD_L_ADDR G8RReg, Symbol, Symbol - Op that /// combines ADDI_TLSGD_L and GET_TLS_ADDR until expansion following /// register assignment. ADDI_TLSGD_L_ADDR, /// G8RC = ADDIS_TLSLD_HA %X2, Symbol - For the local-dynamic TLS /// model, produces an ADDIS8 instruction that adds the GOT base /// register to sym\@got\@tlsld\@ha. ADDIS_TLSLD_HA, /// %X3 = ADDI_TLSLD_L G8RReg, Symbol - For the local-dynamic TLS /// model, produces an ADDI8 instruction that adds G8RReg to /// sym\@got\@tlsld\@l and stores the result in X3. Hidden by /// ADDIS_TLSLD_L_ADDR until after register assignment. ADDI_TLSLD_L, /// %X3 = GET_TLSLD_ADDR %X3, Symbol - For the local-dynamic TLS /// model, produces a call to __tls_get_addr(sym\@tlsld). Hidden by /// ADDIS_TLSLD_L_ADDR until after register assignment. GET_TLSLD_ADDR, /// G8RC = ADDI_TLSLD_L_ADDR G8RReg, Symbol, Symbol - Op that /// combines ADDI_TLSLD_L and GET_TLSLD_ADDR until expansion /// following register assignment. ADDI_TLSLD_L_ADDR, /// G8RC = ADDIS_DTPREL_HA %X3, Symbol - For the local-dynamic TLS /// model, produces an ADDIS8 instruction that adds X3 to /// sym\@dtprel\@ha. ADDIS_DTPREL_HA, /// G8RC = ADDI_DTPREL_L G8RReg, Symbol - For the local-dynamic TLS /// model, produces an ADDI8 instruction that adds G8RReg to /// sym\@got\@dtprel\@l. ADDI_DTPREL_L, /// VRRC = VADD_SPLAT Elt, EltSize - Temporary node to be expanded /// during instruction selection to optimize a BUILD_VECTOR into /// operations on splats. This is necessary to avoid losing these /// optimizations due to constant folding. VADD_SPLAT, /// CHAIN = SC CHAIN, Imm128 - System call. The 7-bit unsigned /// operand identifies the operating system entry point. SC, /// CHAIN = CLRBHRB CHAIN - Clear branch history rolling buffer. CLRBHRB, /// GPRC, CHAIN = MFBHRBE CHAIN, Entry, Dummy - Move from branch /// history rolling buffer entry. MFBHRBE, /// CHAIN = RFEBB CHAIN, State - Return from event-based branch. RFEBB, /// VSRC, CHAIN = XXSWAPD CHAIN, VSRC - Occurs only for little /// endian. Maps to an xxswapd instruction that corrects an lxvd2x /// or stxvd2x instruction. The chain is necessary because the /// sequence replaces a load and needs to provide the same number /// of outputs. XXSWAPD, /// QVFPERM = This corresponds to the QPX qvfperm instruction. QVFPERM, /// QVGPCI = This corresponds to the QPX qvgpci instruction. QVGPCI, /// QVALIGNI = This corresponds to the QPX qvaligni instruction. QVALIGNI, /// QVESPLATI = This corresponds to the QPX qvesplati instruction. QVESPLATI, /// QBFLT = Access the underlying QPX floating-point boolean /// representation. QBFLT, /// CHAIN = STBRX CHAIN, GPRC, Ptr, Type - This is a /// byte-swapping store instruction. It byte-swaps the low "Type" bits of /// the GPRC input, then stores it through Ptr. Type can be either i16 or /// i32. STBRX = ISD::FIRST_TARGET_MEMORY_OPCODE, /// GPRC, CHAIN = LBRX CHAIN, Ptr, Type - This is a /// byte-swapping load instruction. It loads "Type" bits, byte swaps it, /// then puts it in the bottom bits of the GPRC. TYPE can be either i16 /// or i32. LBRX, /// STFIWX - The STFIWX instruction. The first operand is an input token /// chain, then an f64 value to store, then an address to store it to. STFIWX, /// GPRC, CHAIN = LFIWAX CHAIN, Ptr - This is a floating-point /// load which sign-extends from a 32-bit integer value into the /// destination 64-bit register. LFIWAX, /// GPRC, CHAIN = LFIWZX CHAIN, Ptr - This is a floating-point /// load which zero-extends from a 32-bit integer value into the /// destination 64-bit register. LFIWZX, /// VSRC, CHAIN = LXVD2X_LE CHAIN, Ptr - Occurs only for little endian. /// Maps directly to an lxvd2x instruction that will be followed by /// an xxswapd. LXVD2X, /// CHAIN = STXVD2X CHAIN, VSRC, Ptr - Occurs only for little endian. /// Maps directly to an stxvd2x instruction that will be preceded by /// an xxswapd. STXVD2X, /// QBRC, CHAIN = QVLFSb CHAIN, Ptr /// The 4xf32 load used for v4i1 constants. QVLFSb, /// GPRC = TOC_ENTRY GA, TOC /// Loads the entry for GA from the TOC, where the TOC base is given by /// the last operand. TOC_ENTRY }; } /// Define some predicates that are used for node matching. namespace PPC { /// isVPKUHUMShuffleMask - Return true if this is the shuffle mask for a /// VPKUHUM instruction. bool isVPKUHUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind, SelectionDAG &DAG); /// isVPKUWUMShuffleMask - Return true if this is the shuffle mask for a /// VPKUWUM instruction. bool isVPKUWUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind, SelectionDAG &DAG); /// isVPKUDUMShuffleMask - Return true if this is the shuffle mask for a /// VPKUDUM instruction. bool isVPKUDUMShuffleMask(ShuffleVectorSDNode *N, unsigned ShuffleKind, SelectionDAG &DAG); /// isVMRGLShuffleMask - Return true if this is a shuffle mask suitable for /// a VRGL* instruction with the specified unit size (1,2 or 4 bytes). bool isVMRGLShuffleMask(ShuffleVectorSDNode *N, unsigned UnitSize, unsigned ShuffleKind, SelectionDAG &DAG); /// isVMRGHShuffleMask - Return true if this is a shuffle mask suitable for /// a VRGH* instruction with the specified unit size (1,2 or 4 bytes). bool isVMRGHShuffleMask(ShuffleVectorSDNode *N, unsigned UnitSize, unsigned ShuffleKind, SelectionDAG &DAG); /// isVMRGEOShuffleMask - Return true if this is a shuffle mask suitable for /// a VMRGEW or VMRGOW instruction bool isVMRGEOShuffleMask(ShuffleVectorSDNode *N, bool CheckEven, unsigned ShuffleKind, SelectionDAG &DAG); /// isVSLDOIShuffleMask - If this is a vsldoi shuffle mask, return the /// shift amount, otherwise return -1. int isVSLDOIShuffleMask(SDNode *N, unsigned ShuffleKind, SelectionDAG &DAG); /// isSplatShuffleMask - Return true if the specified VECTOR_SHUFFLE operand /// specifies a splat of a single element that is suitable for input to /// VSPLTB/VSPLTH/VSPLTW. bool isSplatShuffleMask(ShuffleVectorSDNode *N, unsigned EltSize); /// getVSPLTImmediate - Return the appropriate VSPLT* immediate to splat the /// specified isSplatShuffleMask VECTOR_SHUFFLE mask. unsigned getVSPLTImmediate(SDNode *N, unsigned EltSize, SelectionDAG &DAG); /// get_VSPLTI_elt - If this is a build_vector of constants which can be /// formed by using a vspltis[bhw] instruction of the specified element /// size, return the constant being splatted. The ByteSize field indicates /// the number of bytes of each element [124] -> [bhw]. SDValue get_VSPLTI_elt(SDNode *N, unsigned ByteSize, SelectionDAG &DAG); /// If this is a qvaligni shuffle mask, return the shift /// amount, otherwise return -1. int isQVALIGNIShuffleMask(SDNode *N); } class PPCTargetLowering : public TargetLowering { const PPCSubtarget &Subtarget; public: explicit PPCTargetLowering(const PPCTargetMachine &TM, const PPCSubtarget &STI); /// getTargetNodeName() - This method returns the name of a target specific /// DAG node. const char *getTargetNodeName(unsigned Opcode) const override; MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override { return MVT::i32; } bool isCheapToSpeculateCttz() const override { return true; } bool isCheapToSpeculateCtlz() const override { return true; } /// getSetCCResultType - Return the ISD::SETCC ValueType EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override; /// Return true if target always beneficiates from combining into FMA for a /// given value type. This must typically return false on targets where FMA /// takes more cycles to execute than FADD. bool enableAggressiveFMAFusion(EVT VT) const override; /// getPreIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if the node's address /// can be legally represented as pre-indexed load / store address. bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, SelectionDAG &DAG) const override; /// SelectAddressRegReg - Given the specified addressed, check to see if it /// can be represented as an indexed [r+r] operation. Returns false if it /// can be more efficiently represented with [r+imm]. bool SelectAddressRegReg(SDValue N, SDValue &Base, SDValue &Index, SelectionDAG &DAG) const; /// SelectAddressRegImm - Returns true if the address N can be represented /// by a base register plus a signed 16-bit displacement [r+imm], and if it /// is not better represented as reg+reg. If Aligned is true, only accept /// displacements suitable for STD and friends, i.e. multiples of 4. bool SelectAddressRegImm(SDValue N, SDValue &Disp, SDValue &Base, SelectionDAG &DAG, bool Aligned) const; /// SelectAddressRegRegOnly - Given the specified addressed, force it to be /// represented as an indexed [r+r] operation. bool SelectAddressRegRegOnly(SDValue N, SDValue &Base, SDValue &Index, SelectionDAG &DAG) const; Sched::Preference getSchedulingPreference(SDNode *N) const override; /// LowerOperation - Provide custom lowering hooks for some operations. /// SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override; /// ReplaceNodeResults - Replace the results of node with an illegal result /// type with new values built out of custom code. /// void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue>&Results, SelectionDAG &DAG) const override; SDValue expandVSXLoadForLE(SDNode *N, DAGCombinerInfo &DCI) const; SDValue expandVSXStoreForLE(SDNode *N, DAGCombinerInfo &DCI) const; SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override; SDValue BuildSDIVPow2(SDNode *N, const APInt &Divisor, SelectionDAG &DAG, std::vector<SDNode *> *Created) const override; unsigned getRegisterByName(const char* RegName, EVT VT, SelectionDAG &DAG) const override; void computeKnownBitsForTargetNode(const SDValue Op, APInt &KnownZero, APInt &KnownOne, const SelectionDAG &DAG, unsigned Depth = 0) const override; unsigned getPrefLoopAlignment(MachineLoop *ML) const override; Instruction* emitLeadingFence(IRBuilder<> &Builder, AtomicOrdering Ord, bool IsStore, bool IsLoad) const override; Instruction* emitTrailingFence(IRBuilder<> &Builder, AtomicOrdering Ord, bool IsStore, bool IsLoad) const override; MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const override; MachineBasicBlock *EmitAtomicBinary(MachineInstr *MI, MachineBasicBlock *MBB, unsigned AtomicSize, unsigned BinOpcode) const; MachineBasicBlock *EmitPartwordAtomicBinary(MachineInstr *MI, MachineBasicBlock *MBB, bool is8bit, unsigned Opcode) const; MachineBasicBlock *emitEHSjLjSetJmp(MachineInstr *MI, MachineBasicBlock *MBB) const; MachineBasicBlock *emitEHSjLjLongJmp(MachineInstr *MI, MachineBasicBlock *MBB) const; ConstraintType getConstraintType(StringRef Constraint) const override; /// Examine constraint string and operand type and determine a weight value. /// The operand object must already have been set up with the operand type. ConstraintWeight getSingleConstraintMatchWeight( AsmOperandInfo &info, const char *constraint) const override; std::pair<unsigned, const TargetRegisterClass *> getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override; /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate /// function arguments in the caller parameter area. This is the actual /// alignment, not its logarithm. unsigned getByValTypeAlignment(Type *Ty, const DataLayout &DL) const override; /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops /// vector. If it is invalid, don't add anything to Ops. void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, std::vector<SDValue> &Ops, SelectionDAG &DAG) const override; unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const override { if (ConstraintCode == "es") return InlineAsm::Constraint_es; else if (ConstraintCode == "o") return InlineAsm::Constraint_o; else if (ConstraintCode == "Q") return InlineAsm::Constraint_Q; else if (ConstraintCode == "Z") return InlineAsm::Constraint_Z; else if (ConstraintCode == "Zy") return InlineAsm::Constraint_Zy; return TargetLowering::getInlineAsmMemConstraint(ConstraintCode); } /// isLegalAddressingMode - Return true if the addressing mode represented /// by AM is legal for this target, for a load/store of the specified type. bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS) const override; /// isLegalICmpImmediate - Return true if the specified immediate is legal /// icmp immediate, that is the target has icmp instructions which can /// compare a register against the immediate without having to materialize /// the immediate into a register. bool isLegalICmpImmediate(int64_t Imm) const override; /// isLegalAddImmediate - Return true if the specified immediate is legal /// add immediate, that is the target has add instructions which can /// add a register and the immediate without having to materialize /// the immediate into a register. bool isLegalAddImmediate(int64_t Imm) const override; /// isTruncateFree - Return true if it's free to truncate a value of /// type Ty1 to type Ty2. e.g. On PPC it's free to truncate a i64 value in /// register X1 to i32 by referencing its sub-register R1. bool isTruncateFree(Type *Ty1, Type *Ty2) const override; bool isTruncateFree(EVT VT1, EVT VT2) const override; bool isZExtFree(SDValue Val, EVT VT2) const override; bool isFPExtFree(EVT VT) const override; /// \brief Returns true if it is beneficial to convert a load of a constant /// to just the constant itself. bool shouldConvertConstantLoadToIntImm(const APInt &Imm, Type *Ty) const override; bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override; bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I, unsigned Intrinsic) const override; /// getOptimalMemOpType - Returns the target specific optimal type for load /// and store operations as a result of memset, memcpy, and memmove /// lowering. If DstAlign is zero that means it's safe to destination /// alignment can satisfy any constraint. Similarly if SrcAlign is zero it /// means there isn't a need to check it against alignment requirement, /// probably because the source does not need to be loaded. If 'IsMemset' is /// true, that means it's expanding a memset. If 'ZeroMemset' is true, that /// means it's a memset of zero. 'MemcpyStrSrc' indicates whether the memcpy /// source is constant so it does not need to be loaded. /// It returns EVT::Other if the type should be determined using generic /// target-independent logic. EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign, bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc, MachineFunction &MF) const override; /// Is unaligned memory access allowed for the given type, and is it fast /// relative to software emulation. bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace, unsigned Align = 1, bool *Fast = nullptr) const override; /// isFMAFasterThanFMulAndFAdd - Return true if an FMA operation is faster /// than a pair of fmul and fadd instructions. fmuladd intrinsics will be /// expanded to FMAs when this method returns true, otherwise fmuladd is /// expanded to fmul + fadd. bool isFMAFasterThanFMulAndFAdd(EVT VT) const override; const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const override; // Should we expand the build vector with shuffles? bool shouldExpandBuildVectorWithShuffles(EVT VT, unsigned DefinedValues) const override; /// createFastISel - This method returns a target-specific FastISel object, /// or null if the target does not support "fast" instruction selection. FastISel *createFastISel(FunctionLoweringInfo &FuncInfo, const TargetLibraryInfo *LibInfo) const override; /// \brief Returns true if an argument of type Ty needs to be passed in a /// contiguous block of registers in calling convention CallConv. bool functionArgumentNeedsConsecutiveRegisters( Type *Ty, CallingConv::ID CallConv, bool isVarArg) const override { // We support any array type as "consecutive" block in the parameter // save area. The element type defines the alignment requirement and // whether the argument should go in GPRs, FPRs, or VRs if available. // // Note that clang uses this capability both to implement the ELFv2 // homogeneous float/vector aggregate ABI, and to avoid having to use // "byval" when passing aggregates that might fully fit in registers. return Ty->isArrayTy(); } private: struct ReuseLoadInfo { SDValue Ptr; SDValue Chain; SDValue ResChain; MachinePointerInfo MPI; bool IsInvariant; unsigned Alignment; AAMDNodes AAInfo; const MDNode *Ranges; ReuseLoadInfo() : IsInvariant(false), Alignment(0), Ranges(nullptr) {} }; bool canReuseLoadAddress(SDValue Op, EVT MemVT, ReuseLoadInfo &RLI, SelectionDAG &DAG, ISD::LoadExtType ET = ISD::NON_EXTLOAD) const; void spliceIntoChain(SDValue ResChain, SDValue NewResChain, SelectionDAG &DAG) const; void LowerFP_TO_INTForReuse(SDValue Op, ReuseLoadInfo &RLI, SelectionDAG &DAG, SDLoc dl) const; SDValue LowerFP_TO_INTDirectMove(SDValue Op, SelectionDAG &DAG, SDLoc dl) const; SDValue LowerINT_TO_FPDirectMove(SDValue Op, SelectionDAG &DAG, SDLoc dl) const; SDValue getFramePointerFrameIndex(SelectionDAG & DAG) const; SDValue getReturnAddrFrameIndex(SelectionDAG & DAG) const; bool IsEligibleForTailCallOptimization(SDValue Callee, CallingConv::ID CalleeCC, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, SelectionDAG& DAG) const; SDValue EmitTailCallLoadFPAndRetAddr(SelectionDAG & DAG, int SPDiff, SDValue Chain, SDValue &LROpOut, SDValue &FPOpOut, bool isDarwinABI, SDLoc dl) const; SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const; SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const; SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const; SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const; SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const; SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const; SDValue LowerINIT_TRAMPOLINE(SDValue Op, SelectionDAG &DAG) const; SDValue LowerADJUST_TRAMPOLINE(SDValue Op, SelectionDAG &DAG) const; SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG, const PPCSubtarget &Subtarget) const; SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG, const PPCSubtarget &Subtarget) const; SDValue LowerVACOPY(SDValue Op, SelectionDAG &DAG, const PPCSubtarget &Subtarget) const; SDValue LowerSTACKRESTORE(SDValue Op, SelectionDAG &DAG, const PPCSubtarget &Subtarget) const; SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG, const PPCSubtarget &Subtarget) const; SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const; SDValue LowerTRUNCATE(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const; SDValue LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG, SDLoc dl) const; SDValue LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG) const; SDValue LowerFLT_ROUNDS_(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSHL_PARTS(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSRL_PARTS(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSRA_PARTS(SDValue Op, SelectionDAG &DAG) const; SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const; SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const; SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const; SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSCALAR_TO_VECTOR(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSIGN_EXTEND_INREG(SDValue Op, SelectionDAG &DAG) const; SDValue LowerMUL(SDValue Op, SelectionDAG &DAG) const; SDValue LowerVectorLoad(SDValue Op, SelectionDAG &DAG) const; SDValue LowerVectorStore(SDValue Op, SelectionDAG &DAG) const; SDValue LowerCallResult(SDValue Chain, SDValue InFlag, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const; SDValue FinishCall(CallingConv::ID CallConv, SDLoc dl, bool isTailCall, bool isVarArg, bool IsPatchPoint, bool hasNest, SelectionDAG &DAG, SmallVector<std::pair<unsigned, SDValue>, 8> &RegsToPass, SDValue InFlag, SDValue Chain, SDValue CallSeqStart, SDValue &Callee, int SPDiff, unsigned NumBytes, const SmallVectorImpl<ISD::InputArg> &Ins, SmallVectorImpl<SDValue> &InVals, ImmutableCallSite *CS) const; SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const override; SDValue LowerCall(TargetLowering::CallLoweringInfo &CLI, SmallVectorImpl<SDValue> &InVals) const override; bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool isVarArg, const SmallVectorImpl<ISD::OutputArg> &Outs, LLVMContext &Context) const override; SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::OutputArg> &Outs, const SmallVectorImpl<SDValue> &OutVals, SDLoc dl, SelectionDAG &DAG) const override; SDValue extendArgForPPC64(ISD::ArgFlagsTy Flags, EVT ObjectVT, SelectionDAG &DAG, SDValue ArgVal, SDLoc dl) const; SDValue LowerFormalArguments_Darwin(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const; SDValue LowerFormalArguments_64SVR4(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const; SDValue LowerFormalArguments_32SVR4(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const; SDValue createMemcpyOutsideCallSeq(SDValue Arg, SDValue PtrOff, SDValue CallSeqStart, ISD::ArgFlagsTy Flags, SelectionDAG &DAG, SDLoc dl) const; SDValue LowerCall_Darwin(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool isTailCall, bool IsPatchPoint, const SmallVectorImpl<ISD::OutputArg> &Outs, const SmallVectorImpl<SDValue> &OutVals, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals, ImmutableCallSite *CS) const; SDValue LowerCall_64SVR4(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool isTailCall, bool IsPatchPoint, const SmallVectorImpl<ISD::OutputArg> &Outs, const SmallVectorImpl<SDValue> &OutVals, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals, ImmutableCallSite *CS) const; SDValue LowerCall_32SVR4(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, bool isTailCall, bool IsPatchPoint, const SmallVectorImpl<ISD::OutputArg> &Outs, const SmallVectorImpl<SDValue> &OutVals, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc dl, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals, ImmutableCallSite *CS) const; SDValue lowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const; SDValue lowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const; SDValue DAGCombineExtBoolTrunc(SDNode *N, DAGCombinerInfo &DCI) const; SDValue DAGCombineTruncBoolExt(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineFPToIntToFP(SDNode *N, DAGCombinerInfo &DCI) const; SDValue getRsqrtEstimate(SDValue Operand, DAGCombinerInfo &DCI, unsigned &RefinementSteps, bool &UseOneConstNR) const override; SDValue getRecipEstimate(SDValue Operand, DAGCombinerInfo &DCI, unsigned &RefinementSteps) const override; bool combineRepeatedFPDivisors(unsigned NumUsers) const override; CCAssignFn *useFastISelCCs(unsigned Flag) const; }; namespace PPC { FastISel *createFastISel(FunctionLoweringInfo &FuncInfo, const TargetLibraryInfo *LibInfo); } bool CC_PPC32_SVR4_Custom_Dummy(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State); bool CC_PPC32_SVR4_Custom_AlignArgRegs(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State); bool CC_PPC32_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State); } #endif // LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>C-Layman: /home/detlev/src/c-layman/src/message.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File&nbsp;List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div class="contents"> <h1>/home/detlev/src/c-layman/src/message.h File Reference</h1><code>#include &lt;stdio.h&gt;</code><br> <code>#include &quot;<a class="el" href="stringlist_8h-source.html">stringlist.h</a>&quot;</code><br> <p> <a href="message_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef struct <a class="el" href="struct_message.html">Message</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="message_8h.html#82fffef6ac8d8a796ab35b7d6a7a0dcb">Message</a></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct_message.html">Message</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__message.html#g71549e9f908d468258f2e257655df858">messageCreate</a> (const char *module, FILE *out, FILE *err, FILE *dbg)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__message.html#g5faf9665b84f817233ca8dad4dbe9004">messageFree</a> (<a class="el" href="struct_message.html">Message</a> *m)</td></tr> </table> <hr><h2>Typedef Documentation</h2> <a class="anchor" name="82fffef6ac8d8a796ab35b7d6a7a0dcb"></a><!-- doxytag: member="message.h::Message" ref="82fffef6ac8d8a796ab35b7d6a7a0dcb" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef struct <a class="el" href="struct_message.html">Message</a> <a class="el" href="struct_message.html">Message</a> </td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Fri Aug 6 20:00:53 2010 for C-Layman by&nbsp; <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> </body> </html>
Java
<div class="container" id="mainContent"> <div id="topOfPage"> </div> <h1> Feedback Results - Student </h1> <br> <div class="well well-plain"> <div class="panel-body"> <div class="form-horizontal"> <div class="panel-heading"> <div class="form-group"> <label class="col-sm-2 control-label"> Course ID: </label> <div class="col-sm-10"> <p class="form-control-static"> AHPUiT____.instr1_.gma-demo </p> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label"> Session: </label> <div class="col-sm-10"> <p class="form-control-static"> First team feedback session </p> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label"> Opening time: </label> <div class="col-sm-10"> <p class="form-control-static"> Sun, 01 Apr 2012, 11:59 PM </p> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label"> Closing time: </label> <div class="col-sm-10"> <p class="form-control-static"> Mon, 02 Apr 2012, 11:59 PM </p> </div> </div> </div> </div> </div> </div> <br> <div id="statusMessagesToUser"> <div class="overflow-auto alert alert-info statusMessage"> You have received feedback from others. Please see below. </div> </div> <script defer="" src="/js/statusMessage.js" type="text/javascript"> </script> <br> <div class="panel panel-default"> <div class="panel-heading"> <h4> Question 1: <span class="text-preserve-space"> Please rate the estimated contribution of your team members and yourself.  <span style=" white-space: normal;"> <a class="color_gray" data-less="[less]" data-more="[more]" href="javascript:;" id="questionAdditionalInfoButton-1-" onclick="toggleAdditionalQuestionInfo('1-')"> [more] </a> <br> <span id="questionAdditionalInfo-1-" style="display:none;"> Team contribution question </span> </span> </span> </h4> <div class="panel panel-primary"> <div class="panel-heading"> Comparison of work distribution   <span style=" white-space: normal;"> <a class="small link-in-dark-bg" data-less="[less]" data-more="[how to interpret, etc..]" href="javascript:;" id="questionAdditionalInfoButton-1-contributionInfo" onclick="toggleAdditionalQuestionInfo('1-contributionInfo')"> [how to interpret, etc..] </a> <br> <span id="questionAdditionalInfo-1-contributionInfo" style="display:none;"> <h4 id="interpret"> How do I interpret these results? </h4> <ul class="bulletedList"> <li> Compare values given under 'My view' to those under 'Team's view'. This tells you whether your perception matches with what the team thinks, particularly regarding your own contribution. You may ignore minor differences. </li> <li> Team's view of your contribution is the average value of the contribution your team members attributed to you, excluding the contribution you attributed to yourself. That means you cannot boost your perceived contribution by claiming a high contribution for yourself or attributing a low contribution to team members. </li> <li> Also note that the team’s view has been scaled up/down so that the sum of values in your view matches the sum of values in team’s view. That way, you can make a direct comparison between your view and the team’s view. As a result, the values you see in team’s view may not match the values your team members see in their results. </li> </ul> <br> <h4> How are these results used in grading? </h4> TEAMMATES does not calculate grades. It is up to the instructors to use contribution question results in any way they want. However, TEAMMATES recommend that contribution question results are used only as flags to identify teams with contribution imbalances. Once identified, the instructor is recommended to investigate further before taking action. <br> <br> <h4> How are the contribution numbers calculated? </h4> Here are the important things to note: <ul class="bulletedList"> <li> The contribution you attributed to yourself is not used when calculating the perceived contribution of you or team members. </li> <li> From the estimates you submit, we try to deduce the answer to this question: In your opinion, if your teammates are doing the project by themselves without you, how do they compare against each other in terms of contribution? This is because we want to deduce your unbiased opinion about your team members’ contributions. Then, we use those values to calculate the average perceived contribution of each team member. </li> <li> When deducing the above, we first adjust the estimates you submitted to remove artificial inflations/deflations. For example, giving everyone [Equal share + 20%] is as same as giving everyone [Equal share] because in both cases all members have done a similar share of work. </li> </ul> The actual calculation is a bit complex and the finer details can be found <a href="https://docs.google.com/document/d/1hjQQHYM3YId0EUSrGnJWG5AeFpDD_G7xg_d--7jg3vU/pub?embedded=true#h.n5u2xs6z9y0g"> here </a> . </span> </span> </div> <table class="table table-striped"> <tbody> <tr> <td> <strong> My view: </strong> </td> <td> <span class="text-muted"> <strong> of me: </strong> </span> <span class="color-positive"> E +10% </span> </td> <td> <span class="text-muted"> <strong> of others: </strong> </span> <span class="color-positive"> E +10% </span> , <span class="color-positive"> E +10% </span> , <span class="color-negative"> E -20% </span> </td> </tr> <tr> <td> <strong> Team's view: </strong> </td> <td> <span class="text-muted"> <strong> of me: </strong> </span> <span class="color-positive"> E +9% </span> </td> <td> <span class="text-muted"> <strong> of others: </strong> </span> <span class="color-positive"> E +9% </span> , <span class="color-positive"> E +9% </span> , <span class="color-negative"> E -18% </span> </td> </tr> </tbody> </table> </div> </div> </div> <br> <div class="panel panel-default"> <div class="panel-heading"> <h4> Question 2: <span class="text-preserve-space"> Comments about my contribution (shown to other teammates) </span> </h4> <div class="panel panel-info"> <div class="panel-heading"> <b> To: </b> You </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> You </td> </tr> <tr> <td class="text-preserve-space"> I was the project lead. I designed the application architecture and managed the project to ensure we deliver the product on time. </td> </tr> </tbody> </table> </div> <div class="panel panel-primary"> <div class="panel-heading"> <b> To: </b> Charlie Davis </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> Charlie Davis </td> </tr> <tr> <td class="text-preserve-space"> I am a bit slow compared to my team mates, but the members helped me to catch up. </td> </tr> <tr> <td> <ul class="list-group comment-list"> <li class="list-group-item list-group-item-warning" id="responseCommentRow-${comment.id}"> <div id="commentBar-${comment.id}"> <span class="text-muted"> From: AHPUiT+++_.instr1!@gmail.tmt [Mon, 30 Apr 2012, 09:36 PM UTC] </span> </div> <div id="plainCommentText-${comment.id}" style="margin-left: 15px;"> <p> Well, Being your first team project always takes some time. I hope you had nice experience working with the team. </p> </div> </li> </ul> </td> </tr> </tbody> </table> </div> <div class="panel panel-primary"> <div class="panel-heading"> <b> To: </b> Francis Gabriel </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> Francis Gabriel </td> </tr> <tr> <td class="text-preserve-space"> I was the designer. I did all the UI work. </td> </tr> <tr> <td> <ul class="list-group comment-list"> <li class="list-group-item list-group-item-warning" id="responseCommentRow-${comment.id}"> <div id="commentBar-${comment.id}"> <span class="text-muted"> From: AHPUiT+++_.instr1!@gmail.tmt [Mon, 30 Apr 2012, 09:39 PM UTC] </span> </div> <div id="plainCommentText-${comment.id}" style="margin-left: 15px;"> <p> Design could have been more interactive. </p> </div> </li> </ul> </td> </tr> </tbody> </table> </div> <div class="panel panel-primary"> <div class="panel-heading"> <b> To: </b> Gene Hudson </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> Gene Hudson </td> </tr> <tr> <td class="text-preserve-space"> I am the programmer for the team. I did most of the coding. </td> </tr> </tbody> </table> </div> </div> </div> <br> <div class="panel panel-default"> <div class="panel-heading"> <h4> Question 3: <span class="text-preserve-space"> My comments about this teammate(confidential and only shown to instructor) </span> </h4> <div class="panel panel-info"> <div class="panel-heading"> <b> To: </b> Charlie Davis </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> You </td> </tr> <tr> <td class="text-preserve-space"> A bit weak in terms of technical skills. He spent lots of time in picking up the skills. Although a bit slow in development, his attitude is good. </td> </tr> </tbody> </table> </div> <div class="panel panel-info"> <div class="panel-heading"> <b> To: </b> Francis Gabriel </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> You </td> </tr> <tr> <td class="text-preserve-space"> Francis is the designer of the project. He did a good job! </td> </tr> </tbody> </table> </div> <div class="panel panel-info"> <div class="panel-heading"> <b> To: </b> Gene Hudson </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> You </td> </tr> <tr> <td class="text-preserve-space"> Gene is the programmer for our team. She put in a lot of effort in coding a significant portion of the project. </td> </tr> </tbody> </table> </div> </div> </div> <br> <div class="panel panel-default"> <div class="panel-heading"> <h4> Question 4: <span class="text-preserve-space"> Comments about team dynamics(confidential and only shown to instructor) </span> </h4> <div class="panel panel-info"> <div class="panel-heading"> <b> To: </b> Team 2 </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> You </td> </tr> <tr> <td class="text-preserve-space"> I had a great time with this team. Thanks for all the support from the members. </td> </tr> </tbody> </table> </div> </div> </div> <br> <div class="panel panel-default"> <div class="panel-heading"> <h4> Question 5: <span class="text-preserve-space"> My feedback to this teammate(shown anonymously to the teammate) </span> </h4> <div class="panel panel-primary"> <div class="panel-heading"> <b> To: </b> You </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> Anonymous student ${participant.hash} </td> </tr> <tr> <td class="text-preserve-space"> Thank you AHPUiT Instrúctör WithPlusInEmail for all the hardwork! </td> </tr> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> Anonymous student ${participant.hash} </td> </tr> <tr> <td class="text-preserve-space"> Thank you AHPUiT Instrúctör WithPlusInEmail for all the help in the project. </td> </tr> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> Anonymous student ${participant.hash} </td> </tr> <tr> <td class="text-preserve-space"> Thank you AHPUiT Instrúctör WithPlusInEmail for being such a good team leader! </td> </tr> </tbody> </table> </div> <div class="panel panel-info"> <div class="panel-heading"> <b> To: </b> Charlie Davis </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> You </td> </tr> <tr> <td class="text-preserve-space"> Good try Charlie! Thanks for showing great effort in picking up the skills. </td> </tr> </tbody> </table> </div> <div class="panel panel-info"> <div class="panel-heading"> <b> To: </b> Francis Gabriel </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> You </td> </tr> <tr> <td class="text-preserve-space"> Nice work Francis! </td> </tr> </tbody> </table> </div> <div class="panel panel-info"> <div class="panel-heading"> <b> To: </b> Gene Hudson </div> <table class="table"> <tbody> <tr class="resultSubheader"> <td> <span class="bold"> <b> From: </b> </span> You </td> </tr> <tr> <td class="text-preserve-space"> Keep up the good work Gene! </td> </tr> </tbody> </table> </div> </div> </div> <br> </div>
Java
/* cast5.c */ /* This file is part of the AVR-Crypto-Lib. Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * \file cast5.c * \author Daniel Otte * \email bg@nerilex.org * \date 2006-07-26 * \par License: * GPLv3 or later * \brief Implementation of the CAST5 (aka CAST-128) cipher algorithm as described in RFC 2144 * */ #include <stdint.h> #include <string.h> #include "cast5.h" #include <avr/pgmspace.h> #undef DEBUG #ifdef DEBUG #include "cli.h" #endif #include "cast5-sbox.h" #define S5(x) pgm_read_dword(&s5[(x)]) #define S6(x) pgm_read_dword(&s6[(x)]) #define S7(x) pgm_read_dword(&s7[(x)]) #define S8(x) pgm_read_dword(&s8[(x)]) static void cast5_init_A(uint8_t *dest, uint8_t *src, bool bmode) { uint8_t mask = bmode ? 0x8 : 0; *((uint32_t*) (&dest[0x0])) = *((uint32_t*) (&src[0x0 ^ mask])) ^ S5(src[0xD ^ mask]) ^ S6(src[0xF ^ mask]) ^ S7(src[0xC ^ mask]) ^ S8(src[0xE ^ mask]) ^ S7(src[0x8 ^ mask]); *((uint32_t*) (&dest[0x4])) = *((uint32_t*) (&src[0x8 ^ mask])) ^ S5(dest[0x0]) ^ S6(dest[0x2]) ^ S7(dest[0x1]) ^ S8(dest[0x3]) ^ S8(src[0xA ^ mask]); *((uint32_t*) (&dest[0x8])) = *((uint32_t*) (&src[0xC ^ mask])) ^ S5(dest[0x7]) ^ S6(dest[0x6]) ^ S7(dest[0x5]) ^ S8(dest[0x4]) ^ S5(src[0x9 ^ mask]); *((uint32_t*) (&dest[0xC])) = *((uint32_t*) (&src[0x4 ^ mask])) ^ S5(dest[0xA]) ^ S6(dest[0x9]) ^ S7(dest[0xB]) ^ S8(dest[0x8]) ^ S6(src[0xB ^ mask]); } static void cast5_init_M(uint8_t *dest, uint8_t *src, bool nmode, bool xmode) { uint8_t nmt[] = { 0xB, 0xA, 0x9, 0x8, 0xF, 0xE, 0xD, 0xC, 0x3, 0x2, 0x1, 0x0, 0x7, 0x6, 0x5, 0x4 }; /* nmode table */ uint8_t xmt[4][4] = { { 0x2, 0x6, 0x9, 0xC }, { 0x8, 0xD, 0x3, 0x7 }, { 0x3, 0x7, 0x8, 0xD }, { 0x9, 0xC, 0x2, 0x6 } }; #define NMT(x) (src[nmode?nmt[(x)]:(x)]) #define XMT(x) (src[xmt[(xmode<<1) + nmode][(x)]]) *((uint32_t*) (&dest[0x0])) = S5(NMT(0x8)) ^ S6(NMT(0x9)) ^ S7(NMT(0x7)) ^ S8(NMT(0x6)) ^ S5(XMT(0)); *((uint32_t*) (&dest[0x4])) = S5(NMT(0xA)) ^ S6(NMT(0xB)) ^ S7(NMT(0x5)) ^ S8(NMT(0x4)) ^ S6(XMT(1)); *((uint32_t*) (&dest[0x8])) = S5(NMT(0xC)) ^ S6(NMT(0xD)) ^ S7(NMT(0x3)) ^ S8(NMT(0x2)) ^ S7(XMT(2)); *((uint32_t*) (&dest[0xC])) = S5(NMT(0xE)) ^ S6(NMT(0xF)) ^ S7(NMT(0x1)) ^ S8(NMT(0x0)) ^ S8(XMT(3)); } #define S5B(x) pgm_read_byte(3+(uint8_t*)(&s5[(x)])) #define S6B(x) pgm_read_byte(3+(uint8_t*)(&s6[(x)])) #define S7B(x) pgm_read_byte(3+(uint8_t*)(&s7[(x)])) #define S8B(x) pgm_read_byte(3+(uint8_t*)(&s8[(x)])) static void cast5_init_rM(uint8_t *klo, uint8_t *khi, uint8_t offset, uint8_t *src, bool nmode, bool xmode) { uint8_t nmt[] = { 0xB, 0xA, 0x9, 0x8, 0xF, 0xE, 0xD, 0xC, 0x3, 0x2, 0x1, 0x0, 0x7, 0x6, 0x5, 0x4 }; /* nmode table */ uint8_t xmt[4][4] = { { 0x2, 0x6, 0x9, 0xC }, { 0x8, 0xD, 0x3, 0x7 }, { 0x3, 0x7, 0x8, 0xD }, { 0x9, 0xC, 0x2, 0x6 } }; uint8_t t, h = 0; t = S5B(NMT(0x8)) ^ S6B(NMT(0x9)) ^ S7B(NMT(0x7)) ^ S8B(NMT(0x6)) ^ S5B(XMT(0)); klo[offset * 2] |= (t & 0x0f); h |= (t & 0x10); h >>= 1; t = S5B(NMT(0xA)) ^ S6B(NMT(0xB)) ^ S7B(NMT(0x5)) ^ S8B(NMT(0x4)) ^ S6B(XMT(1)); klo[offset * 2] |= (t << 4) & 0xf0; h |= t & 0x10; h >>= 1; t = S5B(NMT(0xC)) ^ S6B(NMT(0xD)) ^ S7B(NMT(0x3)) ^ S8B(NMT(0x2)) ^ S7B(XMT(2)); klo[offset * 2 + 1] |= t & 0xf; h |= t & 0x10; h >>= 1; t = S5B(NMT(0xE)) ^ S6B(NMT(0xF)) ^ S7B(NMT(0x1)) ^ S8B(NMT(0x0)) ^ S8B(XMT(3)); klo[offset * 2 + 1] |= t << 4; h |= t & 0x10; h >>= 1; #ifdef DEBUG cli_putstr("\r\n\t h="); cli_hexdump(&h,1); #endif khi[offset >> 1] |= h << ((offset & 0x1) ? 4 : 0); } #define S_5X(s) pgm_read_dword(&s5[BPX[(s)]]) #define S_6X(s) pgm_read_dword(&s6[BPX[(s)]]) #define S_7X(s) pgm_read_dword(&s7[BPX[(s)]]) #define S_8X(s) pgm_read_dword(&s8[BPX[(s)]]) #define S_5Z(s) pgm_read_dword(&s5[BPZ[(s)]]) #define S_6Z(s) pgm_read_dword(&s6[BPZ[(s)]]) #define S_7Z(s) pgm_read_dword(&s7[BPZ[(s)]]) #define S_8Z(s) pgm_read_dword(&s8[BPZ[(s)]]) void cast5_init(const void *key, uint16_t keylength_b, cast5_ctx_t *s) { /* we migth return if the key is valid and if setup was successful */ uint32_t x[4], z[4]; #define BPX ((uint8_t*)&(x[0])) #define BPZ ((uint8_t*)&(z[0])) s->shortkey = (keylength_b <= 80); /* littel endian only! */ memset(&(x[0]), 0, 16); /* set x to zero */ if (keylength_b > 128) keylength_b = 128; memcpy(&(x[0]), key, (keylength_b + 7) / 8); /* todo: merge a and b and compress the whole stuff */ /***** A *****/ cast5_init_A((uint8_t*) (&z[0]), (uint8_t*) (&x[0]), false); /***** M *****/ cast5_init_M((uint8_t*) (&(s->mask[0])), (uint8_t*) (&z[0]), false, false); /***** B *****/ cast5_init_A((uint8_t*) (&x[0]), (uint8_t*) (&z[0]), true); /***** N *****/ cast5_init_M((uint8_t*) (&(s->mask[4])), (uint8_t*) (&x[0]), true, false); /***** A *****/ cast5_init_A((uint8_t*) (&z[0]), (uint8_t*) (&x[0]), false); /***** N' *****/ cast5_init_M((uint8_t*) (&(s->mask[8])), (uint8_t*) (&z[0]), true, true); /***** B *****/ cast5_init_A((uint8_t*) (&x[0]), (uint8_t*) (&z[0]), true); /***** M' *****/ cast5_init_M((uint8_t*) (&(s->mask[12])), (uint8_t*) (&x[0]), false, true); /* that were the masking keys, now the rotation keys */ /* set the keys to zero */ memset(&(s->rotl[0]), 0, 8); s->roth[0] = s->roth[1] = 0; /***** A *****/ cast5_init_A((uint8_t*) (&z[0]), (uint8_t*) (&x[0]), false); /***** M *****/ cast5_init_rM(&(s->rotl[0]), &(s->roth[0]), 0, (uint8_t*) (&z[0]), false, false); /***** B *****/ cast5_init_A((uint8_t*) (&x[0]), (uint8_t*) (&z[0]), true); /***** N *****/ cast5_init_rM(&(s->rotl[0]), &(s->roth[0]), 1, (uint8_t*) (&x[0]), true, false); /***** A *****/ cast5_init_A((uint8_t*) (&z[0]), (uint8_t*) (&x[0]), false); /***** N' *****/ cast5_init_rM(&(s->rotl[0]), &(s->roth[0]), 2, (uint8_t*) (&z[0]), true, true); /***** B *****/ cast5_init_A((uint8_t*) (&x[0]), (uint8_t*) (&z[0]), true); /***** M' *****/ cast5_init_rM(&(s->rotl[0]), &(s->roth[0]), 3, (uint8_t*) (&x[0]), false, true); /* done ;-) */ } /********************************************************************************************************/ #define ROTL32(a,n) ((a)<<(n) | (a)>>(32-(n))) #define CHANGE_ENDIAN32(x) ((x)<<24 | (x)>>24 | ((x)&0xff00)<<8 | ((x)&0xff0000)>>8 ) typedef uint32_t cast5_f_t(uint32_t, uint32_t, uint8_t); #define IA 3 #define IB 2 #define IC 1 #define ID 0 static uint32_t cast5_f1(uint32_t d, uint32_t m, uint8_t r) { uint32_t t; t = ROTL32((d + m), r); #ifdef DEBUG uint32_t ia,ib,ic,id; cli_putstr("\r\n f1("); cli_hexdump(&d, 4); cli_putc(','); cli_hexdump(&m , 4); cli_putc(','); cli_hexdump(&r, 1);cli_putstr("): I="); cli_hexdump(&t, 4); ia = pgm_read_dword(&s1[((uint8_t*)&t)[IA]] ); ib = pgm_read_dword(&s2[((uint8_t*)&t)[IB]] ); ic = pgm_read_dword(&s3[((uint8_t*)&t)[IC]] ); id = pgm_read_dword(&s4[((uint8_t*)&t)[ID]] ); cli_putstr("\r\n\tIA="); cli_hexdump(&ia, 4); cli_putstr("\r\n\tIB="); cli_hexdump(&ib, 4); cli_putstr("\r\n\tIC="); cli_hexdump(&ic, 4); cli_putstr("\r\n\tID="); cli_hexdump(&id, 4); return (((ia ^ ib) - ic) + id); #else return ((( pgm_read_dword(&s1[((uint8_t*)&t)[IA]]) ^ pgm_read_dword(&s2[((uint8_t*)&t)[IB]])) - pgm_read_dword(&s3[((uint8_t*)&t)[IC]])) + pgm_read_dword(&s4[((uint8_t*)&t)[ID]])); #endif } static uint32_t cast5_f2(uint32_t d, uint32_t m, uint8_t r) { uint32_t t; t = ROTL32((d ^ m), r); #ifdef DEBUG uint32_t ia,ib,ic,id; cli_putstr("\r\n f2("); cli_hexdump(&d, 4); cli_putc(','); cli_hexdump(&m , 4); cli_putc(','); cli_hexdump(&r, 1);cli_putstr("): I="); cli_hexdump(&t, 4); ia = pgm_read_dword(&s1[((uint8_t*)&t)[IA]] ); ib = pgm_read_dword(&s2[((uint8_t*)&t)[IB]] ); ic = pgm_read_dword(&s3[((uint8_t*)&t)[IC]] ); id = pgm_read_dword(&s4[((uint8_t*)&t)[ID]] ); cli_putstr("\r\n\tIA="); cli_hexdump(&ia, 4); cli_putstr("\r\n\tIB="); cli_hexdump(&ib, 4); cli_putstr("\r\n\tIC="); cli_hexdump(&ic, 4); cli_putstr("\r\n\tID="); cli_hexdump(&id, 4); return (((ia - ib) + ic) ^ id); #else return ((( pgm_read_dword(&s1[((uint8_t*)&t)[IA]]) - pgm_read_dword(&s2[((uint8_t*)&t)[IB]])) + pgm_read_dword(&s3[((uint8_t*)&t)[IC]])) ^ pgm_read_dword(&s4[((uint8_t*)&t)[ID]])); #endif } static uint32_t cast5_f3(uint32_t d, uint32_t m, uint8_t r) { uint32_t t; t = ROTL32((m - d), r); #ifdef DEBUG uint32_t ia,ib,ic,id; cli_putstr("\r\n f3("); cli_hexdump(&d, 4); cli_putc(','); cli_hexdump(&m , 4); cli_putc(','); cli_hexdump(&r, 1);cli_putstr("): I="); cli_hexdump(&t, 4); ia = pgm_read_dword(&s1[((uint8_t*)&t)[IA]] ); ib = pgm_read_dword(&s2[((uint8_t*)&t)[IB]] ); ic = pgm_read_dword(&s3[((uint8_t*)&t)[IC]] ); id = pgm_read_dword(&s4[((uint8_t*)&t)[ID]] ); cli_putstr("\r\n\tIA="); cli_hexdump(&ia, 4); cli_putstr("\r\n\tIB="); cli_hexdump(&ib, 4); cli_putstr("\r\n\tIC="); cli_hexdump(&ic, 4); cli_putstr("\r\n\tID="); cli_hexdump(&id, 4); return (((ia + ib) ^ ic) - id); #else return (( pgm_read_dword(&s1[((uint8_t*)&t)[IA]] ) + pgm_read_dword(&s2[((uint8_t*)&t)[IB]])) ^ pgm_read_dword(&s3[((uint8_t*)&t)[IC]])) - pgm_read_dword(&s4[((uint8_t*)&t)[ID]]); #endif } /******************************************************************************/ void cast5_enc(void *block, const cast5_ctx_t *s) { uint32_t l, r, x, y; uint8_t i; cast5_f_t *f[] = { cast5_f1, cast5_f2, cast5_f3 }; l = ((uint32_t*) block)[0]; r = ((uint32_t*) block)[1]; // cli_putstr("\r\n round[-1] = "); // cli_hexdump(&r, 4); for (i = 0; i < (s->shortkey ? 12 : 16); ++i) { x = r; y = (f[i % 3])(CHANGE_ENDIAN32(r), CHANGE_ENDIAN32(s->mask[i]), (((s->roth[i >> 3]) & (1 << (i & 0x7))) ? 0x10 : 0x00) + (((s->rotl[i >> 1]) >> ((i & 1) ? 4 : 0)) & 0x0f)); r = l ^ CHANGE_ENDIAN32(y); // cli_putstr("\r\n round["); DEBUG_B(i); cli_putstr("] = "); // cli_hexdump(&r, 4); l = x; } ((uint32_t*) block)[0] = r; ((uint32_t*) block)[1] = l; } /******************************************************************************/ void cast5_dec(void *block, const cast5_ctx_t *s) { uint32_t l, r, x, y; int8_t i, rounds; cast5_f_t *f[] = { cast5_f1, cast5_f2, cast5_f3 }; l = ((uint32_t*) block)[0]; r = ((uint32_t*) block)[1]; rounds = (s->shortkey ? 12 : 16); for (i = rounds - 1; i >= 0; --i) { x = r; y = (f[i % 3])(CHANGE_ENDIAN32(r), CHANGE_ENDIAN32(s->mask[i]), (((s->roth[i >> 3]) & (1 << (i & 0x7))) ? 0x10 : 0x00) + (((s->rotl[i >> 1]) >> ((i & 1) ? 4 : 0)) & 0x0f)); r = l ^ CHANGE_ENDIAN32(y); l = x; } ((uint32_t*) block)[0] = r; ((uint32_t*) block)[1] = l; } /******************************************************************************/
Java
package org.webbuilder.web.service.script; import org.springframework.stereotype.Service; import org.webbuilder.utils.script.engine.DynamicScriptEngine; import org.webbuilder.utils.script.engine.DynamicScriptEngineFactory; import org.webbuilder.utils.script.engine.ExecuteResult; import org.webbuilder.web.po.script.DynamicScript; import javax.annotation.Resource; import java.util.Map; /** * Created by 浩 on 2015-10-29 0029. */ @Service public class DynamicScriptExecutor { @Resource private DynamicScriptService dynamicScriptService; public ExecuteResult exec(String id, Map<String, Object> param) throws Exception { DynamicScript data = dynamicScriptService.selectByPk(id); if (data == null) { ExecuteResult result = new ExecuteResult(); result.setResult(String.format("script %s not found!", id)); result.setSuccess(false); return result; } DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine(data.getType()); return engine.execute(id, param); } }
Java
-- TESTS (1-17 non-calendar time) {- NTest[(* 5 *) b = N[DiscountFactor[1, 9 + 28/100, Compounding -> {Linear, 1}, CompiledDF -> True], 50] , 0.9150805270863837 ] ## HQL discountFactor (InterestRate (Periodic 1) (9+28/100 :: Double)) 1.00 0.0 == 0.9150805270863837 -} {- NTest[(* 7 *) DiscountFactor[1.5, termstructure1, Compounding -> {Linear, 2}] , 0.9203271932613013 ] ## HQL (using term structure) > let termStructure x = 5 + (1/2)*sqrt(x) > let r = (termStructure 1.5) > discountFactor (InterestRate (Periodic 2) r) 1.50 0.0 == 0.9203271932613013 -- refined version -} {- NTest[(* 8 *) DiscountFactor[1.5, termstructure1, Compounding -> {Linear, 2}, CompiledDF -> True] , 0.9203271932613013 ] ## HQL > discountFactor (InterestRate (Periodic 2) (termStructure 1.5)) 1.5 0.0 == 0.9203271932613013 -} {- NTest[(* 9 *) DiscountFactor[3, 8.5, Compounding -> {Exponential, 12}] , 0.7756133702070986 ] ## HQL > discountFactor (InterestRate (Periodic 12) 8.5) 3.0 0.0 == 0.7756133702070988 -} {- NTest[(* 10 *) DiscountFactor[3, 8.5, Compounding -> {Exponential, 12}, CompiledDF -> True] , 0.7756133702070988 ] ## HQL > discountFactor (InterestRate (Periodic 12) 8.5) 3.0 0.0 == 0.7756133702070988 -} {- NTest[(* 16 *) DiscountFactor[1/2, 8.3, Compounding -> Continuous, CompiledDF -> True] , 0.9593493353414723 ] ## HQL > discountFactor (InterestRate Continuous 8.3) 0.5 0 == 0.9593493353414723 -} {- NTest[(* 11 *) DiscountFactor[4.5, termstructure1, Compounding -> {Exponential, 2}] , 0.7643885607510086 ] ## HQL > let termStructure x = 5 + (1/2)*sqrt(x) > let r = (termStructure 4.5) > discountFactor (InterestRate (Periodic 2) r) 4.50 0.0 == 0.7643885607510086 -} {- NTest[(* 12 *) DiscountFactor[4.5, termstructure1, Compounding -> {Exponential, 2}, CompiledDF -> True] , 0.7643885607510086 ] ## HQL > discountFactor (InterestRate (Periodic 2) (termStructure 4.5)) 4.5 0.0 == 0.7643885607510086 -} {- NTest[(* 13 *) DiscountFactor[1/2, 8.5, Compounding -> {LinearExponential, 1}] , 0.9592326139088729 ] ## HQL (convert periodic to continous) > discountFactor (InterestRate (Periodic 2) 8.5) 0.5 0.0 == 0.9592326139088729 -} {- NTest[(* 14 *) DiscountFactor[1/2, 8.5, Compounding -> {LinearExponential, 1}, CompiledDF -> True] , 0.9592326139088729 ] ## HQL > discountFactor (InterestRate (Periodic 2) 8.5) 0.5 0.0 == 0.9592326139088729 -} {- NTest[(* 15 *) DiscountFactor[1/2, 8.3, Compounding -> Continuous] , 0.9593493353414723 ] ## HQL > discountFactor (InterestRate Continuous 8.3) 0.5 0.0 == 0.9593493353414723 -} {- NTest[(* 16 *) DiscountFactor[1/2, 8.3, Compounding -> Continuous, CompiledDF -> True] , 0.9593493353414723 ] ## HQL > discountFactor (InterestRate Continuous 8.3) 0.5 0.0 == 0.9593493353414723 -} {- NTest[(* 17 *) N[DiscountFactor[90/360, termstructure1, Compounding -> Continuous]] , 0.9871663954590084 ] ## HQL > discountFactor (InterestRate Continuous (termStructure (90/360 :: Double))) (90/360 :: Double) 0.0 == 0.9869607572146836 -} ---- FORWARD RATE {- n = 2; theta1 = 0.25; theta2 = 1.5; interest1 = 6.65; interest2 = 7.77; Out[8]= 7.99473 ## HQL > (((discountFactor (InterestRate (Periodic 2) 6.65) 0.25 0.0)/(discountFactor (InterestRate (Periodic 2) 7.77) 1.5))**(1/(2*1.25))-1)*2*100 == 7.994727369824384 -} -- Include in tests error: abs(output - expected) / expected -- Create a new discount factor from input, where several -- ways are supported. Create DiscountFactor from: -- 1) InterestRate -- 2) TermStructure (yield curve) -- 3) Forward rates (has to be two) {- newDF :: InterestRate -> DiscountFactor Create discount factor (ie zero bond) - Interest rate (as percentage) - Time to maturity - Linear, Exponential, Continous => Periodic, Continuous -}
Java
/* * Copyright (C) 2013-2016 52°North Initiative for Geospatial Open Source * Software GmbH * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. * * If the program is linked with libraries which are licensed under one of * the following licenses, the combination of the program with the linked * library is not considered a "derivative work" of the program: * * - Apache License, version 2.0 * - Apache Software License, version 1.0 * - GNU Lesser General Public License, version 3 * - Mozilla Public License, versions 1.0, 1.1 and 2.0 * - Common Development and Distribution License (CDDL), version 1.0 * * Therefore the distribution of the program linked with libraries licensed * under the aforementioned licenses, is permitted by the copyright holders * if the distribution is compliant with both the GNU General Public License * version 2 and the aforementioned licenses. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ package org.n52.io.measurement.img; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import java.util.Date; import org.joda.time.DateTime; import org.joda.time.format.ISODateTimeFormat; import org.junit.Before; import org.junit.Test; import org.n52.io.IoStyleContext; import org.n52.io.MimeType; import org.n52.io.request.RequestSimpleParameterSet; import org.n52.io.response.dataset.DataCollection; import org.n52.io.response.dataset.measurement.MeasurementData; public class ChartRendererTest { private static final String VALID_ISO8601_RELATIVE_START = "PT6H/2013-08-13TZ"; private static final String VALID_ISO8601_ABSOLUTE_START = "2013-07-13TZ/2013-08-13TZ"; private static final String VALID_ISO8601_DAYLIGHT_SAVING_SWITCH = "2013-10-28T02:00:00+02:00/2013-10-28T02:00:00+01:00"; private MyChartRenderer chartRenderer; @Before public void setUp() { this.chartRenderer = new MyChartRenderer(IoStyleContext.createEmpty()); } @Test public void shouldParseBeginFromIso8601PeriodWithRelativeStart() { Date start = chartRenderer.getStartTime(VALID_ISO8601_RELATIVE_START); assertThat(start, is(DateTime.parse("2013-08-13TZ").minusHours(6).toDate())); } @Test public void shouldParseBeginFromIso8601PeriodWithAbsoluteStart() { Date start = chartRenderer.getStartTime(VALID_ISO8601_ABSOLUTE_START); assertThat(start, is(DateTime.parse("2013-08-13TZ").minusMonths(1).toDate())); } @Test public void shouldParseBeginAndEndFromIso8601PeriodContainingDaylightSavingTimezoneSwith() { Date start = chartRenderer.getStartTime(VALID_ISO8601_DAYLIGHT_SAVING_SWITCH); Date end = chartRenderer.getEndTime(VALID_ISO8601_DAYLIGHT_SAVING_SWITCH); assertThat(start, is(DateTime.parse("2013-10-28T00:00:00Z").toDate())); assertThat(end, is(DateTime.parse("2013-10-28T01:00:00Z").toDate())); } @Test public void shouldHaveCETTimezoneIncludedInDomainAxisLabel() { IoStyleContext context = IoStyleContext.createEmpty(); context.getChartStyleDefinitions().setTimespan(VALID_ISO8601_DAYLIGHT_SAVING_SWITCH); this.chartRenderer = new MyChartRenderer(context); String label = chartRenderer.getXYPlot().getDomainAxis().getLabel(); assertThat(label, is("Time (+01:00)")); } @Test public void shouldHandleEmptyTimespanWhenIncludingTimezoneInDomainAxisLabel() { IoStyleContext context = IoStyleContext.createEmpty(); context.getChartStyleDefinitions().setTimespan(null); this.chartRenderer = new MyChartRenderer(context); String label = chartRenderer.getXYPlot().getDomainAxis().getLabel(); //assertThat(label, is("Time (+01:00)")); } @Test public void shouldHaveUTCTimezoneIncludedInDomainAxisLabel() { IoStyleContext context = IoStyleContext.createEmpty(); context.getChartStyleDefinitions().setTimespan(VALID_ISO8601_ABSOLUTE_START); this.chartRenderer = new MyChartRenderer(context); String label = chartRenderer.getXYPlot().getDomainAxis().getLabel(); ISODateTimeFormat.dateTimeParser().withOffsetParsed().parseDateTime(VALID_ISO8601_ABSOLUTE_START.split("/")[1]); assertThat(label, is("Time (UTC)")); } static class MyChartRenderer extends ChartIoHandler { public MyChartRenderer(IoStyleContext context) { super(new RequestSimpleParameterSet(), null, context); } public MyChartRenderer() { super(new RequestSimpleParameterSet(), null, null); } @Override public void setMimeType(MimeType mimetype) { throw new UnsupportedOperationException(); } @Override public void writeDataToChart(DataCollection<MeasurementData> data) { throw new UnsupportedOperationException(); } } }
Java
<?php class highlighter { public function register_shortcode($shortcodeName) { function shortcode_highlighter($atts, $content = null) { extract( shortcode_atts( array( 'type' => 'colored' ), $atts ) ); return "<span class='highlighted_".$type."'>".$content."</span>"; } add_shortcode($shortcodeName, 'shortcode_highlighter'); } } #Shortcode name $shortcodeName="highlighter"; #Compile UI for admin panel #Don't change this line $gt3_compileShortcodeUI = "<div class='whatInsert whatInsert_".$shortcodeName."'>".$gt3_defaultUI."</div>"; #This function is executed each time when you click "Insert" shortcode button. $gt3_compileShortcodeUI .= " <table> <tr> <td>Type:</td> <td> <select name='".$shortcodeName."_separator_type' class='".$shortcodeName."_type'>"; if (is_array($GLOBALS["pbconfig"]['all_available_highlighters'])) { foreach ($GLOBALS["pbconfig"]['all_available_highlighters'] as $value => $caption) { $gt3_compileShortcodeUI .= "<option value='".$value."'>".$caption."</option>"; } } $gt3_compileShortcodeUI .= "</select> </td> </tr> </table> <script> function ".$shortcodeName."_handler() { /* YOUR CODE HERE */ var type = jQuery('.".$shortcodeName."_type').val(); /* END YOUR CODE */ /* COMPILE SHORTCODE LINE */ var compileline = '[".$shortcodeName." type=\"'+type+'\"][/".$shortcodeName."]'; /* DO NOT CHANGE THIS LINE */ jQuery('.whatInsert_".$shortcodeName."').html(compileline); } </script> "; #Register shortcode & set parameters $highlighter = new highlighter(); $highlighter->register_shortcode($shortcodeName); shortcodesUI::getInstance()->add('highlighter', array("name" => $shortcodeName, "caption" => "Highlighter", "handler" => $gt3_compileShortcodeUI)); unset($gt3_compileShortcodeUI); ?>
Java
/********************************************************************************************* * Fichero: Bmp.c * Autor: * Descrip: Funciones de control y visualizacion del LCD * Version: *********************************************************************************************/ /*--- Archivos cabecera ---*/ #include "bmp.h" #include "def.h" #include "lcd.h" /*--- variables globales ---*/ /* mapa de bits del cursor del raton */ const INT8U ucMouseMap[] = { BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, WHITE, WHITE, BLACK, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, BLACK, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, BLACK, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, WHITE, WHITE, WHITE, BLACK, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, TRANSPARENCY, BLACK, BLACK, BLACK, TRANSPARENCY, TRANSPARENCY }; STRU_BITMAP Stru_Bitmap_gbMouse = {0x10, 4, 12, 20, TRANSPARENCY, (INT8U *)ucMouseMap}; INT16U ulMouseX; INT16U ulMouseY; INT8U ucCursorBackUp[20][12/2]; /*--- codigo de funcion ---*/ /********************************************************************************************* * name: BitmapView() * func: display bitmap * para: x,y -- pot's X-Y coordinate * Stru_Bitmap -- bitmap struct * ret: none * modify: * comment: *********************************************************************************************/ void BitmapView (INT16U x, INT16U y, STRU_BITMAP Stru_Bitmap) { INT32U i, j; INT8U ucColor; for (i = 0; i < Stru_Bitmap.usHeight; i++) { for (j = 0; j <Stru_Bitmap.usWidth; j++) { if ((ucColor = *(INT8U*)(Stru_Bitmap.pucStart + i * Stru_Bitmap.usWidth + j)) != TRANSPARENCY) { LCD_PutPixel(x + j, y + i, ucColor); } } } } /********************************************************************************************* * name: BitmapPush() * func: push bitmap data into LCD active buffer * para: x,y -- pot's X-Y coordinate * Stru_Bitmap -- bitmap struct * ret: none * modify: * comment: *********************************************************************************************/ void BitmapPush (INT16U x, INT16U y, STRU_BITMAP Stru_Bitmap) { INT32U i, j; ulMouseX = x; ulMouseY = y; for (i = 0; i < Stru_Bitmap.usHeight; i++) { for (j = 0; j < Stru_Bitmap.usWidth; j+=2) { if ((x + j)%2) { ucCursorBackUp[i][j/2] = (((*(INT8U*)(LCD_ACTIVE_BUFFER + (y + i) * SCR_XSIZE / 2 + (x + j) / 8 * 4 + 3 - ((x + j)%8) / 2)) << 4) & 0xf0) + (((*(INT8U*)(LCD_ACTIVE_BUFFER + (y + i) * SCR_XSIZE / 2 + (x + j+1) / 8 * 4 + 3 - ((x + j+1)%8) / 2)) >> 4) & 0x0f); } else { ucCursorBackUp[i][j/2] = (*(INT8U*)(LCD_ACTIVE_BUFFER + (y + i) * SCR_XSIZE / 2 + (x + j) / 8 * 4 + 3 - ((x + j)%8) / 2)); } } } } /********************************************************************************************* * name: BitmapPop() * func: pop bitmap data into LCD active buffer * para: x,y -- pot's X-Y coordinate * Stru_Bitmap -- bitmap struct * ret: none * modify: * comment: *********************************************************************************************/ void BitmapPop(INT16U x, INT16U y, STRU_BITMAP Stru_Bitmap) { INT32U i, j; INT32U ulAddr, ulAddr1; for (i = 0; i < Stru_Bitmap.usHeight; i++) { for (j = 0; j <Stru_Bitmap.usWidth; j+=2) { ulAddr = LCD_ACTIVE_BUFFER + (y + i) * SCR_XSIZE / 2 + (x + j) / 8 * 4 + 3 - ((x + j)%8) / 2; ulAddr1 =LCD_ACTIVE_BUFFER + (y + i) * SCR_XSIZE / 2 + (x + j + 1) / 8 * 4 + 3 - ((x + j + 1)%8) / 2; if ((x + j)%2) { (*(INT8U*)ulAddr) &= 0xf0; (*(INT8U*)ulAddr) |= ((ucCursorBackUp[i][j/2] >> 4) & 0x0f); (*(INT8U*)ulAddr1) &= 0x0f; (*(INT8U*)ulAddr1) |= ((ucCursorBackUp[i][j/2] << 4) & 0xf0); } else { (*(INT8U*)ulAddr) = ucCursorBackUp[i][j/2]; } } } } /********************************************************************************************* * name: CursorInit() * func: cursor init * para: none * ret: none * modify: * comment: *********************************************************************************************/ void CursorInit(void) { ulMouseX = 0; ulMouseY = 0; CursorView(ulMouseX, ulMouseY); } /********************************************************************************************* * name: CursorPush() * func: cursor push * para: none * ret: none * modify: * comment: *********************************************************************************************/ void CursorPush(INT16U x, INT16U y) { BitmapPush(x, y, Stru_Bitmap_gbMouse); } /********************************************************************************************* * name: CursorPop() * func: cursor pop * para: none * ret: none * modify: * comment: *********************************************************************************************/ void CursorPop() { BitmapPop(ulMouseX, ulMouseY, Stru_Bitmap_gbMouse); } /********************************************************************************************* * name: CursorView() * func: cursor display * para: none * ret: none * modify: * comment: *********************************************************************************************/ void CursorView(INT16U x, INT16U y) { CursorPush(x, y); BitmapView(x, y, Stru_Bitmap_gbMouse); }
Java
// CS4005: Async methods cannot have unsafe parameters // Line: 7 // Compiler options: -unsafe class C { public unsafe async void Test (int* arg) { } }
Java
<html> <head> <script> window.onload = function() { var d = new Date().getTime(); document.getElementById("tid").value = d; }; </script> </head> <body> <?php if(isset($_GET['token'])) { $token = $_GET['token']; $name = $_GET['name']; $token = $_GET['token']; $token1 = substr($token,6); $email = $_GET['email']; $quantity = (int)1; $currency = $_GET['curr']; $fees = $_GET['fees']; $server = 'http://'.$_SERVER['SERVER_NAME']; ?> <form method="post" id="customerData" name="customerData" action="ccavRequestHandler.php"> <input type="text" name="tid" id="tid" readonly /> <input type="text" name="merchant_id" value="79450"/> <input type="text" name="order_id" value="<?php echo trim($token1); ?>"/> <input type="text" name="amount" value="<?php echo trim($fees); ?>"/> <input type="text" name="currency" value="<?php echo trim($currency); ?>"/> <input type="text" name="redirect_url" value="<?php echo $server.'/ccavenue/nonseam/ccavResponseHandler.php' ?>"/> <input type="text" name="cancel_url" value="<?php echo $server.'/ccavenue/nonseam/ccavResponseHandler.php?payment=fail' ?>"/> <input type="text" name="language" value="EN"/> <input type="text" name="billing_name" value="<?php echo trim($name); ?>"/> <input type="text" name="billing_email" value="<?php echo trim($email); ?>"/> <input type="text" name="billing_address" value="Dummy Address. Please ignore details."/> <input type="text" name="billing_city" value="Ignore City"/> <input type="text" name="billing_state" value="Ignore State"/> <input type="text" name="billing_country" value="India"/> <input type="text" name="billing_zip" value="123456"/> <input type="text" name="billing_tel" value="1234567891"/> <input type="submit" value="CheckOut" /> <?php } ?> </form> <script language='javascript'>document.customerData.submit();</script> </body> </html>
Java
/* * USI wm-bn-bm-01-5(bcm4329) sdio wifi power management API * evb gpio define * A10 gpio define: * usi_bm01a_wl_pwr = port:PH12<1><default><default><0> * usi_bm01a_wlbt_regon = port:PI11<1><default><default><0> * usi_bm01a_wl_rst = port:PI10<1><default><default><0> * usi_bm01a_wl_wake = port:PI12<1><default><default><0> * usi_bm01a_bt_rst = port:PB05<1><default><default><0> * usi_bm01a_bt_wake = port:PI20<1><default><default><0> * usi_bm01a_bt_hostwake = port:PI21<0><default><default><0> * ----------------------------------------------------------- * A12 gpio define: * usi_bm01a_wl_pwr = LDO3 * usi_bm01a_wl_wake = port:PA01<1><default><default><0> * usi_bm01a_wlbt_regon = port:PA02<1><default><default><0> * usi_bm01a_wl_rst = port:PA03<1><default><default><0> * usi_bm01a_bt_rst = port:PA04<1><default><default><0> * usi_bm01a_bt_wake = port:PA05<1><default><default><0> * usi_bm01a_bt_hostwake = */ #include <linux/kernel.h> #include <linux/module.h> #include <mach/sys_config.h> #include "mmc_pm.h" #define usi_msg(...) do {printk("[usi_bm01a]: "__VA_ARGS__);} while(0) static int usi_bm01a_wl_on = 0; static int usi_bm01a_bt_on = 0; #if CONFIG_CHIP_ID==1125 #include <linux/regulator/consumer.h> static int usi_bm01a_power_onoff(int onoff) { struct regulator* wifi_ldo = NULL; static int first = 1; #ifndef CONFIG_AW_AXP usi_msg("AXP driver is disabled, pls check !!\n"); return 0; #endif usi_msg("usi_bm01a_power_onoff\n"); wifi_ldo = regulator_get(NULL, "axp20_pll"); if (!wifi_ldo) usi_msg("Get power regulator failed\n"); if (first) { usi_msg("first time\n"); regulator_force_disable(wifi_ldo); first = 0; } if (onoff) { usi_msg("regulator on\n"); regulator_set_voltage(wifi_ldo, 3300000, 3300000); regulator_enable(wifi_ldo); } else { usi_msg("regulator off\n"); regulator_disable(wifi_ldo); } return 0; } #endif static int usi_bm01a_gpio_ctrl(char* name, int level) { struct mmc_pm_ops *ops = &mmc_card_pm_ops; char* gpio_cmd[6] = {"usi_bm01a_wl_regon", "usi_bm01a_bt_regon", "usi_bm01a_wl_rst", "usi_bm01a_wl_wake", "usi_bm01a_bt_rst", "usi_bm01a_bt_wake"}; int i = 0; int ret = 0; for (i=0; i<6; i++) { if (strcmp(name, gpio_cmd[i])==0) break; } if (i==6) { usi_msg("No gpio %s for USI-BM01A module\n", name); return -1; } // usi_msg("Set GPIO %s to %d !\n", name, level); if (strcmp(name, "usi_bm01a_wl_regon") == 0) { if (level) { if (usi_bm01a_bt_on) { usi_msg("USI-BM01A is already powered up by bluetooth\n"); goto change_state; } else { usi_msg("USI-BM01A is powered up by wifi\n"); goto power_change; } } else { if (usi_bm01a_bt_on) { usi_msg("USI-BM01A should stay on because of bluetooth\n"); goto change_state; } else { usi_msg("USI-BM01A is powered off by wifi\n"); goto power_change; } } } if (strcmp(name, "usi_bm01a_bt_regon") == 0) { if (level) { if (usi_bm01a_wl_on) { usi_msg("USI-BM01A is already powered up by wifi\n"); goto change_state; } else { usi_msg("USI-BM01A is powered up by bt\n"); goto power_change; } } else { if (usi_bm01a_wl_on) { usi_msg("USI-BM01A should stay on because of wifi\n"); goto change_state; } else { usi_msg("USI-BM01A is powered off by bt\n"); goto power_change; } } } ret = gpio_write_one_pin_value(ops->pio_hdle, level, name); if (ret) { usi_msg("Failed to set gpio %s to %d !\n", name, level); return -1; } return 0; power_change: #if CONFIG_CHIP_ID==1123 ret = gpio_write_one_pin_value(ops->pio_hdle, level, "usi_bm01a_wl_pwr"); #elif CONFIG_CHIP_ID==1125 ret = usi_bm01a_power_onoff(level); #else #error "Found wrong chip id in wifi onoff\n" #endif if (ret) { usi_msg("Failed to power off USI-BM01A module!\n"); return -1; } ret = gpio_write_one_pin_value(ops->pio_hdle, level, "usi_bm01a_wlbt_regon"); if (ret) { usi_msg("Failed to regon off for USI-BM01A module!\n"); return -1; } change_state: if (strcmp(name, "usi_bm01a_wl_regon")==0) usi_bm01a_wl_on = level; if (strcmp(name, "usi_bm01a_bt_regon")==0) usi_bm01a_bt_on = level; usi_msg("USI-BM01A power state change: wifi %d, bt %d !!\n", usi_bm01a_wl_on, usi_bm01a_bt_on); return 0; } static int usi_bm01a_get_gpio_value(char* name) { struct mmc_pm_ops *ops = &mmc_card_pm_ops; char* bt_hostwake = "usi_bm01a_bt_hostwake"; if (strcmp(name, bt_hostwake)) { usi_msg("No gpio %s for USI-BM01A\n", name); return -1; } return gpio_read_one_pin_value(ops->pio_hdle, name); } void usi_bm01a_gpio_init(void) { struct mmc_pm_ops *ops = &mmc_card_pm_ops; usi_bm01a_wl_on = 0; usi_bm01a_bt_on = 0; ops->gpio_ctrl = usi_bm01a_gpio_ctrl; ops->get_io_val = usi_bm01a_get_gpio_value; }
Java
<?php /** * jsonRPCClient.php * * Written using the JSON RPC specification - * http://json-rpc.org/wiki/specification * * @author Kacper Rowinski <krowinski@implix.com> * http://implix.com */ class jsonRPCClient { protected $url = null, $is_debug = false, $parameters_structure = 'array'; /** * Default options for curl * * @var array */ protected $curl_options = array( CURLOPT_CONNECTTIMEOUT => 8, CURLOPT_TIMEOUT => 8 ); /** * Http error statuses * * Source: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes * * @var array */ private $httpErrors = array( 400 => '400 Bad Request', 401 => '401 Unauthorized', 403 => '403 Forbidden', 404 => '404 Not Found', 405 => '405 Method Not Allowed', 406 => '406 Not Acceptable', 408 => '408 Request Timeout', 500 => '500 Internal Server Error', 502 => '502 Bad Gateway', 503 => '503 Service Unavailable' ); /** * Takes the connection parameter and checks for extentions * * @param string $pUrl - url name like http://example.com/ */ public function __construct($pUrl) { $this->validate(false === extension_loaded('curl'), 'The curl extension must be loaded for using this class!'); $this->validate(false === extension_loaded('json'), 'The json extension must be loaded for using this class!'); // set an url to connect to $this->url = $pUrl; } /** * Return http error message * * @param $pErrorNumber * * @return string|null */ private function getHttpErrorMessage($pErrorNumber) { return isset($this->httpErrors[$pErrorNumber]) ? $this->httpErrors[$pErrorNumber] : null; } /** * Set debug mode * * @param boolean $pIsDebug * * @return jsonRPCClient */ public function setDebug($pIsDebug) { $this->is_debug = !empty($pIsDebug); return $this; } /** * Set structure to use for parameters * * @param string $pParametersStructure 'array' or 'object' * * @throws UnexpectedValueException * @return jsonRPCClient */ public function setParametersStructure($pParametersStructure) { if (in_array($pParametersStructure, array('array', 'object'))) { $this->parameters_structure = $pParametersStructure; } else { throw new UnexpectedValueException('Invalid parameters structure type.'); } return $this; } /** * Set extra options for curl connection * * @param array $pOptionsArray * * @throws InvalidArgumentException * @return jsonRPCClient */ public function setCurlOptions($pOptionsArray) { if (is_array($pOptionsArray)) { $this->curl_options = $pOptionsArray + $this->curl_options; } else { throw new InvalidArgumentException('Invalid options type.'); } return $this; } /** * Performs a request and gets the results * * @param string $pMethod - A String containing the name of the method to be invoked. * @param array $pParams - An Array of objects to pass as arguments to the method. * * @throws RuntimeException * @return array */ public function __call($pMethod, $pParams) { static $requestId = 0; // generating uniuqe id per process $requestId++; // check if given params are correct $this->validate(false === is_scalar($pMethod), 'Method name has no scalar value'); $this->validate(false === is_array($pParams), 'Params must be given as array'); // send params as an object or an array $pParams = ($this->parameters_structure == 'object') ? $pParams[0] : array_values($pParams); // Request (method invocation) $request = json_encode(array('jsonrpc' => '2.0', 'method' => $pMethod, 'params' => $pParams, 'id' => $requestId)); // if is_debug mode is true then add url and request to is_debug $this->debug('Url: ' . $this->url . "\r\n", false); $this->debug('Request: ' . $request . "\r\n", false); $responseMessage = $this->getResponse($request); // if is_debug mode is true then add response to is_debug and display it $this->debug('Response: ' . $responseMessage . "\r\n", true); // decode and create array ( can be object, just set to false ) $responseDecoded = json_decode($responseMessage, true); // check if decoding json generated any errors $jsonErrorMsg = $this->getJsonLastErrorMsg(); $this->validate( !is_null($jsonErrorMsg), $jsonErrorMsg . ': ' . $responseMessage); // check if response is correct $this->validate(empty($responseDecoded['id']), 'Invalid response data structure: ' . $responseMessage); $this->validate($responseDecoded['id'] != $requestId, 'Request id: ' . $requestId . ' is different from Response id: ' . $responseDecoded['id']); if (isset($responseDecoded['error'])) { $errorMessage = 'Request have return error: ' . $responseDecoded['error']['message'] . '; ' . "\n" . 'Request: ' . $request . '; '; if (isset($responseDecoded['error']['data'])) { $errorMessage .= "\n" . 'Error data: ' . $responseDecoded['error']['data']; } $this->validate( !is_null($responseDecoded['error']), $errorMessage); } return $responseDecoded['result']; } /** * When the method invocation completes, the service must reply with a response. * The response is a single object serialized using JSON * * @param string $pRequest * * @throws RuntimeException * @return string */ protected function & getResponse(&$pRequest) { // do the actual connection $ch = curl_init(); if ( !$ch) { throw new RuntimeException('Could\'t initialize a cURL session'); } curl_setopt($ch, CURLOPT_URL, $this->url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $pRequest); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if ( !curl_setopt_array($ch, $this->curl_options)) { throw new RuntimeException('Error while setting curl options'); } // send the request $response = curl_exec($ch); // check http status code $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (isset($this->httpErrors[$httpCode])) { throw new RuntimeException('Response Http Error - ' . $this->httpErrors[$httpCode]); } // check for curl error if (0 < curl_errno($ch)) { throw new RuntimeException('Unable to connect to '.$this->url . ' Error: ' . curl_error($ch)); } // close the connection curl_close($ch); return $response; } /** * Throws exception if validation is failed * * @param bool $pFailed * @param string $pErrMsg * * @throws RuntimeException */ protected function validate($pFailed, $pErrMsg) { if ($pFailed) { throw new RuntimeException($pErrMsg); } } /** * For is_debug and performance stats * * @param string $pAdd * @param bool $pShow */ protected function debug($pAdd, $pShow = false) { static $debug, $startTime; // is_debug off return if (false === $this->is_debug) { return; } // add $debug .= $pAdd; // get starttime $startTime = empty($startTime) ? array_sum(explode(' ', microtime())) : $startTime; if (true === $pShow and !empty($debug)) { // get endtime $endTime = array_sum(explode(' ', microtime())); // performance summary $debug .= 'Request time: ' . round($endTime - $startTime, 3) . ' s Memory usage: ' . round(memory_get_usage() / 1024) . " kb\r\n"; echo nl2br($debug); // send output imidiately flush(); // clean static $debug = $startTime = null; } } /** * Getting JSON last error message * Function json_last_error_msg exists from PHP 5.5 * * @return string */ function getJsonLastErrorMsg() { if (!function_exists('json_last_error_msg')) { function json_last_error_msg() { static $errors = array( JSON_ERROR_NONE => 'No error', JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', JSON_ERROR_SYNTAX => 'Syntax error', JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded' ); $error = json_last_error(); return array_key_exists($error, $errors) ? $errors[$error] : 'Unknown error (' . $error . ')'; } } // Fix PHP 5.2 error caused by missing json_last_error function if (function_exists('json_last_error')) { return json_last_error() ? json_last_error_msg() : null; } else { return null; } } }
Java
/* * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.xml.internal.bind.v2.util; import java.util.AbstractList; import java.util.Arrays; import java.util.List; import java.util.Stack; /** * {@link Stack}-like data structure that allows the following efficient operations: * * <ol> * <li>Push/pop operation. * <li>Duplicate check. When an object that's already in the stack is pushed, * this class will tell you so. * </ol> * * <p> * Object equality is their identity equality. * * <p> * This class implements {@link List} for accessing items in the stack, * but {@link List} methods that alter the stack is not supported. * * @author Kohsuke Kawaguchi */ public final class CollisionCheckStack<E> extends AbstractList<E> { private Object[] data; private int[] next; private int size = 0; /** * True if the check shall be done by using the object identity. * False if the check shall be done with the equals method. */ private boolean useIdentity = true; // for our purpose, there isn't much point in resizing this as we don't expect // the stack to grow that much. private final int[] initialHash; public CollisionCheckStack() { initialHash = new int[17]; data = new Object[16]; next = new int[16]; } /** * Set to false to use {@link Object#equals(Object)} to detect cycles. * This method can be only used when the stack is empty. */ public void setUseIdentity(boolean useIdentity) { this.useIdentity = useIdentity; } public boolean getUseIdentity() { return useIdentity; } /** * Pushes a new object to the stack. * * @return * true if this object has already been pushed */ public boolean push(E o) { if(data.length==size) expandCapacity(); data[size] = o; int hash = hash(o); boolean r = findDuplicate(o, hash); next[size] = initialHash[hash]; initialHash[hash] = size+1; size++; return r; } /** * Pushes a new object to the stack without making it participate * with the collision check. */ public void pushNocheck(E o) { if(data.length==size) expandCapacity(); data[size] = o; next[size] = -1; size++; } @Override public E get(int index) { return (E)data[index]; } @Override public int size() { return size; } private int hash(Object o) { return ((useIdentity?System.identityHashCode(o):o.hashCode())&0x7FFFFFFF) % initialHash.length; } /** * Pops an object from the stack */ public E pop() { size--; Object o = data[size]; data[size] = null; // keeping references too long == memory leak int n = next[size]; if(n<0) { // pushed by nocheck. no need to update hash } else { int hash = hash(o); assert initialHash[hash]==size+1; initialHash[hash] = n; } return (E)o; } /** * Returns the top of the stack. */ public E peek() { return (E)data[size-1]; } private boolean findDuplicate(E o, int hash) { int p = initialHash[hash]; while(p!=0) { p--; Object existing = data[p]; if (useIdentity) { if(existing==o) return true; } else { if (o.equals(existing)) return true; } p = next[p]; } return false; } private void expandCapacity() { int oldSize = data.length; int newSize = oldSize * 2; Object[] d = new Object[newSize]; int[] n = new int[newSize]; System.arraycopy(data,0,d,0,oldSize); System.arraycopy(next,0,n,0,oldSize); data = d; next = n; } /** * Clears all the contents in the stack. */ public void reset() { if(size>0) { size = 0; Arrays.fill(initialHash,0); } } /** * String that represents the cycle. */ public String getCycleString() { StringBuilder sb = new StringBuilder(); int i=size()-1; E obj = get(i); sb.append(obj); Object x; do { sb.append(" -> "); x = get(--i); sb.append(x); } while(obj!=x); return sb.toString(); } }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_45) on Thu Oct 02 16:39:51 BST 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>com.hp.hpl.jena.sparql (Apache Jena ARQ)</title> <meta name="date" content="2014-10-02"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <h1 class="bar"><a href="../../../../../com/hp/hpl/jena/sparql/package-summary.html" target="classFrame">com.hp.hpl.jena.sparql</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="ARQConstants.html" title="class in com.hp.hpl.jena.sparql" target="classFrame">ARQConstants</a></li> <li><a href="SystemARQ.html" title="class in com.hp.hpl.jena.sparql" target="classFrame">SystemARQ</a></li> </ul> <h2 title="Exceptions">Exceptions</h2> <ul title="Exceptions"> <li><a href="AlreadyExists.html" title="class in com.hp.hpl.jena.sparql" target="classFrame">AlreadyExists</a></li> <li><a href="ARQException.html" title="class in com.hp.hpl.jena.sparql" target="classFrame">ARQException</a></li> <li><a href="ARQInternalErrorException.html" title="class in com.hp.hpl.jena.sparql" target="classFrame">ARQInternalErrorException</a></li> <li><a href="ARQNotImplemented.html" title="class in com.hp.hpl.jena.sparql" target="classFrame">ARQNotImplemented</a></li> <li><a href="DoesNotExist.html" title="class in com.hp.hpl.jena.sparql" target="classFrame">DoesNotExist</a></li> <li><a href="JenaTransactionException.html" title="class in com.hp.hpl.jena.sparql" target="classFrame">JenaTransactionException</a></li> </ul> </div> </body> </html>
Java
/* * arch/arm/mach-at91/include/mach/gpio.h * * Copyright (C) 2005 HP Labs * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * */ #ifndef __ASM_ARCH_AT91RM9200_GPIO_H #define __ASM_ARCH_AT91RM9200_GPIO_H #include <linux/kernel.h> #include <asm/irq.h> #define MAX_GPIO_BANKS 5 #define NR_BUILTIN_GPIO (MAX_GPIO_BANKS * 32) /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */ #define AT91_PIN_PA0 (0x00 + 0) #define AT91_PIN_PA1 (0x00 + 1) #define AT91_PIN_PA2 (0x00 + 2) #define AT91_PIN_PA3 (0x00 + 3) #define AT91_PIN_PA4 (0x00 + 4) #define AT91_PIN_PA5 (0x00 + 5) #define AT91_PIN_PA6 (0x00 + 6) #define AT91_PIN_PA7 (0x00 + 7) #define AT91_PIN_PA8 (0x00 + 8) #define AT91_PIN_PA9 (0x00 + 9) #define AT91_PIN_PA10 (0x00 + 10) #define AT91_PIN_PA11 (0x00 + 11) #define AT91_PIN_PA12 (0x00 + 12) #define AT91_PIN_PA13 (0x00 + 13) #define AT91_PIN_PA14 (0x00 + 14) #define AT91_PIN_PA15 (0x00 + 15) #define AT91_PIN_PA16 (0x00 + 16) #define AT91_PIN_PA17 (0x00 + 17) #define AT91_PIN_PA18 (0x00 + 18) #define AT91_PIN_PA19 (0x00 + 19) #define AT91_PIN_PA20 (0x00 + 20) #define AT91_PIN_PA21 (0x00 + 21) #define AT91_PIN_PA22 (0x00 + 22) #define AT91_PIN_PA23 (0x00 + 23) #define AT91_PIN_PA24 (0x00 + 24) #define AT91_PIN_PA25 (0x00 + 25) #define AT91_PIN_PA26 (0x00 + 26) #define AT91_PIN_PA27 (0x00 + 27) #define AT91_PIN_PA28 (0x00 + 28) #define AT91_PIN_PA29 (0x00 + 29) #define AT91_PIN_PA30 (0x00 + 30) #define AT91_PIN_PA31 (0x00 + 31) #define AT91_PIN_PB0 (0x20 + 0) #define AT91_PIN_PB1 (0x20 + 1) #define AT91_PIN_PB2 (0x20 + 2) #define AT91_PIN_PB3 (0x20 + 3) #define AT91_PIN_PB4 (0x20 + 4) #define AT91_PIN_PB5 (0x20 + 5) #define AT91_PIN_PB6 (0x20 + 6) #define AT91_PIN_PB7 (0x20 + 7) #define AT91_PIN_PB8 (0x20 + 8) #define AT91_PIN_PB9 (0x20 + 9) #define AT91_PIN_PB10 (0x20 + 10) #define AT91_PIN_PB11 (0x20 + 11) #define AT91_PIN_PB12 (0x20 + 12) #define AT91_PIN_PB13 (0x20 + 13) #define AT91_PIN_PB14 (0x20 + 14) #define AT91_PIN_PB15 (0x20 + 15) #define AT91_PIN_PB16 (0x20 + 16) #define AT91_PIN_PB17 (0x20 + 17) #define AT91_PIN_PB18 (0x20 + 18) #define AT91_PIN_PB19 (0x20 + 19) #define AT91_PIN_PB20 (0x20 + 20) #define AT91_PIN_PB21 (0x20 + 21) #define AT91_PIN_PB22 (0x20 + 22) #define AT91_PIN_PB23 (0x20 + 23) #define AT91_PIN_PB24 (0x20 + 24) #define AT91_PIN_PB25 (0x20 + 25) #define AT91_PIN_PB26 (0x20 + 26) #define AT91_PIN_PB27 (0x20 + 27) #define AT91_PIN_PB28 (0x20 + 28) #define AT91_PIN_PB29 (0x20 + 29) #define AT91_PIN_PB30 (0x20 + 30) #define AT91_PIN_PB31 (0x20 + 31) #define AT91_PIN_PC0 (0x40 + 0) #define AT91_PIN_PC1 (0x40 + 1) #define AT91_PIN_PC2 (0x40 + 2) #define AT91_PIN_PC3 (0x40 + 3) #define AT91_PIN_PC4 (0x40 + 4) #define AT91_PIN_PC5 (0x40 + 5) #define AT91_PIN_PC6 (0x40 + 6) #define AT91_PIN_PC7 (0x40 + 7) #define AT91_PIN_PC8 (0x40 + 8) #define AT91_PIN_PC9 (0x40 + 9) #define AT91_PIN_PC10 (0x40 + 10) #define AT91_PIN_PC11 (0x40 + 11) #define AT91_PIN_PC12 (0x40 + 12) #define AT91_PIN_PC13 (0x40 + 13) #define AT91_PIN_PC14 (0x40 + 14) #define AT91_PIN_PC15 (0x40 + 15) #define AT91_PIN_PC16 (0x40 + 16) #define AT91_PIN_PC17 (0x40 + 17) #define AT91_PIN_PC18 (0x40 + 18) #define AT91_PIN_PC19 (0x40 + 19) #define AT91_PIN_PC20 (0x40 + 20) #define AT91_PIN_PC21 (0x40 + 21) #define AT91_PIN_PC22 (0x40 + 22) #define AT91_PIN_PC23 (0x40 + 23) #define AT91_PIN_PC24 (0x40 + 24) #define AT91_PIN_PC25 (0x40 + 25) #define AT91_PIN_PC26 (0x40 + 26) #define AT91_PIN_PC27 (0x40 + 27) #define AT91_PIN_PC28 (0x40 + 28) #define AT91_PIN_PC29 (0x40 + 29) #define AT91_PIN_PC30 (0x40 + 30) #define AT91_PIN_PC31 (0x40 + 31) #define AT91_PIN_PD0 (0x60 + 0) #define AT91_PIN_PD1 (0x60 + 1) #define AT91_PIN_PD2 (0x60 + 2) #define AT91_PIN_PD3 (0x60 + 3) #define AT91_PIN_PD4 (0x60 + 4) #define AT91_PIN_PD5 (0x60 + 5) #define AT91_PIN_PD6 (0x60 + 6) #define AT91_PIN_PD7 (0x60 + 7) #define AT91_PIN_PD8 (0x60 + 8) #define AT91_PIN_PD9 (0x60 + 9) #define AT91_PIN_PD10 (0x60 + 10) #define AT91_PIN_PD11 (0x60 + 11) #define AT91_PIN_PD12 (0x60 + 12) #define AT91_PIN_PD13 (0x60 + 13) #define AT91_PIN_PD14 (0x60 + 14) #define AT91_PIN_PD15 (0x60 + 15) #define AT91_PIN_PD16 (0x60 + 16) #define AT91_PIN_PD17 (0x60 + 17) #define AT91_PIN_PD18 (0x60 + 18) #define AT91_PIN_PD19 (0x60 + 19) #define AT91_PIN_PD20 (0x60 + 20) #define AT91_PIN_PD21 (0x60 + 21) #define AT91_PIN_PD22 (0x60 + 22) #define AT91_PIN_PD23 (0x60 + 23) #define AT91_PIN_PD24 (0x60 + 24) #define AT91_PIN_PD25 (0x60 + 25) #define AT91_PIN_PD26 (0x60 + 26) #define AT91_PIN_PD27 (0x60 + 27) #define AT91_PIN_PD28 (0x60 + 28) #define AT91_PIN_PD29 (0x60 + 29) #define AT91_PIN_PD30 (0x60 + 30) #define AT91_PIN_PD31 (0x60 + 31) #define AT91_PIN_PE0 (0x80 + 0) #define AT91_PIN_PE1 (0x80 + 1) #define AT91_PIN_PE2 (0x80 + 2) #define AT91_PIN_PE3 (0x80 + 3) #define AT91_PIN_PE4 (0x80 + 4) #define AT91_PIN_PE5 (0x80 + 5) #define AT91_PIN_PE6 (0x80 + 6) #define AT91_PIN_PE7 (0x80 + 7) #define AT91_PIN_PE8 (0x80 + 8) #define AT91_PIN_PE9 (0x80 + 9) #define AT91_PIN_PE10 (0x80 + 10) #define AT91_PIN_PE11 (0x80 + 11) #define AT91_PIN_PE12 (0x80 + 12) #define AT91_PIN_PE13 (0x80 + 13) #define AT91_PIN_PE14 (0x80 + 14) #define AT91_PIN_PE15 (0x80 + 15) #define AT91_PIN_PE16 (0x80 + 16) #define AT91_PIN_PE17 (0x80 + 17) #define AT91_PIN_PE18 (0x80 + 18) #define AT91_PIN_PE19 (0x80 + 19) #define AT91_PIN_PE20 (0x80 + 20) #define AT91_PIN_PE21 (0x80 + 21) #define AT91_PIN_PE22 (0x80 + 22) #define AT91_PIN_PE23 (0x80 + 23) #define AT91_PIN_PE24 (0x80 + 24) #define AT91_PIN_PE25 (0x80 + 25) #define AT91_PIN_PE26 (0x80 + 26) #define AT91_PIN_PE27 (0x80 + 27) #define AT91_PIN_PE28 (0x80 + 28) #define AT91_PIN_PE29 (0x80 + 29) #define AT91_PIN_PE30 (0x80 + 30) #define AT91_PIN_PE31 (0x80 + 31) #ifndef __ASSEMBLY__ /* setup setup routines, called from board init or driver probe() */ extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup); extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup); extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup); extern int __init_or_module at91_set_C_periph(unsigned pin, int use_pullup); extern int __init_or_module at91_set_D_periph(unsigned pin, int use_pullup); extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup); extern int __init_or_module at91_set_gpio_output(unsigned pin, int value); extern int __init_or_module at91_set_deglitch(unsigned pin, int is_on); extern int __init_or_module at91_set_debounce(unsigned pin, int is_on, int div); extern int __init_or_module at91_set_multi_drive(unsigned pin, int is_on); extern int __init_or_module at91_set_pulldown(unsigned pin, int is_on); extern int __init_or_module at91_disable_schmitt_trig(unsigned pin); /* callable at any time */ extern int at91_set_gpio_value(unsigned pin, int value); extern int at91_get_gpio_value(unsigned pin); /* callable only from core power-management code */ extern void at91_gpio_suspend(void); extern void at91_gpio_resume(void); #ifdef CONFIG_PINCTRL_AT91 void at91_pinctrl_gpio_suspend(void); void at91_pinctrl_gpio_resume(void); #else static inline void at91_pinctrl_gpio_suspend(void) {} static inline void at91_pinctrl_gpio_resume(void) {} #endif #endif /* __ASSEMBLY__ */ #endif
Java
/* * #%L * OME SCIFIO package for reading and converting scientific file formats. * %% * Copyright (C) 2005 - 2012 Open Microscopy Environment: * - Board of Regents of the University of Wisconsin-Madison * - Glencoe Software, Inc. * - University of Dundee * %% * 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. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDERS 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. * * The views and conclusions contained in the software and documentation are * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of any organization. * #L% */ package loci.common; import java.io.IOException; /** * A legacy delegator class for ome.scifio.common.IniWriter. * * <dl><dt><b>Source code:</b></dt> * <dd><a href="http://trac.openmicroscopy.org.uk/ome/browser/bioformats.git/components/common/src/loci/common/IniWriter.java">Trac</a>, * <a href="http://git.openmicroscopy.org/?p=bioformats.git;a=blob;f=components/common/src/loci/common/IniWriter.java;hb=HEAD">Gitweb</a></dd></dl> * * @author Melissa Linkert melissa at glencoesoftware.com */ public class IniWriter { // -- Fields -- private ome.scifio.common.IniWriter writer; // -- Constructor -- public IniWriter() { writer = new ome.scifio.common.IniWriter(); } // -- IniWriter API methods -- /** * Saves the given IniList to the given file. * If the given file already exists, then the IniList will be appended. */ public void saveINI(IniList ini, String path) throws IOException { writer.saveINI(ini.list, path); } /** Saves the given IniList to the given file. */ public void saveINI(IniList ini, String path, boolean append) throws IOException { writer.saveINI(ini.list, path, append); } // -- Object delegators -- @Override public boolean equals(Object obj) { return writer.equals(obj); } @Override public int hashCode() { return writer.hashCode(); } @Override public String toString() { return writer.toString(); } }
Java
var mysql_wn_data_noun_quantity = { "morsel":[["noun.quantity"],["morsel","small indefinite quantity"]], "section":[["noun.quantity","noun.group","noun.location","verb.contact:section","noun.group"],["section","square mile","section2","team","platoon1","section1","area1","section4","discussion section","class3"]], "mate":[["noun.quantity","noun.person","noun.person","adj.all:friendly1^matey","noun.location:Australia","noun.location:Britain","noun.person","verb.contact:mate","noun.Tops:animal"],["mate","fellow","singleton","couple","mate2","first mate","officer4","mate3","friend","mate1"]], "exposure":[["noun.quantity","verb.perception:expose1"],["exposure","light unit"]], "parking":[["noun.quantity","verb.contact:park"],["parking","room"]], "shtik":[["noun.quantity","noun.communication:Yiddish"],["shtik","shtick","schtik","schtick","small indefinite quantity"]], "basket":[["noun.quantity","noun.artifact","noun.person:basketeer"],["basket","basketful","containerful","basket1","basketball hoop","hoop3","goal","basketball equipment"]], "correction":[["noun.quantity","noun.communication"],["correction","fudge factor","indefinite quantity","correction1","editing"]], "footstep":[["noun.quantity","verb.change:pace","verb.motion:pace1","verb.motion:pace","verb.change:step","verb.motion:step3","verb.motion:step1","verb.motion:step","verb.motion:stride3","verb.motion:stride"],["footstep","pace1","step","stride","indefinite quantity"]], "addition":[["noun.quantity","verb.change:increase2","verb.change:increase"],["addition","increase","gain","indefinite quantity"]], "circulation":[["noun.quantity","verb.motion:circulate3","noun.quantity","noun.cognition:library science"],["circulation","count","circulation1","count"]], "breakage":[["noun.quantity"],["breakage","indefinite quantity"]], "craps":[["noun.quantity"],["craps","snake eyes","two"]], "utility":[["noun.quantity","noun.cognition:economics"],["utility","system of measurement"]], "blood count":[["noun.quantity"],["blood count","count"]], "sperm count":[["noun.quantity"],["sperm count","count"]], "eyedrop":[["noun.quantity"],["eyedrop","eye-drop","drop"]], "picking":[["noun.quantity","verb.contact:pick1"],["picking","pick","output"]], "capacity":[["noun.quantity","adj.all:large^capacious","verb.stative:contain13"],["capacity","content","volume"]], "pitcher":[["noun.quantity"],["pitcher","pitcherful","containerful"]], "tankage":[["noun.quantity"],["tankage","indefinite quantity"]], "nip":[["noun.quantity","verb.contact","noun.act:nip1"],["nip","shot","small indefinite quantity","nip2","bite"]], "headroom":[["noun.quantity"],["headroom","headway","clearance","room"]], "population":[["noun.quantity","noun.group","noun.Tops:group"],["population","integer","population1"]], "nit":[["noun.quantity"],["nit","luminance unit"]], "quetzal":[["noun.quantity"],["quetzal","Guatemalan monetary unit"]], "lari":[["noun.quantity"],["lari","Georgian monetary unit"]], "agora":[["noun.quantity"],["agora","shekel","Israeli monetary unit"]], "barn":[["noun.quantity","noun.cognition:atomic physics"],["barn","b","area unit"]], "barrow":[["noun.quantity"],["barrow","barrowful","containerful"]], "basin":[["noun.quantity"],["basin","basinful","containerful"]], "bit":[["noun.quantity","noun.artifact","noun.artifact"],["bit","unit of measurement","byte","bit1","stable gear","bridle","bit2","part","key"]], "carton":[["noun.quantity"],["carton","cartonful","containerful"]], "cordage":[["noun.quantity","noun.Tops:measure"],["cordage"]], "cutoff":[["noun.quantity"],["cutoff","limit"]], "dustpan":[["noun.quantity"],["dustpan","dustpanful","containerful"]], "firkin":[["noun.quantity"],["firkin","British capacity unit","kilderkin"]], "flask":[["noun.quantity"],["flask","flaskful","containerful"]], "frail":[["noun.quantity"],["frail","weight unit"]], "keg":[["noun.quantity"],["keg","kegful","containerful"]], "kettle":[["noun.quantity","noun.artifact","noun.person:tympanist","noun.person:timpanist","noun.person:tympanist","noun.person:timpanist","adj.pert:tympanic1","noun.person:timpanist"],["kettle","kettleful","containerful","kettle1","kettledrum","tympanum","tympani","timpani","percussion instrument"]], "load":[["noun.quantity","noun.artifact","verb.contact","noun.artifact:load","noun.artifact:load2","noun.person:loader","noun.act:loading","noun.artifact:lading","verb.change:fill1","verb.possession","noun.cognition:computer science","verb.contact","noun.artifact:load1","noun.person:loader1","noun.artifact:charge","verb.change:fill1","verb.contact","noun.artifact:load2","noun.artifact:load","noun.person:loader","noun.act:loading"],["load","loading","indefinite quantity","load3","electrical device","load1","lade1","laden1","load up","frames:1","21","load12","transfer1","load2","charge2","load10","put"]], "reservoir":[["noun.quantity","noun.artifact","noun.object:lake"],["reservoir","supply","reservoir1","artificial lake","man-made lake","water system"]], "seventy-eight":[["noun.quantity"],["seventy-eight","78\"","LXXVIII","large integer"]], "sextant":[["noun.quantity","noun.attribute:circumference1"],["sextant","angular unit"]], "singleton":[["noun.quantity"],["singleton","one"]], "skeleton":[["noun.quantity"],["skeleton","minimum"]], "standard":[["noun.quantity","verb.change:standardize","verb.change:standardise"],["standard","volume unit"]], "teacup":[["noun.quantity"],["teacup","teacupful","containerful"]], "thimble":[["noun.quantity"],["thimble","thimbleful","containerful"]], "tub":[["noun.quantity"],["tub","tubful","containerful"]], "twenty-two":[["noun.quantity"],["twenty-two","22\"","XXII","large integer"]], "yard":[["noun.quantity","verb.change:pace","noun.location","noun.artifact","noun.location:field","noun.artifact","noun.location:tract"],["yard","pace","linear unit","fathom1","chain","rod1","lea","yard1","tract","yard2","grounds","curtilage","yard3","railway yard","railyard"]], "yarder":[["noun.quantity","noun.communication:combining form"],["yarder","linear unit"]], "common denominator":[["noun.quantity"],["common denominator","denominator"]], "volume":[["noun.quantity","adj.all:large^voluminous","noun.Tops:quantity","noun.quantity","noun.Tops:quantity"],["volume","volume1"]], "magnetization":[["noun.quantity","verb.communication:magnetize","verb.change:magnetize","noun.Tops:measure"],["magnetization","magnetisation"]], "precipitation":[["noun.quantity","verb.weather:precipitate"],["precipitation","indefinite quantity"]], "degree":[["noun.quantity","noun.state","noun.Tops:state","noun.quantity"],["degree","arcdegree","angular unit","oxtant","sextant","degree1","level","stage","point","degree3","temperature unit"]], "solubility":[["noun.quantity","adj.all:soluble1","noun.substance:solution"],["solubility","definite quantity"]], "lumen":[["noun.quantity"],["lumen","lm","luminous flux unit"]], "headful":[["noun.quantity"],["headful","containerful"]], "palm":[["noun.quantity","verb.contact:palm"],["palm","linear unit"]], "digit":[["noun.quantity","verb.change:digitize","verb.change:digitise","verb.change:digitalize"],["digit","figure","integer"]], "point system":[["noun.quantity"],["point system","system of measurement"]], "constant":[["noun.quantity"],["constant","number"]], "one":[["noun.quantity"],["one","1\"","I","ace","single","unity","digit"]], "region":[["noun.quantity","noun.location","noun.Tops:location"],["region","neighborhood","indefinite quantity","region1"]], "word":[["noun.quantity","noun.communication","verb.communication:word","noun.communication"],["word","kilobyte","computer memory unit","word3","statement","word6","order3"]], "quota":[["noun.quantity"],["quota","number"]], "dollar":[["noun.quantity","noun.possession"],["dollar","monetary unit","dollar1","coin2"]], "e":[["noun.quantity"],["e","transcendental number"]], "gamma":[["noun.quantity"],["gamma","oersted","field strength unit"]], "pi":[["noun.quantity"],["pi","transcendental number"]], "radical":[["noun.quantity","noun.Tops:measure","noun.cognition:mathematics"],["radical"]], "pascal":[["noun.quantity"],["pascal","Pa","pressure unit"]], "guarani":[["noun.quantity"],["guarani","Paraguayan monetary unit"]], "pengo":[["noun.quantity"],["pengo","Hungarian monetary unit"]], "outage":[["noun.quantity"],["outage","indefinite quantity"]], "couple":[["noun.quantity","verb.contact:couple2","verb.contact:pair3","verb.contact:pair4","verb.contact","noun.artifact:coupler","noun.artifact:coupling"],["couple","pair","twosome","twain","brace","span2","yoke","couplet","distich","duo","duet","dyad","duad","two","couple1","uncouple","couple on","couple up","attach1"]], "yuan":[["noun.quantity"],["yuan","kwai","Chinese monetary unit"]], "battalion":[["noun.quantity","adj.all:incalculable^multitudinous"],["battalion","large number","multitude","plurality1","pack","large indefinite quantity"]], "moiety":[["noun.quantity"],["moiety","mediety","one-half"]], "maximum":[["noun.quantity","verb.change:maximize1","verb.change:maximize","verb.change:maximise1","verb.change:maximise"],["maximum","minimum","upper limit","extremum","large indefinite quantity"]], "minimum":[["noun.quantity","verb.communication:minimize1","verb.communication:minimize","verb.change:minimize","verb.communication:minimise1","verb.change:minimise"],["minimum","maximum","lower limit","extremum","small indefinite quantity"]], "cordoba":[["noun.quantity"],["cordoba","Nicaraguan monetary unit"]], "troy":[["noun.quantity"],["troy","troy weight","system of weights"]], "acre":[["noun.quantity","noun.location"],["acre","area unit","Acre1","district","Brazil"]], "sucre":[["noun.quantity"],["sucre","Ecuadoran monetary unit"]], "tanga":[["noun.quantity"],["tanga","Tajikistani monetary unit"]], "lepton":[["noun.quantity"],["lepton","drachma","Greek monetary unit"]], "ocean":[["noun.quantity","adj.all:unlimited^oceanic"],["ocean","sea","large indefinite quantity"]], "para":[["noun.quantity"],["para","Yugoslavian monetary unit","Yugoslavian dinar"]], "swath":[["noun.quantity","noun.shape:space"],["swath"]], "bel":[["noun.quantity"],["Bel","B3","sound unit"]], "denier":[["noun.quantity"],["denier","unit of measurement"]], "miler":[["noun.quantity","noun.quantity:mile6","noun.quantity:mile5","noun.quantity:mile4","noun.quantity:mile3","noun.quantity:mile2","noun.quantity:mile1","noun.event:mile","noun.communication:combining form"],["miler","linear unit"]], "welterweight":[["noun.quantity","noun.person","noun.person"],["welterweight","weight unit","welterweight1","wrestler","welterweight2","boxer"]], "balboa":[["noun.quantity"],["balboa","Panamanian monetary unit"]], "bolivar":[["noun.quantity"],["bolivar","Venezuelan monetary unit"]], "cicero":[["noun.quantity"],["cicero","linear unit"]], "coulomb":[["noun.quantity"],["coulomb","C","ampere-second","charge unit","abcoulomb","ampere-minute"]], "curie":[["noun.quantity","noun.person"],["curie","Ci","radioactivity unit","Curie1","Pierre Curie","physicist"]], "gauss":[["noun.quantity"],["gauss","flux density unit","tesla"]], "gilbert":[["noun.quantity","noun.person","noun.person","noun.person","adj.pert:gilbertian"],["gilbert","Gb1","Gi","magnetomotive force unit","Gilbert1","Humphrey Gilbert","Sir Humphrey Gilbert","navigator","Gilbert2","William Gilbert","physician","physicist","Gilbert3","William Gilbert1","William S. Gilbert","William Schwenk Gilbert","Sir William Gilbert","librettist","poet"]], "gram":[["noun.quantity"],["gram","gramme","gm","g","metric weight unit","dekagram"]], "henry":[["noun.quantity","noun.person","noun.person"],["henry","H","inductance unit","Henry1","Patrick Henry","American Revolutionary leader","orator","Henry2","William Henry","chemist"]], "joule":[["noun.quantity"],["joule","J","watt second","work unit"]], "kelvin":[["noun.quantity"],["kelvin","K5","temperature unit"]], "lambert":[["noun.quantity"],["lambert","L7","illumination unit"]], "langley":[["noun.quantity"],["langley","unit of measurement"]], "maxwell":[["noun.quantity"],["maxwell","Mx","flux unit","weber"]], "newton":[["noun.quantity"],["newton","N1","force unit","sthene"]], "oersted":[["noun.quantity"],["oersted","field strength unit"]], "ohm":[["noun.quantity","adj.pert:ohmic"],["ohm","resistance unit","megohm"]], "rand":[["noun.quantity"],["rand","South African monetary unit"]], "roentgen":[["noun.quantity"],["roentgen","R","radioactivity unit"]], "rutherford":[["noun.quantity","noun.person"],["rutherford","radioactivity unit","Rutherford1","Daniel Rutherford","chemist"]], "sabin":[["noun.quantity"],["sabin","absorption unit"]], "tesla":[["noun.quantity"],["tesla","flux density unit"]], "watt":[["noun.quantity"],["watt","W","power unit","kilowatt","horsepower"]], "weber":[["noun.quantity","noun.person","noun.person","noun.person","noun.person"],["weber","Wb","flux unit","Weber1","Carl Maria von Weber","Baron Karl Maria Friedrich Ernst von Weber","conductor","composer","Weber2","Max Weber","sociologist","Weber3","Max Weber1","painter","Weber4","Wilhelm Eduard Weber","physicist"]], "scattering":[["noun.quantity","verb.contact:sprinkle1"],["scattering","sprinkling","small indefinite quantity"]], "accretion":[["noun.quantity","adj.all:increasing^accretionary","noun.process","adj.all:increasing^accretionary","noun.cognition:geology","noun.process","adj.all:increasing^accretionary","verb.change:accrete1","noun.cognition:biology","noun.process","adj.all:increasing^accretionary","noun.cognition:astronomy"],["accretion","addition","accretion1","increase","accretion2","increase","accretion3","increase"]], "dividend":[["noun.quantity"],["dividend","number"]], "linage":[["noun.quantity"],["linage","lineage","number"]], "penny":[["noun.quantity"],["penny","fractional monetary unit","Irish pound","British pound"]], "double eagle":[["noun.quantity","noun.act:golf"],["double eagle","score"]], "spoilage":[["noun.quantity"],["spoilage","indefinite quantity"]], "fundamental quantity":[["noun.quantity","noun.Tops:measure"],["fundamental quantity","fundamental measure"]], "definite quantity":[["noun.quantity","noun.Tops:measure"],["definite quantity"]], "indefinite quantity":[["noun.quantity","noun.Tops:measure"],["indefinite quantity"]], "relative quantity":[["noun.quantity","noun.Tops:measure"],["relative quantity"]], "system of measurement":[["noun.quantity","noun.Tops:measure"],["system of measurement","metric"]], "system of weights and measures":[["noun.quantity"],["system of weights and measures","system of measurement"]], "british imperial system":[["noun.quantity"],["British Imperial System","English system","British system","system of weights and measures"]], "metric system":[["noun.quantity"],["metric system","system of weights and measures"]], "cgs":[["noun.quantity"],["cgs","cgs system","metric system"]], "systeme international d'unites":[["noun.quantity"],["Systeme International d'Unites","Systeme International","SI system","SI","SI unit","International System of Units","International System","metric system"]], "united states customary system":[["noun.quantity"],["United States Customary System","system of weights and measures"]], "information measure":[["noun.quantity"],["information measure","system of measurement"]], "bandwidth":[["noun.quantity"],["bandwidth","information measure"]], "baud":[["noun.quantity","noun.cognition:computer science"],["baud","baud rate","information measure"]], "octane number":[["noun.quantity","noun.Tops:measure"],["octane number","octane rating"]], "marginal utility":[["noun.quantity","noun.cognition:economics"],["marginal utility","utility"]], "enough":[["noun.quantity","adj.all:sufficient^enough","adj.all:sufficient","verb.stative:suffice"],["enough","sufficiency","relative quantity"]], "absolute value":[["noun.quantity"],["absolute value","numerical value","definite quantity"]], "acid value":[["noun.quantity","noun.cognition:chemistry"],["acid value","definite quantity"]], "chlorinity":[["noun.quantity"],["chlorinity","definite quantity"]], "quire":[["noun.quantity"],["quire","definite quantity","ream"]], "toxicity":[["noun.quantity","adj.all:toxic"],["toxicity","definite quantity"]], "cytotoxicity":[["noun.quantity"],["cytotoxicity","toxicity"]], "unit of measurement":[["noun.quantity","verb.social:unitize","verb.change:unitize"],["unit of measurement","unit","definite quantity"]], "measuring unit":[["noun.quantity"],["measuring unit","measuring block","unit of measurement"]], "diopter":[["noun.quantity"],["diopter","dioptre","unit of measurement"]], "karat":[["noun.quantity"],["karat","carat2","kt","unit of measurement"]], "decimal":[["noun.quantity","verb.change:decimalize","verb.change:decimalise"],["decimal1","number"]], "avogadro's number":[["noun.quantity"],["Avogadro's number","Avogadro number","constant"]], "boltzmann's constant":[["noun.quantity"],["Boltzmann's constant","constant"]], "coefficient":[["noun.quantity"],["coefficient","constant"]], "absorption coefficient":[["noun.quantity"],["absorption coefficient","coefficient of absorption","absorptance","coefficient"]], "drag coefficient":[["noun.quantity"],["drag coefficient","coefficient of drag","coefficient"]], "coefficient of friction":[["noun.quantity"],["coefficient of friction","coefficient"]], "coefficient of mutual induction":[["noun.quantity"],["coefficient of mutual induction","mutual inductance","coefficient"]], "coefficient of self induction":[["noun.quantity"],["coefficient of self induction","self-inductance","coefficient"]], "modulus":[["noun.quantity","noun.cognition:physics","noun.quantity","noun.quantity"],["modulus","coefficient","modulus1","absolute value","modulus2","integer"]], "coefficient of elasticity":[["noun.quantity","noun.cognition:physics"],["coefficient of elasticity","modulus of elasticity","elastic modulus","modulus"]], "bulk modulus":[["noun.quantity"],["bulk modulus","coefficient of elasticity"]], "modulus of rigidity":[["noun.quantity"],["modulus of rigidity","coefficient of elasticity"]], "young's modulus":[["noun.quantity"],["Young's modulus","coefficient of elasticity"]], "coefficient of expansion":[["noun.quantity"],["coefficient of expansion","expansivity","coefficient"]], "coefficient of reflection":[["noun.quantity"],["coefficient of reflection","reflection factor","reflectance","reflectivity","coefficient"]], "transmittance":[["noun.quantity"],["transmittance","transmission","coefficient"]], "coefficient of viscosity":[["noun.quantity"],["coefficient of viscosity","absolute viscosity","dynamic viscosity","coefficient"]], "cosmological constant":[["noun.quantity"],["cosmological constant","constant"]], "equilibrium constant":[["noun.quantity","noun.cognition:chemistry"],["equilibrium constant","constant"]], "dissociation constant":[["noun.quantity"],["dissociation constant","equilibrium constant"]], "gas constant":[["noun.quantity","noun.cognition:physics"],["gas constant","universal gas constant","R1","constant"]], "gravitational constant":[["noun.quantity","noun.cognition:law of gravitation","noun.cognition:physics"],["gravitational constant","universal gravitational constant","constant of gravitation","G8","constant"]], "hubble's constant":[["noun.quantity","noun.cognition:cosmology"],["Hubble's constant","Hubble constant","Hubble's parameter","Hubble parameter","constant"]], "ionic charge":[["noun.quantity"],["ionic charge","constant"]], "planck's constant":[["noun.quantity"],["Planck's constant","h1","factor of proportionality"]], "oxidation number":[["noun.quantity"],["oxidation number","oxidation state","number"]], "cardinality":[["noun.quantity","noun.cognition:mathematics"],["cardinality","number"]], "body count":[["noun.quantity"],["body count","count"]], "head count":[["noun.quantity"],["head count","headcount","count"]], "pollen count":[["noun.quantity"],["pollen count","count"]], "conversion factor":[["noun.quantity"],["conversion factor","factor1"]], "factor of proportionality":[["noun.quantity"],["factor of proportionality","constant of proportionality","factor1","constant"]], "fibonacci number":[["noun.quantity"],["Fibonacci number","number"]], "prime factor":[["noun.quantity"],["prime factor","divisor1"]], "prime number":[["noun.quantity"],["prime number","prime"]], "composite number":[["noun.quantity"],["composite number","number"]], "double-bogey":[["noun.quantity","verb.contact:double bogey","noun.act:golf"],["double-bogey","score"]], "compound number":[["noun.quantity"],["compound number","number"]], "ordinal number":[["noun.quantity","adj.all:ordinal"],["ordinal number","ordinal","no.","number"]], "cardinal number":[["noun.quantity"],["cardinal number","cardinal","number"]], "floating-point number":[["noun.quantity"],["floating-point number","number"]], "fixed-point number":[["noun.quantity"],["fixed-point number","number"]], "googol":[["noun.quantity"],["googol","cardinal number"]], "googolplex":[["noun.quantity"],["googolplex","cardinal number"]], "atomic number":[["noun.quantity"],["atomic number","number"]], "magic number":[["noun.quantity"],["magic number","atomic number"]], "baryon number":[["noun.quantity"],["baryon number","number"]], "long measure":[["noun.quantity"],["long measure","linear unit"]], "magnetic flux":[["noun.quantity"],["magnetic flux","magnetization"]], "absorption unit":[["noun.quantity"],["absorption unit","unit of measurement"]], "acceleration unit":[["noun.quantity"],["acceleration unit","unit of measurement"]], "angular unit":[["noun.quantity"],["angular unit","unit of measurement"]], "area unit":[["noun.quantity"],["area unit","square measure","unit of measurement"]], "volume unit":[["noun.quantity"],["volume unit","capacity unit","capacity measure","cubage unit","cubic measure","cubic content unit","displacement unit","cubature unit","unit of measurement","volume"]], "cubic inch":[["noun.quantity"],["cubic inch","cu in","volume unit"]], "cubic foot":[["noun.quantity"],["cubic foot","cu ft","volume unit"]], "computer memory unit":[["noun.quantity"],["computer memory unit","unit of measurement"]], "electromagnetic unit":[["noun.quantity"],["electromagnetic unit","emu","unit of measurement"]], "explosive unit":[["noun.quantity"],["explosive unit","unit of measurement"]], "force unit":[["noun.quantity"],["force unit","unit of measurement"]], "linear unit":[["noun.quantity"],["linear unit","linear measure","unit of measurement"]], "metric unit":[["noun.quantity"],["metric unit","metric1","unit of measurement"]], "miles per gallon":[["noun.quantity"],["miles per gallon","unit of measurement"]], "monetary unit":[["noun.quantity"],["monetary unit","unit of measurement"]], "megaflop":[["noun.quantity","noun.cognition:computer science"],["megaflop","MFLOP","million floating point operations per second","unit of measurement","teraflop"]], "teraflop":[["noun.quantity","noun.cognition:computer science"],["teraflop","trillion floating point operations per second","unit of measurement"]], "mips":[["noun.quantity","noun.cognition:computer science"],["MIPS","million instructions per second","unit of measurement"]], "pain unit":[["noun.quantity"],["pain unit","unit of measurement"]], "pressure unit":[["noun.quantity"],["pressure unit","unit of measurement"]], "printing unit":[["noun.quantity"],["printing unit","unit of measurement"]], "sound unit":[["noun.quantity"],["sound unit","unit of measurement"]], "telephone unit":[["noun.quantity"],["telephone unit","unit of measurement"]], "temperature unit":[["noun.quantity"],["temperature unit","unit of measurement"]], "weight unit":[["noun.quantity"],["weight unit","weight","unit of measurement"]], "mass unit":[["noun.quantity"],["mass unit","unit of measurement"]], "unit of viscosity":[["noun.quantity"],["unit of viscosity","unit of measurement"]], "work unit":[["noun.quantity"],["work unit","heat unit","energy unit","unit of measurement"]], "brinell number":[["noun.quantity"],["Brinell number","unit of measurement"]], "brix scale":[["noun.quantity"],["Brix scale","system of measurement"]], "set point":[["noun.quantity","noun.act:tennis"],["set point","point1"]], "match point":[["noun.quantity","noun.act:tennis"],["match point","point1"]], "circular measure":[["noun.quantity"],["circular measure","system of measurement"]], "mil":[["noun.quantity","noun.quantity","noun.quantity"],["mil3","angular unit","mil1","linear unit","inch","mil4","Cypriot pound","Cypriot monetary unit"]], "microradian":[["noun.quantity"],["microradian","angular unit","milliradian"]], "milliradian":[["noun.quantity"],["milliradian","angular unit","radian"]], "radian":[["noun.quantity"],["radian","rad1","angular unit"]], "grad":[["noun.quantity","noun.shape:right angle"],["grad","grade","angular unit"]], "oxtant":[["noun.quantity"],["oxtant","angular unit"]], "straight angle":[["noun.quantity","noun.attribute:circumference1"],["straight angle","angular unit"]], "steradian":[["noun.quantity","noun.shape:sphere1"],["steradian","sr","angular unit"]], "square inch":[["noun.quantity"],["square inch","sq in","area unit"]], "square foot":[["noun.quantity"],["square foot","sq ft","area unit"]], "square yard":[["noun.quantity"],["square yard","sq yd","area unit"]], "square meter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["square meter","square metre","centare","area unit"]], "square mile":[["noun.quantity"],["square mile","area unit"]], "quarter section":[["noun.quantity"],["quarter section","area unit"]], "are":[["noun.quantity"],["are","ar","area unit","hectare"]], "hectare":[["noun.quantity"],["hectare","area unit"]], "arpent":[["noun.quantity"],["arpent","area unit"]], "dessiatine":[["noun.quantity"],["dessiatine","area unit"]], "morgen":[["noun.quantity"],["morgen","area unit"]], "liquid unit":[["noun.quantity"],["liquid unit","liquid measure","capacity unit"]], "dry unit":[["noun.quantity"],["dry unit","dry measure","capacity unit"]], "united states liquid unit":[["noun.quantity"],["United States liquid unit","liquid unit"]], "british capacity unit":[["noun.quantity"],["British capacity unit","Imperial capacity unit","liquid unit","dry unit"]], "metric capacity unit":[["noun.quantity"],["metric capacity unit","capacity unit","metric unit"]], "ardeb":[["noun.quantity"],["ardeb","dry unit"]], "arroba":[["noun.quantity","noun.quantity"],["arroba2","liquid unit","arroba1","weight unit"]], "cran":[["noun.quantity"],["cran","capacity unit"]], "ephah":[["noun.quantity"],["ephah","epha","dry unit","homer"]], "field capacity":[["noun.quantity"],["field capacity","capacity unit"]], "hin":[["noun.quantity"],["hin","capacity unit"]], "acre-foot":[["noun.quantity"],["acre-foot","volume unit"]], "acre inch":[["noun.quantity"],["acre inch","volume unit"]], "board measure":[["noun.quantity"],["board measure","system of measurement"]], "board foot":[["noun.quantity"],["board foot","volume unit"]], "cubic yard":[["noun.quantity"],["cubic yard","yard1","volume unit"]], "mutchkin":[["noun.quantity"],["mutchkin","liquid unit"]], "oka":[["noun.quantity","noun.quantity"],["oka2","liquid unit","oka1","weight unit"]], "minim":[["noun.quantity","noun.quantity"],["minim1","United States liquid unit","fluidram1","minim2","British capacity unit","fluidram2"]], "fluidram":[["noun.quantity","noun.quantity"],["fluidram1","fluid dram1","fluid drachm1","drachm1","United States liquid unit","fluidounce1","fluidram2","fluid dram2","fluid drachm2","drachm2","British capacity unit","fluidounce2"]], "fluidounce":[["noun.quantity","noun.quantity"],["fluidounce1","fluid ounce1","United States liquid unit","gill1","fluidounce2","fluid ounce2","British capacity unit","gill2"]], "pint":[["noun.quantity","noun.quantity","noun.quantity"],["pint1","United States liquid unit","quart1","pint3","dry pint","United States dry unit","quart3","pint2","British capacity unit","quart2"]], "quart":[["noun.quantity","noun.quantity","noun.quantity"],["quart1","United States liquid unit","gallon1","quart3","dry quart","United States dry unit","peck1","quart2","British capacity unit","gallon2"]], "gallon":[["noun.quantity","noun.quantity"],["gallon1","gal","United States liquid unit","barrel1","gallon2","Imperial gallon","congius","British capacity unit","bushel1","barrel1","firkin"]], "united states dry unit":[["noun.quantity"],["United States dry unit","dry unit"]], "bushel":[["noun.quantity","noun.quantity"],["bushel2","United States dry unit","bushel1","British capacity unit","quarter4"]], "kilderkin":[["noun.quantity"],["kilderkin","British capacity unit"]], "chaldron":[["noun.quantity"],["chaldron","British capacity unit"]], "cubic millimeter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["cubic millimeter","cubic millimetre","metric capacity unit","milliliter"]], "milliliter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["milliliter","millilitre","mil2","ml","cubic centimeter","cubic centimetre","cc","metric capacity unit","centiliter"]], "centiliter":[["noun.quantity"],["centiliter","centilitre","cl","metric capacity unit","deciliter"]], "deciliter":[["noun.quantity"],["deciliter","decilitre","dl","metric capacity unit","liter"]], "liter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["liter","litre","l","cubic decimeter","cubic decimetre","metric capacity unit","dekaliter"]], "dekaliter":[["noun.quantity"],["dekaliter","dekalitre","decaliter","decalitre","dal","dkl","metric capacity unit","hectoliter"]], "hectoliter":[["noun.quantity"],["hectoliter","hectolitre","hl","metric capacity unit","kiloliter"]], "kiloliter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["kiloliter","kilolitre","cubic meter","cubic metre","metric capacity unit","cubic kilometer"]], "cubic kilometer":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["cubic kilometer","cubic kilometre","metric capacity unit"]], "parity bit":[["noun.quantity","noun.cognition:computer science"],["parity bit","parity","check bit","bit"]], "nybble":[["noun.quantity","verb.consumption:nibble1","verb.contact:nibble"],["nybble","nibble","byte","computer memory unit"]], "byte":[["noun.quantity"],["byte","computer memory unit","word"]], "bad block":[["noun.quantity","noun.cognition:computer science"],["bad block","block"]], "allocation unit":[["noun.quantity"],["allocation unit","computer memory unit"]], "kilobyte":[["noun.quantity","noun.quantity"],["kilobyte","kibibyte","K","KB","kB1","KiB","mebibyte","computer memory unit","kilobyte1","K1","KB2","kB3","megabyte1","computer memory unit"]], "kilobit":[["noun.quantity"],["kilobit","kbit","kb4","megabit","computer memory unit"]], "kibibit":[["noun.quantity"],["kibibit","kibit","mebibit","computer memory unit"]], "megabyte":[["noun.quantity","noun.quantity"],["megabyte","mebibyte","M2","MB","MiB","gibibyte","computer memory unit","megabyte1","M3","MB1","gigabyte1","computer memory unit"]], "megabit":[["noun.quantity"],["megabit","Mbit","Mb2","gigabit","computer memory unit"]], "mebibit":[["noun.quantity"],["mebibit","Mibit","gibibit","computer memory unit"]], "gigabyte":[["noun.quantity","noun.quantity"],["gigabyte","gibibyte","G2","GB2","GiB","tebibyte","computer memory unit","gigabyte1","G3","GB3","terabyte1","computer memory unit"]], "gigabit":[["noun.quantity"],["gigabit","Gbit","Gb4","terabit","computer memory unit"]], "gibibit":[["noun.quantity"],["gibibit","Gibit","tebibit","computer memory unit"]], "terabyte":[["noun.quantity","noun.quantity"],["terabyte","tebibyte","TB","TiB","pebibyte","computer memory unit","terabyte1","TB1","petabyte1","computer memory unit"]], "terabit":[["noun.quantity"],["terabit","Tbit","Tb2","petabit","computer memory unit"]], "tebibit":[["noun.quantity"],["tebibit","Tibit","pebibit","computer memory unit"]], "petabyte":[["noun.quantity","noun.quantity"],["petabyte","pebibyte","PB","PiB","exbibyte","computer memory unit","petabyte1","PB1","exabyte1","computer memory unit"]], "petabit":[["noun.quantity"],["petabit","Pbit","Pb2","exabit","computer memory unit"]], "pebibit":[["noun.quantity"],["pebibit","Pibit","exbibit","computer memory unit"]], "exabyte":[["noun.quantity","noun.quantity"],["exabyte","exbibyte","EB","EiB","zebibyte","computer memory unit","exabyte1","EB1","zettabyte1","computer memory unit"]], "exabit":[["noun.quantity"],["exabit","Ebit","Eb2","zettabit","computer memory unit"]], "exbibit":[["noun.quantity"],["exbibit","Eibit","zebibit","computer memory unit"]], "zettabyte":[["noun.quantity","noun.quantity"],["zettabyte","zebibyte","ZB","ZiB","yobibyte","computer memory unit","zettabyte1","ZB1","yottabyte1","computer memory unit"]], "zettabit":[["noun.quantity"],["zettabit","Zbit","Zb2","yottabit","computer memory unit"]], "zebibit":[["noun.quantity"],["zebibit","Zibit","yobibit","computer memory unit"]], "yottabyte":[["noun.quantity","noun.quantity"],["yottabyte","yobibyte","YB","YiB","computer memory unit","yottabyte1","YB1","computer memory unit"]], "yottabit":[["noun.quantity"],["yottabit","Ybit","Yb2","computer memory unit"]], "yobibit":[["noun.quantity"],["yobibit","Yibit","computer memory unit"]], "capacitance unit":[["noun.quantity"],["capacitance unit","electromagnetic unit"]], "charge unit":[["noun.quantity"],["charge unit","quantity unit","electromagnetic unit"]], "conductance unit":[["noun.quantity"],["conductance unit","electromagnetic unit"]], "current unit":[["noun.quantity"],["current unit","electromagnetic unit"]], "elastance unit":[["noun.quantity"],["elastance unit","electromagnetic unit"]], "field strength unit":[["noun.quantity"],["field strength unit","electromagnetic unit"]], "flux density unit":[["noun.quantity"],["flux density unit","electromagnetic unit"]], "flux unit":[["noun.quantity"],["flux unit","magnetic flux unit","magnetic flux"]], "inductance unit":[["noun.quantity"],["inductance unit","electromagnetic unit"]], "light unit":[["noun.quantity"],["light unit","electromagnetic unit"]], "magnetomotive force unit":[["noun.quantity"],["magnetomotive force unit","electromagnetic unit"]], "potential unit":[["noun.quantity"],["potential unit","electromagnetic unit"]], "power unit":[["noun.quantity"],["power unit","electromagnetic unit"]], "radioactivity unit":[["noun.quantity"],["radioactivity unit","electromagnetic unit"]], "resistance unit":[["noun.quantity"],["resistance unit","electromagnetic unit"]], "electrostatic unit":[["noun.quantity"],["electrostatic unit","unit of measurement"]], "picofarad":[["noun.quantity"],["picofarad","capacitance unit","microfarad"]], "microfarad":[["noun.quantity"],["microfarad","capacitance unit","millifarad"]], "millifarad":[["noun.quantity"],["millifarad","capacitance unit","farad"]], "farad":[["noun.quantity"],["farad","F","capacitance unit","abfarad"]], "abfarad":[["noun.quantity"],["abfarad","capacitance unit"]], "abcoulomb":[["noun.quantity"],["abcoulomb","charge unit"]], "ampere-minute":[["noun.quantity"],["ampere-minute","charge unit","ampere-hour"]], "ampere-hour":[["noun.quantity"],["ampere-hour","charge unit"]], "mho":[["noun.quantity"],["mho","siemens","reciprocal ohm","S","conductance unit"]], "ampere":[["noun.quantity","noun.quantity"],["ampere","amp","A","current unit","abampere","ampere2","international ampere","current unit"]], "milliampere":[["noun.quantity"],["milliampere","mA","current unit","ampere"]], "abampere":[["noun.quantity"],["abampere","abamp","current unit"]], "daraf":[["noun.quantity"],["daraf","elastance unit"]], "microgauss":[["noun.quantity"],["microgauss","flux density unit","gauss"]], "abhenry":[["noun.quantity"],["abhenry","inductance unit","henry"]], "millihenry":[["noun.quantity"],["millihenry","inductance unit","henry"]], "illumination unit":[["noun.quantity"],["illumination unit","light unit"]], "luminance unit":[["noun.quantity"],["luminance unit","light unit"]], "luminous flux unit":[["noun.quantity"],["luminous flux unit","light unit"]], "luminous intensity unit":[["noun.quantity"],["luminous intensity unit","candlepower unit","light unit"]], "footcandle":[["noun.quantity"],["footcandle","illumination unit"]], "lux":[["noun.quantity"],["lux","lx1","illumination unit","phot"]], "phot":[["noun.quantity"],["phot","illumination unit"]], "foot-lambert":[["noun.quantity"],["foot-lambert","ft-L","luminance unit"]], "international candle":[["noun.quantity"],["international candle","luminous intensity unit"]], "ampere-turn":[["noun.quantity"],["ampere-turn","magnetomotive force unit"]], "magneton":[["noun.quantity"],["magneton","magnetomotive force unit"]], "abvolt":[["noun.quantity"],["abvolt","potential unit","volt"]], "millivolt":[["noun.quantity"],["millivolt","mV","potential unit","volt"]], "microvolt":[["noun.quantity"],["microvolt","potential unit","volt"]], "nanovolt":[["noun.quantity"],["nanovolt","potential unit","volt"]], "picovolt":[["noun.quantity"],["picovolt","potential unit","volt"]], "femtovolt":[["noun.quantity"],["femtovolt","potential unit","volt"]], "volt":[["noun.quantity","adj.pert:voltaic"],["volt","V","potential unit","kilovolt"]], "kilovolt":[["noun.quantity"],["kilovolt","kV","potential unit"]], "rydberg":[["noun.quantity"],["rydberg","rydberg constant","rydberg unit","wave number"]], "wave number":[["noun.quantity","noun.time:frequency"],["wave number"]], "abwatt":[["noun.quantity"],["abwatt","power unit","milliwatt"]], "milliwatt":[["noun.quantity"],["milliwatt","power unit","watt"]], "kilowatt":[["noun.quantity"],["kilowatt","kW","power unit","megawatt"]], "megawatt":[["noun.quantity"],["megawatt","power unit"]], "horsepower":[["noun.quantity","H.P."],["horsepower","HP","power unit"]], "volt-ampere":[["noun.quantity"],["volt-ampere","var","power unit","kilovolt-ampere"]], "kilovolt-ampere":[["noun.quantity"],["kilovolt-ampere","power unit"]], "millicurie":[["noun.quantity"],["millicurie","radioactivity unit","curie"]], "rem":[["noun.quantity"],["rem","radioactivity unit"]], "mrem":[["noun.quantity"],["mrem","millirem","radioactivity unit"]], "rad":[["noun.quantity"],["rad","radioactivity unit"]], "abohm":[["noun.quantity"],["abohm","resistance unit","ohm"]], "megohm":[["noun.quantity"],["megohm","resistance unit"]], "kiloton":[["noun.quantity"],["kiloton","avoirdupois unit","megaton"]], "megaton":[["noun.quantity"],["megaton","avoirdupois unit"]], "dyne":[["noun.quantity"],["dyne","force unit","newton"]], "sthene":[["noun.quantity"],["sthene","force unit"]], "poundal":[["noun.quantity"],["poundal","pdl","force unit"]], "pounder":[["noun.quantity","noun.communication:combining form"],["pounder","force unit"]], "astronomy unit":[["noun.quantity"],["astronomy unit","linear unit"]], "metric linear unit":[["noun.quantity"],["metric linear unit","linear unit","metric unit"]], "nautical linear unit":[["noun.quantity"],["nautical linear unit","linear unit"]], "inch":[["noun.quantity","verb.motion:inch","noun.location:US","noun.location:Britain"],["inch","in","linear unit","foot"]], "footer":[["noun.quantity","noun.communication:combining form"],["footer","linear unit"]], "furlong":[["noun.quantity"],["furlong","linear unit","mile1"]], "half mile":[["noun.quantity"],["half mile","880 yards","linear unit","mile1"]], "quarter mile":[["noun.quantity"],["quarter mile","440 yards","linear unit","mile1"]], "ligne":[["noun.quantity"],["ligne","linear unit","inch"]], "archine":[["noun.quantity"],["archine","linear unit"]], "kos":[["noun.quantity"],["kos","coss","linear unit"]], "vara":[["noun.quantity"],["vara","linear unit"]], "verst":[["noun.quantity"],["verst","linear unit"]], "gunter's chain":[["noun.quantity"],["Gunter's chain","chain","furlong"]], "engineer's chain":[["noun.quantity"],["engineer's chain","chain"]], "cubit":[["noun.quantity"],["cubit","linear unit"]], "fistmele":[["noun.quantity"],["fistmele","linear unit"]], "body length":[["noun.quantity"],["body length","linear unit"]], "extremum":[["noun.quantity","adj.all:high3^peaky","verb.motion:peak"],["extremum","peak","limit"]], "handbreadth":[["noun.quantity"],["handbreadth","handsbreadth","linear unit"]], "lea":[["noun.quantity"],["lea","linear unit"]], "li":[["noun.quantity"],["li","linear unit"]], "roman pace":[["noun.quantity"],["Roman pace","linear unit"]], "geometric pace":[["noun.quantity"],["geometric pace","linear unit"]], "military pace":[["noun.quantity"],["military pace","linear unit"]], "survey mile":[["noun.quantity"],["survey mile","linear unit"]], "light year":[["noun.quantity"],["light year","light-year","astronomy unit"]], "light hour":[["noun.quantity"],["light hour","astronomy unit","light year"]], "light minute":[["noun.quantity"],["light minute","astronomy unit","light year"]], "light second":[["noun.quantity"],["light second","astronomy unit","light year"]], "astronomical unit":[["noun.quantity"],["Astronomical Unit","AU","astronomy unit"]], "parsec":[["noun.quantity"],["parsec","secpar","astronomy unit"]], "femtometer":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["femtometer","femtometre","fermi","metric linear unit","picometer"]], "picometer":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["picometer","picometre","micromicron","metric linear unit","angstrom"]], "angstrom":[["noun.quantity"],["angstrom","angstrom unit","A1","metric linear unit","nanometer"]], "nanometer":[["noun.quantity","noun.location:Canada","noun.location:Britain","noun.location:Canada","noun.location:Britain"],["nanometer","nanometre","nm","millimicron","micromillimeter","micromillimetre","metric linear unit","micron"]], "micron":[["noun.quantity"],["micron","micrometer","metric linear unit","millimeter"]], "millimeter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["millimeter","millimetre","mm","metric linear unit","centimeter"]], "centimeter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["centimeter","centimetre","cm","metric linear unit","decimeter"]], "decimeter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["decimeter","decimetre","dm","metric linear unit","meter"]], "decameter":[["noun.quantity","noun.location:Canada","noun.location:Britain","noun.location:Canada","noun.location:Britain"],["decameter","dekameter","decametre","dekametre","dam","dkm","metric linear unit","hectometer"]], "hectometer":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["hectometer","hectometre","hm","metric linear unit","kilometer"]], "kilometer":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["kilometer","kilometre","km","klick","metric linear unit","myriameter"]], "myriameter":[["noun.quantity","noun.location:Canada","noun.location:Britain"],["myriameter","myriametre","mym","metric linear unit"]], "nautical chain":[["noun.quantity"],["nautical chain","chain"]], "nautical mile":[["noun.quantity","noun.quantity:miler","noun.quantity","noun.quantity:miler"],["nautical mile1","mile4","mi4","naut mi","international nautical mile","air mile","nautical linear unit","nautical mile2","naut mi1","mile6","mi5","geographical mile","Admiralty mile","nautical linear unit"]], "sea mile":[["noun.quantity","noun.quantity:miler"],["sea mile","mile5","nautical linear unit"]], "halfpennyworth":[["noun.quantity"],["halfpennyworth","ha'p'orth","worth"]], "pennyworth":[["noun.quantity"],["pennyworth","penn'orth","worth"]], "euro":[["noun.quantity"],["euro","monetary unit"]], "franc":[["noun.quantity"],["franc","monetary unit"]], "fractional monetary unit":[["noun.quantity"],["fractional monetary unit","subunit","monetary unit"]], "afghan monetary unit":[["noun.quantity"],["Afghan monetary unit","monetary unit"]], "afghani":[["noun.quantity"],["afghani","Afghan monetary unit"]], "pul":[["noun.quantity"],["pul","afghani","Afghan monetary unit"]], "argentine monetary unit":[["noun.quantity"],["Argentine monetary unit","monetary unit"]], "austral":[["noun.quantity"],["austral","Argentine monetary unit"]], "thai monetary unit":[["noun.quantity"],["Thai monetary unit","monetary unit"]], "baht":[["noun.quantity"],["baht","tical","Thai monetary unit"]], "satang":[["noun.quantity"],["satang","baht","Thai monetary unit"]], "panamanian monetary unit":[["noun.quantity"],["Panamanian monetary unit","monetary unit"]], "ethiopian monetary unit":[["noun.quantity"],["Ethiopian monetary unit","monetary unit"]], "birr":[["noun.quantity"],["birr","Ethiopian monetary unit"]], "cent":[["noun.quantity"],["cent","fractional monetary unit","birr","dollar","gulden1","leone","lilangeni","rand","Mauritian rupee","Seychelles rupee","Sri Lanka rupee","shilling1"]], "centesimo":[["noun.quantity"],["centesimo","fractional monetary unit","balboa","Italian lira","Uruguayan peso","Chilean peso"]], "centimo":[["noun.quantity"],["centimo","fractional monetary unit","bolivar","Costa Rican colon","guarani","peseta"]], "centavo":[["noun.quantity"],["centavo","fractional monetary unit","austral","El Salvadoran colon","dobra","escudo1","escudo2","cordoba","lempira","metical","boliviano","peso3","peso4","peso5","peso6","peso7","peso8","peso10","quetzal","real1","sucre"]], "centime":[["noun.quantity"],["centime","fractional monetary unit","franc","Algerian dinar","Belgian franc","Burkina Faso franc","Burundi franc","Cameroon franc","Chadian franc","Congo franc","Gabon franc","Ivory Coast franc","Luxembourg franc","Mali franc","Moroccan dirham","Niger franc","Rwanda franc","Senegalese franc","Swiss franc","Togo franc"]], "venezuelan monetary unit":[["noun.quantity"],["Venezuelan monetary unit","monetary unit"]], "ghanian monetary unit":[["noun.quantity"],["Ghanian monetary unit","monetary unit"]], "cedi":[["noun.quantity"],["cedi","Ghanian monetary unit"]], "pesewa":[["noun.quantity"],["pesewa","cedi","Ghanian monetary unit"]], "costa rican monetary unit":[["noun.quantity"],["Costa Rican monetary unit","monetary unit"]], "el salvadoran monetary unit":[["noun.quantity"],["El Salvadoran monetary unit","monetary unit"]], "brazilian monetary unit":[["noun.quantity"],["Brazilian monetary unit","monetary unit"]], "gambian monetary unit":[["noun.quantity"],["Gambian monetary unit","monetary unit"]], "dalasi":[["noun.quantity"],["dalasi","Gambian monetary unit"]], "butut":[["noun.quantity"],["butut","butat","dalasi","Gambian monetary unit"]], "algerian monetary unit":[["noun.quantity"],["Algerian monetary unit","monetary unit"]], "algerian dinar":[["noun.quantity"],["Algerian dinar","dinar","Algerian monetary unit"]], "algerian centime":[["noun.quantity"],["Algerian centime","centime","Algerian dinar"]], "bahrainian monetary unit":[["noun.quantity"],["Bahrainian monetary unit","monetary unit"]], "bahrain dinar":[["noun.quantity"],["Bahrain dinar","dinar1","Bahrainian monetary unit"]], "fils":[["noun.quantity"],["fils","fractional monetary unit","Bahrain dinar","Iraqi dinar","Jordanian dinar","Kuwaiti dirham"]], "iraqi monetary unit":[["noun.quantity"],["Iraqi monetary unit","monetary unit"]], "iraqi dinar":[["noun.quantity"],["Iraqi dinar","dinar2","Iraqi monetary unit"]], "jordanian monetary unit":[["noun.quantity"],["Jordanian monetary unit","monetary unit"]], "jordanian dinar":[["noun.quantity"],["Jordanian dinar","dinar3","Jordanian monetary unit"]], "kuwaiti monetary unit":[["noun.quantity"],["Kuwaiti monetary unit","monetary unit"]], "kuwaiti dinar":[["noun.quantity"],["Kuwaiti dinar","dinar4","Kuwaiti monetary unit"]], "kuwaiti dirham":[["noun.quantity"],["Kuwaiti dirham","dirham1","Kuwaiti monetary unit","Kuwaiti dinar"]], "libyan monetary unit":[["noun.quantity"],["Libyan monetary unit","monetary unit"]], "libyan dinar":[["noun.quantity"],["Libyan dinar","dinar5","Libyan monetary unit"]], "libyan dirham":[["noun.quantity"],["Libyan dirham","dirham2","Libyan monetary unit","Libyan dinar"]], "tunisian monetary unit":[["noun.quantity"],["Tunisian monetary unit","monetary unit"]], "tunisian dinar":[["noun.quantity"],["Tunisian dinar","dinar7","Tunisian monetary unit"]], "tunisian dirham":[["noun.quantity"],["Tunisian dirham","dirham3","Tunisian monetary unit","Tunisian dinar"]], "millime":[["noun.quantity"],["millime","Tunisian monetary unit","Tunisian dirham"]], "yugoslavian monetary unit":[["noun.quantity"],["Yugoslavian monetary unit","monetary unit"]], "yugoslavian dinar":[["noun.quantity"],["Yugoslavian dinar","dinar8","Yugoslavian monetary unit"]], "moroccan monetary unit":[["noun.quantity"],["Moroccan monetary unit","monetary unit"]], "moroccan dirham":[["noun.quantity"],["Moroccan dirham","dirham4","Moroccan monetary unit"]], "united arab emirate monetary unit":[["noun.quantity"],["United Arab Emirate monetary unit","monetary unit"]], "united arab emirate dirham":[["noun.quantity"],["United Arab Emirate dirham","dirham5","United Arab Emirate monetary unit"]], "australian dollar":[["noun.quantity"],["Australian dollar","dollar"]], "bahamian dollar":[["noun.quantity"],["Bahamian dollar","dollar"]], "barbados dollar":[["noun.quantity"],["Barbados dollar","dollar"]], "belize dollar":[["noun.quantity"],["Belize dollar","dollar"]], "bermuda dollar":[["noun.quantity"],["Bermuda dollar","dollar"]], "brunei dollar":[["noun.quantity"],["Brunei dollar","dollar"]], "sen":[["noun.quantity"],["sen","fractional monetary unit","rupiah","riel","ringgit","yen"]], "canadian dollar":[["noun.quantity"],["Canadian dollar","loonie","dollar"]], "cayman islands dollar":[["noun.quantity"],["Cayman Islands dollar","dollar"]], "dominican dollar":[["noun.quantity"],["Dominican dollar","dollar"]], "fiji dollar":[["noun.quantity"],["Fiji dollar","dollar"]], "grenada dollar":[["noun.quantity"],["Grenada dollar","dollar"]], "guyana dollar":[["noun.quantity"],["Guyana dollar","dollar"]], "hong kong dollar":[["noun.quantity"],["Hong Kong dollar","dollar"]], "jamaican dollar":[["noun.quantity"],["Jamaican dollar","dollar"]], "kiribati dollar":[["noun.quantity"],["Kiribati dollar","dollar"]], "liberian dollar":[["noun.quantity"],["Liberian dollar","dollar"]], "new zealand dollar":[["noun.quantity"],["New Zealand dollar","dollar"]], "singapore dollar":[["noun.quantity"],["Singapore dollar","dollar"]], "taiwan dollar":[["noun.quantity"],["Taiwan dollar","dollar"]], "trinidad and tobago dollar":[["noun.quantity"],["Trinidad and Tobago dollar","dollar"]], "tuvalu dollar":[["noun.quantity"],["Tuvalu dollar","dollar"]], "united states dollar":[["noun.quantity"],["United States dollar","dollar"]], "eurodollar":[["noun.quantity","noun.possession:Eurocurrency"],["Eurodollar","United States dollar"]], "zimbabwean dollar":[["noun.quantity"],["Zimbabwean dollar","dollar"]], "vietnamese monetary unit":[["noun.quantity"],["Vietnamese monetary unit","monetary unit"]], "dong":[["noun.quantity"],["dong","Vietnamese monetary unit"]], "hao":[["noun.quantity"],["hao","dong","Vietnamese monetary unit"]], "greek monetary unit":[["noun.quantity"],["Greek monetary unit","monetary unit"]], "drachma":[["noun.quantity"],["drachma","Greek drachma","Greek monetary unit"]], "sao thome e principe monetary unit":[["noun.quantity"],["Sao Thome e Principe monetary unit","monetary unit"]], "dobra":[["noun.quantity"],["dobra","Sao Thome e Principe monetary unit"]], "cape verde monetary unit":[["noun.quantity"],["Cape Verde monetary unit","monetary unit"]], "cape verde escudo":[["noun.quantity"],["Cape Verde escudo","escudo1","Cape Verde monetary unit"]], "portuguese monetary unit":[["noun.quantity"],["Portuguese monetary unit","monetary unit"]], "portuguese escudo":[["noun.quantity"],["Portuguese escudo","escudo2","Portuguese monetary unit","conto"]], "conto":[["noun.quantity"],["conto","Portuguese monetary unit"]], "hungarian monetary unit":[["noun.quantity"],["Hungarian monetary unit","monetary unit"]], "forint":[["noun.quantity"],["forint","Hungarian monetary unit"]], "belgian franc":[["noun.quantity"],["Belgian franc","franc"]], "benin franc":[["noun.quantity"],["Benin franc","franc"]], "burundi franc":[["noun.quantity"],["Burundi franc","franc"]], "cameroon franc":[["noun.quantity"],["Cameroon franc","franc"]], "central african republic franc":[["noun.quantity"],["Central African Republic franc","franc"]], "chadian franc":[["noun.quantity"],["Chadian franc","franc"]], "congo franc":[["noun.quantity"],["Congo franc","franc"]], "djibouti franc":[["noun.quantity"],["Djibouti franc","franc"]], "french franc":[["noun.quantity"],["French franc","franc"]], "gabon franc":[["noun.quantity"],["Gabon franc","franc"]], "ivory coast franc":[["noun.quantity"],["Ivory Coast franc","Cote d'Ivoire franc","franc"]], "luxembourg franc":[["noun.quantity"],["Luxembourg franc","franc"]], "madagascar franc":[["noun.quantity"],["Madagascar franc","franc"]], "mali franc":[["noun.quantity"],["Mali franc","franc"]], "niger franc":[["noun.quantity"],["Niger franc","franc"]], "rwanda franc":[["noun.quantity"],["Rwanda franc","franc"]], "senegalese franc":[["noun.quantity"],["Senegalese franc","franc"]], "swiss franc":[["noun.quantity"],["Swiss franc","franc"]], "togo franc":[["noun.quantity"],["Togo franc","franc"]], "burkina faso franc":[["noun.quantity"],["Burkina Faso franc","franc"]], "haitian monetary unit":[["noun.quantity"],["Haitian monetary unit","monetary unit"]], "gourde":[["noun.quantity"],["gourde","Haitian monetary unit"]], "haitian centime":[["noun.quantity"],["Haitian centime","centime","gourde"]], "paraguayan monetary unit":[["noun.quantity"],["Paraguayan monetary unit","monetary unit"]], "dutch monetary unit":[["noun.quantity"],["Dutch monetary unit","monetary unit"]], "guilder":[["noun.quantity","noun.quantity"],["guilder1","gulden1","florin1","Dutch florin","Dutch monetary unit","guilder2","gulden2","florin2","Surinamese monetary unit"]], "surinamese monetary unit":[["noun.quantity"],["Surinamese monetary unit","monetary unit"]], "peruvian monetary unit":[["noun.quantity"],["Peruvian monetary unit","monetary unit"]], "inti":[["noun.quantity"],["inti","Peruvian monetary unit"]], "papuan monetary unit":[["noun.quantity"],["Papuan monetary unit","monetary unit"]], "kina":[["noun.quantity"],["kina","Papuan monetary unit"]], "toea":[["noun.quantity"],["toea","kina","Papuan monetary unit"]], "laotian monetary unit":[["noun.quantity"],["Laotian monetary unit","monetary unit"]], "at":[["noun.quantity"],["at","kip","Laotian monetary unit"]], "czech monetary unit":[["noun.quantity"],["Czech monetary unit","monetary unit"]], "koruna":[["noun.quantity","noun.quantity"],["koruna","Czech monetary unit","koruna1","Slovakian monetary unit"]], "haler":[["noun.quantity","noun.quantity"],["haler","heller","koruna","Czech monetary unit","haler1","heller1","Slovakian monetary unit","koruna"]], "slovakian monetary unit":[["noun.quantity"],["Slovakian monetary unit","monetary unit"]], "icelandic monetary unit":[["noun.quantity"],["Icelandic monetary unit","monetary unit"]], "icelandic krona":[["noun.quantity"],["Icelandic krona","krona1","Icelandic monetary unit"]], "eyrir":[["noun.quantity"],["eyrir","Icelandic krona","Icelandic monetary unit"]], "swedish monetary unit":[["noun.quantity"],["Swedish monetary unit","monetary unit"]], "swedish krona":[["noun.quantity"],["Swedish krona","krona2","Swedish monetary unit"]], "danish monetary unit":[["noun.quantity"],["Danish monetary unit","monetary unit"]], "danish krone":[["noun.quantity"],["Danish krone","krone1","Danish monetary unit"]], "norwegian monetary unit":[["noun.quantity"],["Norwegian monetary unit","monetary unit"]], "norwegian krone":[["noun.quantity"],["Norwegian krone","krone2","Norwegian monetary unit"]], "malawian monetary unit":[["noun.quantity"],["Malawian monetary unit","monetary unit"]], "malawi kwacha":[["noun.quantity"],["Malawi kwacha","kwacha1","Malawian monetary unit"]], "tambala":[["noun.quantity"],["tambala","Malawi kwacha","Malawian monetary unit"]], "zambian monetary unit":[["noun.quantity"],["Zambian monetary unit","monetary unit"]], "zambian kwacha":[["noun.quantity"],["Zambian kwacha","kwacha2","Zambian monetary unit"]], "ngwee":[["noun.quantity"],["ngwee","Zambian kwacha","Zambian monetary unit"]], "angolan monetary unit":[["noun.quantity"],["Angolan monetary unit","monetary unit"]], "kwanza":[["noun.quantity"],["kwanza","Angolan monetary unit"]], "lwei":[["noun.quantity"],["lwei","kwanza","Angolan monetary unit"]], "myanmar monetary unit":[["noun.quantity","noun.location:Burma"],["Myanmar monetary unit","monetary unit"]], "kyat":[["noun.quantity"],["kyat","Myanmar monetary unit"]], "pya":[["noun.quantity"],["pya","kyat","Myanmar monetary unit"]], "albanian monetary unit":[["noun.quantity"],["Albanian monetary unit","monetary unit"]], "lek":[["noun.quantity"],["lek","Albanian monetary unit"]], "qindarka":[["noun.quantity"],["qindarka","qintar","lek","Albanian monetary unit"]], "honduran monetary unit":[["noun.quantity"],["Honduran monetary unit","monetary unit"]], "lempira":[["noun.quantity"],["lempira","Honduran monetary unit"]], "sierra leone monetary unit":[["noun.quantity"],["Sierra Leone monetary unit","monetary unit"]], "leone":[["noun.quantity"],["leone","Sierra Leone monetary unit"]], "romanian monetary unit":[["noun.quantity"],["Romanian monetary unit","monetary unit"]], "leu":[["noun.quantity","noun.quantity"],["leu","Romanian monetary unit","leu1","Moldovan monetary unit"]], "bulgarian monetary unit":[["noun.quantity"],["Bulgarian monetary unit","monetary unit"]], "lev":[["noun.quantity"],["lev","Bulgarian monetary unit"]], "stotinka":[["noun.quantity"],["stotinka","lev","Bulgarian monetary unit"]], "swaziland monetary unit":[["noun.quantity"],["Swaziland monetary unit","monetary unit"]], "lilangeni":[["noun.quantity"],["lilangeni","Swaziland monetary unit"]], "italian monetary unit":[["noun.quantity"],["Italian monetary unit","monetary unit"]], "lira":[["noun.quantity","noun.quantity","noun.quantity"],["lira1","Italian lira","Italian monetary unit","lira2","Turkish lira","Turkish monetary unit","lira3","Maltese lira","Maltese monetary unit"]], "british monetary unit":[["noun.quantity"],["British monetary unit","monetary unit"]], "british pound":[["noun.quantity"],["British pound","pound1","British pound sterling","pound sterling","quid","British monetary unit"]], "british shilling":[["noun.quantity"],["British shilling","shilling1","bob","British monetary unit"]], "turkish monetary unit":[["noun.quantity"],["Turkish monetary unit","monetary unit"]], "kurus":[["noun.quantity"],["kurus","piaster1","piastre1","lira2","Turkish monetary unit"]], "asper":[["noun.quantity"],["asper","kurus","Turkish monetary unit"]], "lesotho monetary unit":[["noun.quantity"],["Lesotho monetary unit","monetary unit"]], "loti":[["noun.quantity"],["loti","Lesotho monetary unit"]], "sente":[["noun.quantity"],["sente","loti","Lesotho monetary unit"]], "german monetary unit":[["noun.quantity"],["German monetary unit","monetary unit"]], "pfennig":[["noun.quantity"],["pfennig","German monetary unit","mark"]], "finnish monetary unit":[["noun.quantity"],["Finnish monetary unit","monetary unit"]], "markka":[["noun.quantity"],["markka","Finnish mark","Finnish monetary unit"]], "penni":[["noun.quantity"],["penni","markka","Finnish monetary unit"]], "mozambique monetary unit":[["noun.quantity"],["Mozambique monetary unit","monetary unit"]], "metical":[["noun.quantity"],["metical","Mozambique monetary unit"]], "nigerian monetary unit":[["noun.quantity"],["Nigerian monetary unit","monetary unit"]], "naira":[["noun.quantity"],["naira","Nigerian monetary unit"]], "kobo":[["noun.quantity"],["kobo","naira","Nigerian monetary unit"]], "bhutanese monetary unit":[["noun.quantity"],["Bhutanese monetary unit","monetary unit"]], "ngultrum":[["noun.quantity"],["ngultrum","Bhutanese monetary unit"]], "chetrum":[["noun.quantity"],["chetrum","ngultrum","Bhutanese monetary unit"]], "mauritanian monetary unit":[["noun.quantity"],["Mauritanian monetary unit","monetary unit"]], "ouguiya":[["noun.quantity"],["ouguiya","Mauritanian monetary unit"]], "khoum":[["noun.quantity"],["khoum","ouguiya","Mauritanian monetary unit"]], "tongan monetary unit":[["noun.quantity"],["Tongan monetary unit","monetary unit"]], "pa'anga":[["noun.quantity"],["pa'anga","Tongan monetary unit"]], "seniti":[["noun.quantity"],["seniti","pa'anga","Tongan monetary unit"]], "macao monetary unit":[["noun.quantity"],["Macao monetary unit","monetary unit"]], "pataca":[["noun.quantity"],["pataca","Macao monetary unit"]], "avo":[["noun.quantity"],["avo","pataca","Macao monetary unit"]], "spanish monetary unit":[["noun.quantity"],["Spanish monetary unit","monetary unit"]], "peseta":[["noun.quantity"],["peseta","Spanish peseta","Spanish monetary unit"]], "bolivian monetary unit":[["noun.quantity"],["Bolivian monetary unit","monetary unit"]], "boliviano":[["noun.quantity"],["boliviano","Bolivian monetary unit"]], "nicaraguan monetary unit":[["noun.quantity"],["Nicaraguan monetary unit","monetary unit"]], "chilean monetary unit":[["noun.quantity"],["Chilean monetary unit","monetary unit"]], "chilean peso":[["noun.quantity"],["Chilean peso","peso9","Chilean monetary unit"]], "colombian monetary unit":[["noun.quantity"],["Colombian monetary unit","monetary unit"]], "colombian peso":[["noun.quantity"],["Colombian peso","peso3","Colombian monetary unit"]], "cuban monetary unit":[["noun.quantity"],["Cuban monetary unit","monetary unit"]], "cuban peso":[["noun.quantity"],["Cuban peso","peso4","Cuban monetary unit"]], "dominican monetary unit":[["noun.quantity"],["Dominican monetary unit","monetary unit"]], "dominican peso":[["noun.quantity"],["Dominican peso","peso5","Dominican monetary unit"]], "guinea-bissau monetary unit":[["noun.quantity"],["Guinea-Bissau monetary unit","monetary unit"]], "guinea-bissau peso":[["noun.quantity"],["Guinea-Bissau peso","peso10","Guinea-Bissau monetary unit"]], "mexican monetary unit":[["noun.quantity"],["Mexican monetary unit","monetary unit"]], "mexican peso":[["noun.quantity"],["Mexican peso","peso6","Mexican monetary unit"]], "philippine monetary unit":[["noun.quantity"],["Philippine monetary unit","monetary unit"]], "philippine peso":[["noun.quantity"],["Philippine peso","peso7","Philippine monetary unit"]], "uruguayan monetary unit":[["noun.quantity"],["Uruguayan monetary unit","monetary unit"]], "uruguayan peso":[["noun.quantity"],["Uruguayan peso","peso8","Uruguayan monetary unit"]], "cypriot monetary unit":[["noun.quantity"],["Cypriot monetary unit","monetary unit"]], "cypriot pound":[["noun.quantity"],["Cypriot pound","pound2","Cypriot monetary unit"]], "egyptian monetary unit":[["noun.quantity"],["Egyptian monetary unit","monetary unit"]], "egyptian pound":[["noun.quantity"],["Egyptian pound","pound3","Egyptian monetary unit"]], "piaster":[["noun.quantity"],["piaster","piastre","fractional monetary unit","Egyptian pound","Lebanese pound","Sudanese pound","Syrian pound"]], "irish monetary unit":[["noun.quantity"],["Irish monetary unit","monetary unit"]], "irish pound":[["noun.quantity"],["Irish pound","Irish punt","punt","pound4","Irish monetary unit"]], "lebanese monetary unit":[["noun.quantity"],["Lebanese monetary unit","monetary unit"]], "lebanese pound":[["noun.quantity"],["Lebanese pound","pound5","Lebanese monetary unit"]], "maltese monetary unit":[["noun.quantity"],["Maltese monetary unit","monetary unit"]], "sudanese monetary unit":[["noun.quantity"],["Sudanese monetary unit","monetary unit"]], "sudanese pound":[["noun.quantity"],["Sudanese pound","pound7","Sudanese monetary unit"]], "syrian monetary unit":[["noun.quantity"],["Syrian monetary unit","monetary unit"]], "syrian pound":[["noun.quantity"],["Syrian pound","pound8","Syrian monetary unit"]], "botswana monetary unit":[["noun.quantity"],["Botswana monetary unit","monetary unit"]], "pula":[["noun.quantity"],["pula","Botswana monetary unit"]], "thebe":[["noun.quantity"],["thebe","pula","Botswana monetary unit"]], "guatemalan monetary unit":[["noun.quantity"],["Guatemalan monetary unit","monetary unit"]], "south african monetary unit":[["noun.quantity"],["South African monetary unit","monetary unit"]], "iranian monetary unit":[["noun.quantity"],["Iranian monetary unit","monetary unit"]], "iranian rial":[["noun.quantity"],["Iranian rial","rial1","Iranian monetary unit"]], "iranian dinar":[["noun.quantity"],["Iranian dinar","dinar9","Iranian monetary unit","Iranian rial"]], "omani monetary unit":[["noun.quantity"],["Omani monetary unit","monetary unit"]], "riyal-omani":[["noun.quantity"],["riyal-omani","Omani rial","rial2","Omani monetary unit"]], "baiza":[["noun.quantity"],["baiza","baisa","Omani monetary unit","riyal-omani"]], "yemeni monetary unit":[["noun.quantity"],["Yemeni monetary unit","monetary unit"]], "yemeni rial":[["noun.quantity"],["Yemeni rial","rial","Yemeni monetary unit"]], "yemeni fils":[["noun.quantity"],["Yemeni fils","fils1","Yemeni monetary unit"]], "cambodian monetary unit":[["noun.quantity"],["Cambodian monetary unit","monetary unit"]], "riel":[["noun.quantity"],["riel","Cambodian monetary unit"]], "malaysian monetary unit":[["noun.quantity"],["Malaysian monetary unit","monetary unit"]], "ringgit":[["noun.quantity"],["ringgit","Malaysian monetary unit"]], "qatari monetary unit":[["noun.quantity"],["Qatari monetary unit","monetary unit"]], "qatari riyal":[["noun.quantity"],["Qatari riyal","riyal2","Qatari monetary unit"]], "qatari dirham":[["noun.quantity"],["Qatari dirham","dirham6","Qatari monetary unit","Qatari riyal"]], "saudi arabian monetary unit":[["noun.quantity"],["Saudi Arabian monetary unit","monetary unit"]], "saudi arabian riyal":[["noun.quantity"],["Saudi Arabian riyal","riyal3","Saudi Arabian monetary unit"]], "qurush":[["noun.quantity"],["qurush","Saudi Arabian riyal","Saudi Arabian monetary unit"]], "russian monetary unit":[["noun.quantity"],["Russian monetary unit","monetary unit"]], "ruble":[["noun.quantity","noun.quantity"],["ruble","rouble","Russian monetary unit","ruble1","Tajikistani monetary unit"]], "kopek":[["noun.quantity"],["kopek","kopeck","copeck","ruble","Russian monetary unit"]], "armenian monetary unit":[["noun.quantity"],["Armenian monetary unit","monetary unit"]], "dram":[["noun.quantity","noun.quantity","noun.quantity"],["dram","Armenian monetary unit","dram1","avoirdupois unit","ounce1","dram2","drachm","drachma2","apothecaries' unit","ounce2"]], "lumma":[["noun.quantity"],["lumma","Armenian monetary unit"]], "azerbaijani monetary unit":[["noun.quantity"],["Azerbaijani monetary unit","monetary unit"]], "manat":[["noun.quantity","noun.quantity"],["manat","Azerbaijani monetary unit","manat1","Turkmen monetary unit"]], "qepiq":[["noun.quantity"],["qepiq","Azerbaijani monetary unit"]], "belarusian monetary unit":[["noun.quantity"],["Belarusian monetary unit","monetary unit"]], "rubel":[["noun.quantity"],["rubel","Belarusian monetary unit"]], "kapeika":[["noun.quantity"],["kapeika","Belarusian monetary unit"]], "estonian monetary unit":[["noun.quantity"],["Estonian monetary unit","monetary unit"]], "kroon":[["noun.quantity"],["kroon","Estonian monetary unit"]], "sent":[["noun.quantity"],["sent","Estonian monetary unit"]], "georgian monetary unit":[["noun.quantity"],["Georgian monetary unit","monetary unit"]], "tetri":[["noun.quantity"],["tetri","Georgian monetary unit","lari"]], "kazakhstani monetary unit":[["noun.quantity"],["Kazakhstani monetary unit","monetary unit"]], "tenge":[["noun.quantity","noun.quantity"],["tenge","Kazakhstani monetary unit","tenge1","Turkmen monetary unit"]], "tiyin":[["noun.quantity","noun.quantity"],["tiyin","Kazakhstani monetary unit","tiyin1","Uzbekistani monetary unit"]], "latvian monetary unit":[["noun.quantity"],["Latvian monetary unit","monetary unit"]], "lats":[["noun.quantity"],["lats","Latvian monetary unit"]], "santims":[["noun.quantity"],["santims","Latvian monetary unit"]], "lithuanian monetary unit":[["noun.quantity"],["Lithuanian monetary unit","monetary unit"]], "litas":[["noun.quantity"],["litas","Lithuanian monetary unit"]], "centas":[["noun.quantity"],["centas","Lithuanian monetary unit"]], "kyrgyzstani monetary unit":[["noun.quantity"],["Kyrgyzstani monetary unit","monetary unit"]], "som":[["noun.quantity","noun.quantity"],["som","Kyrgyzstani monetary unit","som1","Uzbekistani monetary unit"]], "tyiyn":[["noun.quantity"],["tyiyn","Kyrgyzstani monetary unit"]], "moldovan monetary unit":[["noun.quantity"],["Moldovan monetary unit","monetary unit"]], "tajikistani monetary unit":[["noun.quantity"],["Tajikistani monetary unit","monetary unit"]], "turkmen monetary unit":[["noun.quantity"],["Turkmen monetary unit","monetary unit"]], "ukranian monetary unit":[["noun.quantity"],["Ukranian monetary unit","monetary unit"]], "hryvnia":[["noun.quantity"],["hryvnia","Ukranian monetary unit"]], "kopiyka":[["noun.quantity"],["kopiyka","Ukranian monetary unit","hryvnia"]], "uzbekistani monetary unit":[["noun.quantity"],["Uzbekistani monetary unit","monetary unit"]], "indian monetary unit":[["noun.quantity"],["Indian monetary unit","monetary unit"]], "indian rupee":[["noun.quantity"],["Indian rupee","rupee1","Indian monetary unit"]], "paisa":[["noun.quantity"],["paisa","fractional monetary unit","Indian rupee","Nepalese rupee","Pakistani rupee","taka"]], "pakistani monetary unit":[["noun.quantity"],["Pakistani monetary unit","monetary unit"]], "pakistani rupee":[["noun.quantity"],["Pakistani rupee","rupee2","Pakistani monetary unit"]], "anna":[["noun.quantity"],["anna","Pakistani monetary unit","Indian monetary unit"]], "mauritian monetary unit":[["noun.quantity"],["Mauritian monetary unit","monetary unit"]], "mauritian rupee":[["noun.quantity"],["Mauritian rupee","rupee3","Mauritian monetary unit"]], "nepalese monetary unit":[["noun.quantity"],["Nepalese monetary unit","monetary unit"]], "nepalese rupee":[["noun.quantity"],["Nepalese rupee","rupee4","Nepalese monetary unit"]], "seychelles monetary unit":[["noun.quantity"],["Seychelles monetary unit","monetary unit"]], "seychelles rupee":[["noun.quantity"],["Seychelles rupee","rupee5","Seychelles monetary unit"]], "sri lankan monetary unit":[["noun.quantity"],["Sri Lankan monetary unit","monetary unit"]], "sri lanka rupee":[["noun.quantity"],["Sri Lanka rupee","rupee6","Sri Lankan monetary unit"]], "indonesian monetary unit":[["noun.quantity"],["Indonesian monetary unit","monetary unit"]], "rupiah":[["noun.quantity"],["rupiah","Indonesian monetary unit"]], "austrian monetary unit":[["noun.quantity"],["Austrian monetary unit","monetary unit"]], "schilling":[["noun.quantity"],["schilling","Austrian schilling","Austrian monetary unit"]], "groschen":[["noun.quantity"],["groschen","schilling","Austrian monetary unit"]], "israeli monetary unit":[["noun.quantity"],["Israeli monetary unit","monetary unit"]], "shekel":[["noun.quantity"],["shekel","Israeli monetary unit"]], "kenyan monetary unit":[["noun.quantity"],["Kenyan monetary unit","monetary unit"]], "kenyan shilling":[["noun.quantity"],["Kenyan shilling","shilling2","kenyan monetary unit"]], "somalian monetary unit":[["noun.quantity"],["Somalian monetary unit","monetary unit"]], "somalian shilling":[["noun.quantity"],["Somalian shilling","shilling3","Somalian monetary unit"]], "tanzanian monetary unit":[["noun.quantity"],["Tanzanian monetary unit","monetary unit"]], "tanzanian shilling":[["noun.quantity"],["Tanzanian shilling","shilling4","Tanzanian monetary unit"]], "ugandan monetary unit":[["noun.quantity"],["Ugandan monetary unit","monetary unit"]], "ugandan shilling":[["noun.quantity"],["Ugandan shilling","shilling5","Ugandan monetary unit"]], "ecuadoran monetary unit":[["noun.quantity"],["Ecuadoran monetary unit","monetary unit"]], "guinean monetary unit":[["noun.quantity"],["Guinean monetary unit","monetary unit"]], "guinean franc":[["noun.quantity"],["Guinean franc","franc"]], "bangladeshi monetary unit":[["noun.quantity"],["Bangladeshi monetary unit","monetary unit"]], "taka":[["noun.quantity"],["taka","Bangladeshi monetary unit"]], "western samoan monetary unit":[["noun.quantity"],["Western Samoan monetary unit","monetary unit"]], "tala":[["noun.quantity"],["tala","Western Samoan monetary unit"]], "sene":[["noun.quantity"],["sene","tala","Western Samoan monetary unit"]], "mongolian monetary unit":[["noun.quantity"],["Mongolian monetary unit","monetary unit"]], "tugrik":[["noun.quantity"],["tugrik","tughrik","Mongolian monetary unit"]], "mongo":[["noun.quantity"],["mongo","tugrik","Mongolian monetary unit"]], "north korean monetary unit":[["noun.quantity"],["North Korean monetary unit","monetary unit"]], "north korean won":[["noun.quantity"],["North Korean won","won1","North Korean monetary unit"]], "chon":[["noun.quantity","noun.quantity"],["chon1","North Korean monetary unit","North Korean won","chon2","South Korean monetary unit","South Korean won"]], "south korean monetary unit":[["noun.quantity"],["South Korean monetary unit","monetary unit"]], "south korean won":[["noun.quantity"],["South Korean won","won2","South Korean monetary unit"]], "japanese monetary unit":[["noun.quantity"],["Japanese monetary unit","monetary unit"]], "yen":[["noun.quantity"],["yen","Japanese monetary unit"]], "chinese monetary unit":[["noun.quantity"],["Chinese monetary unit","monetary unit"]], "jiao":[["noun.quantity"],["jiao","yuan","Chinese monetary unit"]], "fen":[["noun.quantity"],["fen","Chinese monetary unit","jiao"]], "zairese monetary unit":[["noun.quantity"],["Zairese monetary unit","monetary unit"]], "zaire":[["noun.quantity"],["zaire","Zairese monetary unit"]], "likuta":[["noun.quantity"],["likuta","zaire","Zairese monetary unit"]], "polish monetary unit":[["noun.quantity"],["Polish monetary unit","monetary unit"]], "zloty":[["noun.quantity"],["zloty","Polish monetary unit"]], "grosz":[["noun.quantity"],["grosz","zloty","Polish monetary unit"]], "dol":[["noun.quantity"],["dol","pain unit"]], "standard atmosphere":[["noun.quantity"],["standard atmosphere","atmosphere","atm","standard pressure","pressure unit"]], "torr":[["noun.quantity"],["torr","millimeter of mercury","mm Hg","pressure unit"]], "pounds per square inch":[["noun.quantity"],["pounds per square inch","psi","pressure unit"]], "millibar":[["noun.quantity"],["millibar","pressure unit","bar"]], "barye":[["noun.quantity"],["barye","bar absolute","microbar","pressure unit","bar"]], "em":[["noun.quantity","noun.quantity"],["em2","pica em","pica","linear unit","inch","em1","em quad","mutton quad","area unit"]], "en":[["noun.quantity"],["en","nut","linear unit","em2"]], "agate line":[["noun.quantity"],["agate line","line","area unit"]], "milline":[["noun.quantity"],["milline","printing unit"]], "column inch":[["noun.quantity"],["column inch","inch2","area unit"]], "decibel":[["noun.quantity"],["decibel","dB","sound unit"]], "sone":[["noun.quantity"],["sone","sound unit","phon"]], "phon":[["noun.quantity"],["phon","sound unit"]], "erlang":[["noun.quantity"],["Erlang","telephone unit"]], "millidegree":[["noun.quantity"],["millidegree","temperature unit"]], "degree centigrade":[["noun.quantity"],["degree centigrade","degree Celsius","C2","degree3"]], "degree fahrenheit":[["noun.quantity"],["degree Fahrenheit","F2","degree3"]], "rankine":[["noun.quantity"],["Rankine","temperature unit"]], "degree day":[["noun.quantity"],["degree day","temperature unit"]], "standard temperature":[["noun.quantity"],["standard temperature","degree centigrade"]], "atomic mass unit":[["noun.quantity"],["atomic mass unit","mass unit"]], "mass number":[["noun.quantity"],["mass number","nucleon number","mass unit"]], "system of weights":[["noun.quantity"],["system of weights","weight1","system of measurement"]], "avoirdupois":[["noun.quantity"],["avoirdupois","avoirdupois weight","system of weights"]], "avoirdupois unit":[["noun.quantity"],["avoirdupois unit","mass unit","avoirdupois weight","English system"]], "troy unit":[["noun.quantity"],["troy unit","weight unit","troy weight"]], "apothecaries' unit":[["noun.quantity"],["apothecaries' unit","apothecaries' weight","weight unit"]], "metric weight unit":[["noun.quantity"],["metric weight unit","weight unit2","mass unit","metric unit","metric system"]], "catty":[["noun.quantity","noun.location:China"],["catty","cattie","weight unit"]], "crith":[["noun.quantity"],["crith","weight unit"]], "maund":[["noun.quantity"],["maund","weight unit"]], "obolus":[["noun.quantity"],["obolus","weight unit","gram"]], "picul":[["noun.quantity"],["picul","weight unit"]], "pood":[["noun.quantity"],["pood","weight unit"]], "rotl":[["noun.quantity"],["rotl","weight unit"]], "tael":[["noun.quantity"],["tael","weight unit"]], "tod":[["noun.quantity","noun.location:Britain"],["tod","weight unit"]], "ounce":[["noun.quantity","noun.quantity"],["ounce1","oz.","avoirdupois unit","pound9","ounce2","troy ounce","apothecaries' ounce","apothecaries' unit","troy unit","troy pound"]], "half pound":[["noun.quantity"],["half pound","avoirdupois unit","pound9"]], "quarter pound":[["noun.quantity"],["quarter pound","avoirdupois unit","pound"]], "hundredweight":[["noun.quantity","noun.quantity","noun.quantity"],["hundredweight1","cwt1","long hundredweight","avoirdupois unit","long ton","hundredweight2","cwt2","short hundredweight","centner1","cental","quintal1","avoirdupois unit","short ton","hundredweight3","metric hundredweight","doppelzentner","centner3","metric weight unit","quintal2"]], "long ton":[["noun.quantity"],["long ton","ton1","gross ton","avoirdupois unit"]], "short ton":[["noun.quantity"],["short ton","ton2","net ton","avoirdupois unit","kiloton"]], "pennyweight":[["noun.quantity"],["pennyweight","troy unit","ounce2"]], "troy pound":[["noun.quantity"],["troy pound","apothecaries' pound","apothecaries' unit","troy unit"]], "microgram":[["noun.quantity"],["microgram","mcg","metric weight unit","milligram"]], "milligram":[["noun.quantity"],["milligram","mg","metric weight unit","grain3"]], "nanogram":[["noun.quantity"],["nanogram","ng","metric weight unit","microgram"]], "decigram":[["noun.quantity"],["decigram","dg","metric weight unit","carat"]], "carat":[["noun.quantity"],["carat","metric weight unit","gram"]], "gram atom":[["noun.quantity"],["gram atom","gram-atomic weight","metric weight unit"]], "gram molecule":[["noun.quantity","adj.pert:molal","adj.pert:molar2","adj.pert:molar"],["gram molecule","mole","mol","metric weight unit"]], "dekagram":[["noun.quantity"],["dekagram","decagram","dkg","dag","metric weight unit","hectogram"]], "hectogram":[["noun.quantity"],["hectogram","hg","metric weight unit","kilogram"]], "kilogram":[["noun.quantity"],["kilogram","kg","kilo","metric weight unit","myriagram"]], "myriagram":[["noun.quantity"],["myriagram","myg","metric weight unit","centner2"]], "centner":[["noun.quantity"],["centner2","metric weight unit","hundredweight3"]], "quintal":[["noun.quantity"],["quintal2","metric weight unit","metric ton"]], "metric ton":[["noun.quantity"],["metric ton","MT","tonne","t1","metric weight unit"]], "erg":[["noun.quantity"],["erg","work unit","joule"]], "electron volt":[["noun.quantity"],["electron volt","eV","work unit"]], "calorie":[["noun.quantity","adj.pert:caloric","noun.quantity","adj.pert:caloric2"],["calorie1","gram calorie","small calorie","work unit","Calorie2","Calorie2","kilogram calorie","kilocalorie","large calorie","nutritionist's calorie","work unit"]], "british thermal unit":[["noun.quantity","B.Th.U."],["British thermal unit","BTU","work unit","therm"]], "therm":[["noun.quantity"],["therm","work unit"]], "watt-hour":[["noun.quantity"],["watt-hour","work unit","kilowatt hour"]], "kilowatt hour":[["noun.quantity","B.T.U."],["kilowatt hour","kW-hr","Board of Trade unit","work unit"]], "foot-pound":[["noun.quantity"],["foot-pound","work unit","foot-ton"]], "foot-ton":[["noun.quantity"],["foot-ton","work unit"]], "foot-poundal":[["noun.quantity"],["foot-poundal","work unit"]], "horsepower-hour":[["noun.quantity"],["horsepower-hour","work unit"]], "kilogram-meter":[["noun.quantity"],["kilogram-meter","work unit"]], "natural number":[["noun.quantity"],["natural number","number"]], "integer":[["noun.quantity"],["integer","whole number","number"]], "addend":[["noun.quantity"],["addend","number"]], "augend":[["noun.quantity"],["augend","number"]], "minuend":[["noun.quantity"],["minuend","number"]], "subtrahend":[["noun.quantity"],["subtrahend","number"]], "complex number":[["noun.quantity","noun.cognition:mathematics"],["complex number","complex quantity","imaginary number","imaginary","number"]], "complex conjugate":[["noun.quantity"],["complex conjugate","complex number"]], "real number":[["noun.quantity"],["real number","real","complex number"]], "pure imaginary number":[["noun.quantity"],["pure imaginary number","complex number"]], "imaginary part":[["noun.quantity"],["imaginary part","imaginary part of a complex number","pure imaginary number","complex number"]], "rational number":[["noun.quantity"],["rational number","rational","real number"]], "irrational number":[["noun.quantity"],["irrational number","irrational","real number"]], "transcendental number":[["noun.quantity"],["transcendental number","irrational number"]], "algebraic number":[["noun.quantity"],["algebraic number","irrational number"]], "biquadrate":[["noun.quantity","adj.pert:biquadratic","adj.pert:biquadratic"],["biquadrate","biquadratic","quartic","fourth power","number"]], "square root":[["noun.quantity"],["square root","root"]], "cube root":[["noun.quantity"],["cube root","root"]], "common fraction":[["noun.quantity"],["common fraction","simple fraction","fraction"]], "numerator":[["noun.quantity"],["numerator","dividend"]], "denominator":[["noun.quantity"],["denominator","divisor"]], "divisor":[["noun.quantity","noun.quantity","verb.cognition:factor","verb.cognition:factorize"],["divisor","number","divisor1","factor","integer"]], "multiplier":[["noun.quantity","verb.cognition:multiply"],["multiplier","multiplier factor","number"]], "multiplicand":[["noun.quantity"],["multiplicand","number"]], "scale factor":[["noun.quantity"],["scale factor","multiplier"]], "time-scale factor":[["noun.quantity","noun.cognition:simulation"],["time-scale factor","scale factor"]], "equivalent-binary-digit factor":[["noun.quantity"],["equivalent-binary-digit factor","divisor1"]], "aliquot":[["noun.quantity","adj.all:fractional^aliquot"],["aliquot","aliquant","aliquot part","divisor"]], "aliquant":[["noun.quantity"],["aliquant","aliquot","aliquant part","divisor"]], "common divisor":[["noun.quantity"],["common divisor","common factor","common measure","divisor1"]], "greatest common divisor":[["noun.quantity"],["greatest common divisor","greatest common factor","highest common factor","common divisor"]], "common multiple":[["noun.quantity"],["common multiple","integer"]], "improper fraction":[["noun.quantity"],["improper fraction","fraction"]], "proper fraction":[["noun.quantity"],["proper fraction","fraction"]], "complex fraction":[["noun.quantity"],["complex fraction","compound fraction","fraction"]], "decimal fraction":[["noun.quantity","verb.change:decimalize1","verb.change:decimalise1"],["decimal fraction","decimal","proper fraction"]], "circulating decimal":[["noun.quantity"],["circulating decimal","recurring decimal","repeating decimal","decimal fraction"]], "continued fraction":[["noun.quantity"],["continued fraction","fraction"]], "one-half":[["noun.quantity"],["one-half","half","common fraction"]], "fifty percent":[["noun.quantity"],["fifty percent","one-half"]], "one-third":[["noun.quantity"],["one-third","third","tierce","common fraction"]], "two-thirds":[["noun.quantity"],["two-thirds","common fraction"]], "one-fourth":[["noun.quantity","verb.contact:quarter1","verb.social:quarter"],["one-fourth","fourth","one-quarter","quarter1","fourth part","twenty-five percent","quartern","common fraction"]], "three-fourths":[["noun.quantity"],["three-fourths","three-quarters","common fraction"]], "one-fifth":[["noun.quantity"],["one-fifth","fifth","fifth part","twenty percent","common fraction"]], "one-sixth":[["noun.quantity"],["one-sixth","sixth","common fraction"]], "one-seventh":[["noun.quantity"],["one-seventh","seventh","common fraction"]], "one-eighth":[["noun.quantity"],["one-eighth","eighth","common fraction"]], "one-ninth":[["noun.quantity"],["one-ninth","ninth","common fraction"]], "one-tenth":[["noun.quantity"],["one-tenth","tenth","tenth part","ten percent","common fraction"]], "one-twelfth":[["noun.quantity"],["one-twelfth","twelfth","twelfth part","duodecimal","common fraction"]], "one-sixteenth":[["noun.quantity"],["one-sixteenth","sixteenth","sixteenth part","common fraction"]], "one-thirty-second":[["noun.quantity"],["one-thirty-second","thirty-second","thirty-second part","common fraction"]], "one-sixtieth":[["noun.quantity"],["one-sixtieth","sixtieth","common fraction"]], "one-sixty-fourth":[["noun.quantity"],["one-sixty-fourth","sixty-fourth","common fraction"]], "one-hundredth":[["noun.quantity"],["one-hundredth","hundredth","one percent","common fraction"]], "one-thousandth":[["noun.quantity"],["one-thousandth","thousandth","common fraction"]], "one-ten-thousandth":[["noun.quantity"],["one-ten-thousandth","ten-thousandth","common fraction"]], "one-hundred-thousandth":[["noun.quantity"],["one-hundred-thousandth","common fraction"]], "one-millionth":[["noun.quantity"],["one-millionth","millionth","common fraction"]], "one-hundred-millionth":[["noun.quantity"],["one-hundred-millionth","common fraction"]], "one-billionth":[["noun.quantity"],["one-billionth","billionth","common fraction"]], "one-trillionth":[["noun.quantity"],["one-trillionth","trillionth","common fraction"]], "one-quadrillionth":[["noun.quantity"],["one-quadrillionth","quadrillionth","common fraction"]], "one-quintillionth":[["noun.quantity"],["one-quintillionth","quintillionth","common fraction"]], "nothing":[["noun.quantity","verb.change:zero1"],["nothing","nil","nix","nada","null","aught","cipher","cypher","goose egg","naught","zero2","zilch","zip","zippo","relative quantity"]], "nihil":[["noun.quantity","noun.communication:Latin"],["nihil","nothing"]], "bugger all":[["noun.quantity","noun.location:Britain","noun.communication:obscenity"],["bugger all","fuck all","Fanny Adams","sweet Fanny Adams","nothing"]], "binary digit":[["noun.quantity"],["binary digit","digit"]], "octal digit":[["noun.quantity"],["octal digit","digit"]], "decimal digit":[["noun.quantity"],["decimal digit","digit"]], "duodecimal digit":[["noun.quantity"],["duodecimal digit","digit"]], "hexadecimal digit":[["noun.quantity"],["hexadecimal digit","digit"]], "significant digit":[["noun.quantity"],["significant digit","significant figure","digit"]], "two":[["noun.quantity"],["two","2\"","II","deuce","digit"]], "doubleton":[["noun.quantity","noun.act:bridge"],["doubleton","couple"]], "three":[["noun.quantity"],["three","3\"","III","trio","threesome","tierce1","leash","troika","triad","trine","trinity","ternary","ternion","triplet","tercet","terzetto","trey","deuce-ace","digit"]], "four":[["noun.quantity"],["four","4\"","IV","tetrad","quatern","quaternion","quaternary","quaternity","quartet","quadruplet","foursome","Little Joe","digit"]], "five":[["noun.quantity"],["five","5\"","V2","cinque","quint","quintet","fivesome","quintuplet","pentad","fin","Phoebe","Little Phoebe","digit"]], "six":[["noun.quantity"],["six","6\"","VI","sixer","sise","Captain Hicks","half a dozen","sextet","sestet","sextuplet","hexad","digit"]], "seven":[["noun.quantity","adj.all:cardinal^seven"],["seven","7\"","VII","sevener","heptad","septet","septenary","digit"]], "eight":[["noun.quantity"],["eight","8\"","VIII","eighter","eighter from Decatur","octad","ogdoad","octonary","octet","digit"]], "nine":[["noun.quantity"],["nine","9\"","IX","niner","Nina from Carolina","ennead","digit"]], "large integer":[["noun.quantity"],["large integer","integer"]], "double digit":[["noun.quantity"],["double digit","integer"]], "ten":[["noun.quantity"],["ten","10\"","X","tenner","decade","large integer"]], "eleven":[["noun.quantity"],["eleven","11\"","XI","large integer"]], "twelve":[["noun.quantity","adj.all:cardinal^dozen"],["twelve","12\"","XII","dozen","large integer"]], "boxcars":[["noun.quantity","noun.communication:plural"],["boxcars","twelve"]], "thirteen":[["noun.quantity"],["thirteen","13\"","XIII","baker's dozen","long dozen","large integer"]], "fourteen":[["noun.quantity"],["fourteen","14\"","XIV","large integer"]], "fifteen":[["noun.quantity","adj.all:cardinal^fifteen"],["fifteen","15\"","XV","large integer"]], "sixteen":[["noun.quantity"],["sixteen","16\"","XVI","large integer"]], "seventeen":[["noun.quantity","adj.all:cardinal^seventeen"],["seventeen","17\"","XVII","large integer"]], "eighteen":[["noun.quantity"],["eighteen","18\"","XVIII","large integer"]], "nineteen":[["noun.quantity","adj.all:cardinal^nineteen"],["nineteen","19\"","XIX","large integer"]], "twenty":[["noun.quantity"],["twenty","20\"","XX","large integer"]], "twenty-one":[["noun.quantity"],["twenty-one","21\"","XXI","large integer"]], "twenty-three":[["noun.quantity"],["twenty-three","23\"","XXIII","large integer"]], "twenty-four":[["noun.quantity"],["twenty-four","24\"","XXIV","two dozen","large integer"]], "twenty-five":[["noun.quantity"],["twenty-five","25\"","XXV","large integer"]], "twenty-six":[["noun.quantity"],["twenty-six","26\"","XXVI","large integer"]], "twenty-seven":[["noun.quantity"],["twenty-seven","27\"","XXVII","large integer"]], "twenty-eight":[["noun.quantity"],["twenty-eight","28\"","XXVIII","large integer"]], "twenty-nine":[["noun.quantity"],["twenty-nine","29\"","XXIX","large integer"]], "thirty":[["noun.quantity"],["thirty","30\"","XXX","large integer"]], "forty":[["noun.quantity"],["forty","40\"","XL","large integer"]], "fifty":[["noun.quantity","adj.all:cardinal^fifty"],["fifty","50\"","L6","large integer"]], "sixty":[["noun.quantity"],["sixty","60\"","LX","large integer"]], "seventy":[["noun.quantity","adj.all:cardinal^seventy"],["seventy","70\"","LXX","large integer"]], "eighty":[["noun.quantity"],["eighty","80\"","LXXX","fourscore","large integer"]], "ninety":[["noun.quantity"],["ninety","90\"","XC","large integer"]], "hundred":[["noun.quantity"],["hundred","100\"","C1","century","one C","large integer"]], "long hundred":[["noun.quantity"],["long hundred","great hundred","120\"","large integer"]], "five hundred":[["noun.quantity"],["five hundred","500\"","D","large integer"]], "thousand":[["noun.quantity"],["thousand","one thousand","1000\"","M1","K6","chiliad","G1","grand","thou","yard2","large integer"]], "millenary":[["noun.quantity"],["millenary","thousand"]], "great gross":[["noun.quantity"],["great gross","1728\"","large integer"]], "ten thousand":[["noun.quantity"],["ten thousand","10000\"","myriad","large integer"]], "hundred thousand":[["noun.quantity"],["hundred thousand","100000\"","lakh","large integer"]], "million":[["noun.quantity","noun.quantity"],["million","1000000\"","one thousand thousand","meg","large integer","million1","billion2","trillion2","zillion","jillion","gazillion","bazillion","large indefinite quantity"]], "crore":[["noun.quantity","noun.location:India"],["crore","large integer"]], "billion":[["noun.quantity","adj.all:cardinal^billion","noun.location:US","noun.quantity","adj.all:cardinal^billion1","noun.location:Britain"],["billion","one thousand million","1000000000\"","large integer","billion1","one million million","1000000000000\"","large integer"]], "milliard":[["noun.quantity","noun.location:Britain"],["milliard","billion"]], "trillion":[["noun.quantity","noun.location:US","noun.location:France","noun.quantity","noun.location:Britain","noun.location:Germany"],["trillion","one million million1","1000000000000\"1","large integer","trillion1","one million million million","large integer"]], "quadrillion":[["noun.quantity","noun.location:US","noun.location:France","noun.quantity","noun.location:Britain","noun.location:Germany"],["quadrillion","large integer","quadrillion1","large integer"]], "quintillion":[["noun.quantity","noun.location:US","noun.location:France"],["quintillion","large integer"]], "sextillion":[["noun.quantity","noun.location:US","noun.location:France"],["sextillion","large integer"]], "septillion":[["noun.quantity","noun.location:US","noun.location:France"],["septillion","large integer"]], "octillion":[["noun.quantity","noun.location:US","noun.location:France"],["octillion","large integer"]], "aleph-null":[["noun.quantity"],["aleph-null","aleph-nought","aleph-zero","large integer"]], "formatted capacity":[["noun.quantity","noun.cognition:computer science"],["formatted capacity","capacity1"]], "unformatted capacity":[["noun.quantity","noun.cognition:computer science"],["unformatted capacity","capacity1"]], "containerful":[["noun.quantity"],["containerful","indefinite quantity"]], "headspace":[["noun.quantity"],["headspace","indefinite quantity"]], "large indefinite quantity":[["noun.quantity"],["large indefinite quantity","large indefinite amount","indefinite quantity"]], "chunk":[["noun.quantity"],["chunk","large indefinite quantity"]], "pulmonary reserve":[["noun.quantity"],["pulmonary reserve","reserve"]], "small indefinite quantity":[["noun.quantity"],["small indefinite quantity","small indefinite amount","indefinite quantity"]], "hair's-breadth":[["noun.quantity"],["hair's-breadth","hairsbreadth","hair","whisker","small indefinite quantity"]], "modicum":[["noun.quantity"],["modicum","small indefinite quantity"]], "shoestring":[["noun.quantity"],["shoestring","shoe string","small indefinite quantity"]], "little":[["noun.quantity"],["little","small indefinite quantity"]], "shtikl":[["noun.quantity"],["shtikl","shtickl","schtikl","schtickl","shtik"]], "tad":[["noun.quantity"],["tad","shade","small indefinite quantity"]], "spillage":[["noun.quantity"],["spillage","indefinite quantity"]], "ullage":[["noun.quantity"],["ullage","indefinite quantity"]], "top-up":[["noun.quantity","noun.location:Britain"],["top-up","indefinite quantity"]], "armful":[["noun.quantity"],["armful","containerful"]], "barnful":[["noun.quantity"],["barnful","containerful"]], "busload":[["noun.quantity"],["busload","large indefinite quantity"]], "capful":[["noun.quantity"],["capful","containerful"]], "carful":[["noun.quantity"],["carful","containerful"]], "cartload":[["noun.quantity"],["cartload","containerful"]], "cask":[["noun.quantity"],["cask","caskful","containerful"]], "handful":[["noun.quantity","noun.quantity"],["handful","fistful","containerful","handful1","smattering","small indefinite quantity"]], "hatful":[["noun.quantity"],["hatful","containerful"]], "houseful":[["noun.quantity"],["houseful","containerful"]], "lapful":[["noun.quantity"],["lapful","containerful"]], "mouthful":[["noun.quantity"],["mouthful","containerful"]], "pail":[["noun.quantity"],["pail","pailful","containerful"]], "pipeful":[["noun.quantity"],["pipeful","containerful"]], "pocketful":[["noun.quantity"],["pocketful","containerful"]], "roomful":[["noun.quantity"],["roomful","containerful"]], "shelfful":[["noun.quantity"],["shelfful","containerful"]], "shoeful":[["noun.quantity"],["shoeful","containerful"]], "skinful":[["noun.quantity","noun.communication:slang"],["skinful","indefinite quantity"]], "skepful":[["noun.quantity"],["skepful","containerful"]], "dessertspoon":[["noun.quantity"],["dessertspoon","dessertspoonful","containerful"]], "droplet":[["noun.quantity","noun.shape:drop","noun.quantity:drop"],["droplet","drop"]], "dollop":[["noun.quantity"],["dollop","small indefinite quantity"]], "trainload":[["noun.quantity"],["trainload","load"]], "dreg":[["noun.quantity"],["dreg","small indefinite quantity"]], "tot":[["noun.quantity"],["tot","small indefinite quantity"]], "barrels":[["noun.quantity"],["barrels","large indefinite quantity"]], "billyo":[["noun.quantity"],["billyo","billyoh","billy-ho","all get out","large indefinite quantity"]], "boatload":[["noun.quantity"],["boatload","shipload","carload","large indefinite quantity"]], "haymow":[["noun.quantity"],["haymow","batch"]], "infinitude":[["noun.quantity"],["infinitude","large indefinite quantity"]], "much":[["noun.quantity"],["much","large indefinite quantity"]], "myriad":[["noun.quantity","adj.all:incalculable^myriad"],["myriad1","large indefinite quantity"]], "small fortune":[["noun.quantity"],["small fortune","large indefinite quantity"]], "tons":[["noun.quantity"],["tons","dozens","heaps","lots","piles","scores","stacks","loads","rafts","slews","wads","oodles","gobs","scads","lashings","large indefinite quantity"]], "breathing room":[["noun.quantity"],["breathing room","breathing space","room"]], "houseroom":[["noun.quantity"],["houseroom","room"]], "living space":[["noun.quantity"],["living space","lebensraum","room"]], "sea room":[["noun.quantity"],["sea room","room"]], "vital capacity":[["noun.quantity","noun.cognition:diagnostic test"],["vital capacity","capacity"]], "stp":[["noun.quantity","s.t.p."],["STP","standard temperature","standard pressure"]] }
Java
#callme { height: 151px; position: fixed; *position: absolute; top: 150px; right: 0; width: 22px; z-index: 110; } .cme-form { border: 1px solid #bbc1ce; -moz-box-shadow: 0 2px 20px #333333; -webkit-box-shadow: 0 2px 20px #333333; box-shadow: 0 2px 20px #333333; -webkit-border-radius: 5px; -moz-border-radius: 5px; -ms-border-radius: 5px; border-radius: 5px; background: white; z-index: 109; font-family: "Lucida Grande", Tahoma; display: none; position: fixed; *position: absolute; right: 50px; top: 150px; width: 305px; color: gray; } .cme-form .has-error { background: #f2dede; } .cme-form span { padding: 2px 3px 2px 10px; display: block; color: gray; font-size: 11px; clear: both; } .cme-form .cme-btn { padding: 4px 7px 5px; color: white; font-size: 13px; font-weight: bold; border-radius: 0px; text-shadow: 0 1px 0 #757575; margin: 0; cursor: pointer; width: 140px; outline: 0; } .cme-form select { border: 1px solid #98a198; background: white; padding: 4px 3px 3px 9px; width: 100%; font-size: 12px; border-radius: 0px; outline-style: none; height: 21px; line-height: 21px; margin: 0 0 5px 0; font-size: 12px; cursor: pointer; font-family: "Lucida Grande", Tahoma; outline: 0; } .cme-form .cme-select { width: 280px; margin-left: 10px; height: 27px; line-height: 27px; } .cme-form .cme-txt { border: 1px solid #98a198; width: 280px; border-radius: 0px; color: black; font-size: 12px; padding: 5px 3px !important; outline: 0; } .cme-form h6 { border-bottom: 1px solid #e9e9e9; color: #3b5998; font-size: 13px; padding: 10px 0 9px 10px; margin: 0 0 7px 0; } .cme-form span div { float: left; display: inline; margin: 0 5px 0 0; line-height: 19px; } .cme-form .cme-cls { text-shadow: 0 1px 0 #4d659f; height: 20px; width: 20px; font-size: 13px; overflow: hidden; border-radius: 2px; text-align: center; padding: 0 3px 3px; float: right; display: inline; color: white; text-shadow: none; margin: 7px 8px 0 0; cursor: pointer; text-decoration: none; } .cme-form .cme-cls:hover { color: white; opacity: 0.8; -webkit-opacity: 0.8; -khtml-opacity: 0.8; -moz-opacity: 0.8; filter: alpha(opacity=80); -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=$p)"; } .cme-form .cme-btn-place span { display: inline; float: right; padding: 7px 12px 0 0 !important; font-size: 8px !important; color: #888 !important; } .cme-form .cme-btn-place span a { font-size: 11px; color: #888; } .cme-form .cme-btn-place span a:hover { text-decoration: none; } .cme-form .callmebody { font-size: 13px; background: white; padding: 5px 10px; } .cme-form .callmebody .inf { padding: 0 5px; margin: 0 0 10px 0; font-weight: bold; clear: both; } .cme-form .callme-result { background: white url(loading.gif) 10px center no-repeat; display: block; clear: both; margin: 5px 11px 10px 10px; } .cme-form .callme-result div { padding: 7px 7px; margin: 4px 0 0 0; } .cme-form .callme-result div.sending { padding: 7px 0 7px 35px; display: block; color: gray; clear: both; } .cme-form .callme-result div.c_success { background: #98c462; color: #fff; text-shadow: none; } .cme-form .callme-result div.c_error { background: #f76363; color: #fffafa; text-shadow: none; } #viewform { border: 0; padding: 0; background: url(bttn.png); height: 185px; width: 22px; cursor: pointer; outline: 0; } #cme-back { display: none; z-index: 108; opacity: 0.5; top: 0; left: 0; width: 100%; height: 100%; position: absolute; background: #333; } .cme-btn, .cme-form .cme-btn { border-top: 1px solid #8a9cc2; border-right: 1px solid #4b5e84; border-bottom: 1px solid #4b5e84; border-left: 1px solid #4b5e84; -moz-box-shadow: 0 -1px 0 #4b5e84; -webkit-box-shadow: 0 -1px 0 #4b5e84; box-shadow: 0 -1px 0 #4b5e84; background: #637bad; } .cme-cls, .cme-form .cme-cls { background: #4d659f; }
Java
<?php /* homepage: http://arc.semsol.org/ license: http://arc.semsol.org/license class: ARC2 RDF/XML Serializer author: Benjamin Nowack version: 2009-02-12 (Fix: scheme-detection: scheme must have at least 2 chars, thanks to Eric Schoonover) */ ARC2::inc('RDFSerializer'); class ARC2_RDFXMLSerializer extends ARC2_RDFSerializer { function __construct($a = '', &$caller) { parent::__construct($a, $caller); } function ARC2_RDFXMLSerializer($a = '', &$caller) { $this->__construct($a, $caller); } function __init() { parent::__init(); $this->content_header = 'application/rdf+xml'; $this->pp_containers = $this->v('serializer_prettyprint_containers', 0, $this->a); } /* */ function getTerm($v, $type) { if (!is_array($v)) {/* uri or bnode */ if (preg_match('/^\_\:(.*)$/', $v, $m)) { return ' rdf:nodeID="' . $m[1] . '"'; } if ($type == 's') { return ' rdf:about="' . htmlspecialchars($v) . '"'; } if ($type == 'p') { if ($pn = $this->getPName($v)) { return $pn; } return 0; } if ($type == 'o') { $v = $this->expandPName($v); if (!preg_match('/^[a-z0-9]{2,}\:[^\s]+$/is', $v)) return $this->getTerm(array('value' => $v, 'type' => 'literal'), $type); return ' rdf:resource="' . htmlspecialchars($v) . '"'; } if ($type == 'datatype') { $v = $this->expandPName($v); return ' rdf:datatype="' . htmlspecialchars($v) . '"'; } if ($type == 'lang') { return ' xml:lang="' . htmlspecialchars($v) . '"'; } } if ($v['type'] != 'literal') { return $this->getTerm($v['value'], 'o'); } /* literal */ $dt = isset($v['datatype']) ? $v['datatype'] : ''; $lang = isset($v['lang']) ? $v['lang'] : ''; if ($dt == 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral') { return ' rdf:parseType="Literal">' . $v['value']; } elseif ($dt) { return $this->getTerm($dt, 'datatype') . '>' . htmlspecialchars($v['value']); } elseif ($lang) { return $this->getTerm($lang, 'lang') . '>' . htmlspecialchars($v['value']); } return '>' . htmlspecialchars($v['value']); } function getHead() { $r = ''; $nl = "\n"; $r .= '<?xml version="1.0" encoding="UTF-8"?>'; $r .= $nl . '<rdf:RDF'; $first_ns = 1; foreach ($this->used_ns as $v) { $r .= $first_ns ? ' ' : $nl . ' '; $r .= 'xmlns:' . $this->nsp[$v] . '="' .$v. '"'; $first_ns = 0; } $r .= '>'; return $r; } function getFooter() { $r = ''; $nl = "\n"; $r .= $nl . $nl . '</rdf:RDF>'; return $r; } function getSerializedIndex($index, $raw = 0) { $r = ''; $nl = "\n"; foreach ($index as $raw_s => $ps) { $r .= $r ? $nl . $nl : ''; $s = $this->getTerm($raw_s, 's'); $tag = 'rdf:Description'; $sub_ps = 0; /* pretty containers */ if ($this->pp_containers && ($ctag = $this->getContainerTag($ps))) { $tag = 'rdf:' . $ctag; list($ps, $sub_ps) = $this->splitContainerEntries($ps); } $r .= ' <' . $tag . '' .$s . '>'; $first_p = 1; foreach ($ps as $p => $os) { if (!$os) continue; if ($p = $this->getTerm($p, 'p')) { $r .= $nl . str_pad('', 4); $first_o = 1; if (!is_array($os)) {/* single literal o */ $os = array(array('value' => $os, 'type' => 'literal')); } foreach ($os as $o) { $o = $this->getTerm($o, 'o'); $r .= $first_o ? '' : $nl . ' '; $r .= '<' . $p; $r .= $o; $r .= preg_match('/\>/', $o) ? '</' . $p . '>' : '/>'; $first_o = 0; } $first_p = 0; } } $r .= $r ? $nl . ' </' . $tag . '>' : ''; if ($sub_ps) $r .= $nl . $nl . $this->getSerializedIndex(array($raw_s => $sub_ps), 1); } if ($raw) { return $r; } return $this->getHead() . $nl . $nl . $r . $this->getFooter(); } /* */ function getContainerTag($ps) { $rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; if (!isset($ps[$rdf . 'type'])) return ''; $types = $ps[$rdf . 'type']; foreach ($types as $type) { if (!in_array($type['value'], array($rdf . 'Bag', $rdf . 'Seq', $rdf . 'Alt'))) return ''; return str_replace($rdf, '', $type['value']); } } function splitContainerEntries($ps) { $rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; $items = array(); $rest = array(); foreach ($ps as $p => $os) { $p_short = str_replace($rdf, '', $p); if ($p_short === 'type') continue; if (preg_match('/^\_([0-9]+)$/', $p_short, $m)) { $items = array_merge($items, $os); } else { $rest[$p] = $os; } } if ($items) return array(array($rdf . 'li' => $items), $rest); return array($rest, 0); } /* */ }
Java
<?php /** * * Board Rules extension for the phpBB Forum Software package. * * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> * @license GNU General Public License, version 2 (GPL-2.0) * */ namespace phpbb\boardrules\tests\operators; class rule_operator_move_test extends rule_operator_base { /** * Test data for the test_move_rules() function * * @return array Array of test data */ public function move_rules_test_data() { return array( array( 1, 'up', // Move item 1 up (not expected to move) array( array('rule_id' => 1, 'rule_left_id' => 1), array('rule_id' => 2, 'rule_left_id' => 3), array('rule_id' => 3, 'rule_left_id' => 5), array('rule_id' => 4, 'rule_left_id' => 7), array('rule_id' => 5, 'rule_left_id' => 8), ), ), array( 2, 'up', // Move item 2 up array( array('rule_id' => 2, 'rule_left_id' => 1), array('rule_id' => 1, 'rule_left_id' => 3), array('rule_id' => 3, 'rule_left_id' => 5), array('rule_id' => 4, 'rule_left_id' => 7), array('rule_id' => 5, 'rule_left_id' => 8), ), ), array( 3, 'up', // Move item 3 up array( array('rule_id' => 1, 'rule_left_id' => 1), array('rule_id' => 3, 'rule_left_id' => 3), array('rule_id' => 2, 'rule_left_id' => 5), array('rule_id' => 4, 'rule_left_id' => 7), array('rule_id' => 5, 'rule_left_id' => 8), ), ), array( 4, 'up', // Move item 4 up (carries its child item 5 along) array( array('rule_id' => 1, 'rule_left_id' => 1), array('rule_id' => 2, 'rule_left_id' => 3), array('rule_id' => 4, 'rule_left_id' => 5), array('rule_id' => 5, 'rule_left_id' => 6), array('rule_id' => 3, 'rule_left_id' => 9), ), ), array( 5, 'up', // Move item 5 up (not expected to move because it's a child of item 4) array( array('rule_id' => 1, 'rule_left_id' => 1), array('rule_id' => 2, 'rule_left_id' => 3), array('rule_id' => 3, 'rule_left_id' => 5), array('rule_id' => 4, 'rule_left_id' => 7), array('rule_id' => 5, 'rule_left_id' => 8), ), ), array( 1, 'down', // Move item 1 down array( array('rule_id' => 2, 'rule_left_id' => 1), array('rule_id' => 1, 'rule_left_id' => 3), array('rule_id' => 3, 'rule_left_id' => 5), array('rule_id' => 4, 'rule_left_id' => 7), array('rule_id' => 5, 'rule_left_id' => 8), ), ), array( 2, 'down', // Move item 2 down array( array('rule_id' => 1, 'rule_left_id' => 1), array('rule_id' => 3, 'rule_left_id' => 3), array('rule_id' => 2, 'rule_left_id' => 5), array('rule_id' => 4, 'rule_left_id' => 7), array('rule_id' => 5, 'rule_left_id' => 8), ), ), array( 3, 'down', // Move item 3 down (moves past 4 and 5 which are nested) array( array('rule_id' => 1, 'rule_left_id' => 1), array('rule_id' => 2, 'rule_left_id' => 3), array('rule_id' => 4, 'rule_left_id' => 5), array('rule_id' => 5, 'rule_left_id' => 6), array('rule_id' => 3, 'rule_left_id' => 9), ), ), array( 4, 'down', // Move item 4 down (not expected to move) array( array('rule_id' => 1, 'rule_left_id' => 1), array('rule_id' => 2, 'rule_left_id' => 3), array('rule_id' => 3, 'rule_left_id' => 5), array('rule_id' => 4, 'rule_left_id' => 7), array('rule_id' => 5, 'rule_left_id' => 8), ), ), array( 5, 'down', // Move item 5 down (not expected to move because it's a child of item 4) array( array('rule_id' => 1, 'rule_left_id' => 1), array('rule_id' => 2, 'rule_left_id' => 3), array('rule_id' => 3, 'rule_left_id' => 5), array('rule_id' => 4, 'rule_left_id' => 7), array('rule_id' => 5, 'rule_left_id' => 8), ), ), ); } /** * Test moving rules up and down * * @dataProvider move_rules_test_data */ public function test_move_rules($rule_id, $direction, $expected) { // Setup the operator class $operator = $this->get_rule_operator(); $operator->move($rule_id, $direction); $result = $this->db->sql_query('SELECT rule_id, rule_left_id FROM phpbb_boardrules ORDER BY rule_left_id ASC'); self::assertEquals($expected, $this->db->sql_fetchrowset($result)); $this->db->sql_freeresult($result); } /** * Test data for the test_move_rules_fails() function * * @return array Array of test data */ public function move_rules_fails_data() { return array( array(10), ); } /** * Test moving non-existent rules which should throw an exception * * @dataProvider move_rules_fails_data */ public function test_move_rules_fails($rule_id) { $this->expectException(\phpbb\boardrules\exception\base::class); // Setup the operator class $operator = $this->get_rule_operator(); $operator->move($rule_id); } }
Java
package dataset; public class UndefinedSampleLengthException extends Exception { private static final long serialVersionUID = 1L; }
Java
/* * board/omap3621_boxer/max17042.c * * Copyright (C) 2010 Barnes & Noble, Inc. * Intrinsyc Software International, Inc. on behalf of Barnes & Noble, Inc. * * Max17042 Gas Gauge initialization for u-boot * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <common.h> #include <asm/arch/cpu.h> #include <asm/io.h> #include <asm/arch/bits.h> #include <asm/arch/mux.h> #include <asm/arch/sys_proto.h> #include <asm/arch/sys_info.h> #include <asm/arch/clocks.h> #include <asm/arch/mem.h> #include <i2c.h> #include <asm/mach-types.h> #define TEMP_RESOLUTION 3900 /*3900uC*/ #define COMPLEMENT_VAL(x, y, z) (( ((((~x) & 0x7FFF) + 1) * y) / z ) * (-1)) #define MAX17042_ADDR 0x36 #define MAX_WRITE(reg, val) i2c_multidata_write(MAX17042_ADDR, (reg), 1, (val), 2) #define MAX_READ(reg, val) i2c_read_2_byte(MAX17042_ADDR,(reg), (val)) struct max17042_saved_data { uint16_t tag; uint16_t val_FullCAP; uint16_t val_Cycles; uint16_t val_FullCAPNom; uint16_t val_SOCempty; uint16_t val_Iavg_empty; uint16_t val_RCOMP0; uint16_t val_TempCo; uint16_t val_k_empty0; uint16_t val_dQacc; uint16_t val_dPacc; uint16_t val_SOCmix; uint16_t val_Empty_TempCo; uint16_t val_ICHGTerm; uint16_t val_Vempty; uint16_t val_FilterCFG; uint16_t val_TempNom; uint16_t val_DesignCap; uint16_t val_Capacity; uint16_t val_SOCREP; }; static struct max17042_saved_data save_store; static int is_power_on = 1; //battery flat, battery removed, static int is_history_exist = 1; //max17042.bin is in ROM partition static uint16_t VFSOC = 0; #define DEBUG(x...) printf(x) #define TEMPLIM 0x2305 // hard POR value #define MISCCFG 0x0810 // hard POR value -- and with 0xCC1F #define MISCCFG_MASK 0xCC1F #define TGAIN 0xE3E1 // hard POR value #define TOFF 0x290E // hard POR value #define CGAIN 0x4000 // hard POR value #define COFF 0x0000 // hard POR value #define FCTC 0x05E0 // hard POR value #define MAX17042_STATUS 0x00 #define MAX17042_RemCapREP 0x05 #define MAX17042_SOCREP 0x06 #define MAX17042_Vcell 0x09 #define MAX17042_SOCmix 0x0D #define MAX17042_RemCapmix 0x0F #define MAX17042_FullCap 0x10 #define MAX17042_Vempty 0x12 #define MAX17042_Cycles 0x17 #define MAX17042_DesignCap 0x18 #define MAX17042_CONFIG 0x1D #define MAX17042_ICHGTerm 0x1E #define MAX17042_Version 0x21 #define MAX17042_FullCAPNom 0x23 #define MAX17042_TempNom 0x24 #define MAX17042_TempLim 0x25 #define MAX17042_LearnCFG 0x28 #define MAX17042_RelaxCFG 0x2A #define MAX17042_FilterCFG 0x29 #define MAX17042_MiscCFG 0x2B #define MAX17042_TGAIN 0x2C #define MAX17042_TOFF 0x2D #define MAX17042_CGAIN 0x2E #define MAX17042_COFF 0x2F #define MAX17042_SOCempty 0x33 #define MAX17042_FullCap0 0x35 #define MAX17042_Iavg_empty 0x36 #define MAX17042_FCTC 0x37 #define MAX17042_RCOMP0 0x38 #define MAX17042_TempCo 0x39 #define MAX17042_Empty_TempCo 0x3A #define MAX17042_k_empty0 0x3B #define MAX17042_dQacc 0x45 #define MAX17042_dPacc 0x46 #define MAX17042_VFSOC_Unlock 0x60 #define MAX17042_OCV 0xFB #define MAX17042_FSTAT 0xFD #define MAX17042_SOCvf 0xFF #define MAX17042_STATUS_bit_POR (1<<1) typedef enum { BATT_LG = 0, BATT_MCNAIR, /* add new battery type here */ BATT_MAX } batt_type; // This struct contains registers for initialize configuration typedef struct { uint16_t RelaxCFG; uint16_t Config; uint16_t FilterCFG; uint16_t LearnCFG; uint16_t Vempty; uint16_t RCOMP0; uint16_t TempCo; uint16_t ETC; uint16_t Kempty0; uint16_t ICHGTerm; uint16_t Capacity; } max17042_init_params; // 48-word custom model params typedef struct { uint16_t buf_80h[16]; uint16_t buf_90h[16]; uint16_t buf_A0h[16]; } max17042_custom_model; // All the registers for initializing max17042 typedef struct { const max17042_init_params* init_params; const max17042_custom_model* model; } batt_type_params; // This table containas default initialization values provided by maxim for different battery types. static const max17042_init_params const init_param_table[BATT_MAX] = { //RelaxCFG Config FilterCFG LearnCFG Vempty RCOMP0 TempCo ETC Kempty0 ICHGTerm Capacity /*LG */{ 0x083B, 0x2210, 0x87A4, 0x2406, 0x7D5A, 0x0080, 0x3670, 0x2F2C, 0x078F, 0x0140, 0x205C}, /*MCNAIR*/{ 0x083B, 0x2210, 0x87A4, 0x2406, 0x7D5A, 0x0081, 0x1921, 0x0635, 0x0679, 0x04F3, 0x1EB9}, // add an entry here for new battery type }; // This table containas 48-word custom model params provided by maxim for different battery types. static const max17042_custom_model const model_table[BATT_MAX] = { // LG { /*80h*/{0xA0D0, 0xB3F0, 0xB820, 0xB940, 0xBB80, 0xBBF0, 0xBC90, 0xBD00, 0xBDA0, 0xBE80, 0xBF70, 0xC280, 0xC5B0, 0xC7F0, 0xCAB0, 0xD030}, /*90h*/{0x0100, 0x0700, 0x1400, 0x0B00, 0x2640, 0x3210, 0x1D40, 0x2C00, 0x1760, 0x15D0, 0x09C0, 0x0CE0, 0x0BD0, 0x09F0, 0x08F0, 0x08F0}, /*A0h*/{0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100}, }, // MCNAIR { /*80h*/{0x9EE0, 0xB660, 0xB7D0, 0xB980, 0xBB00, 0xBBD0, 0xBCA0, 0xBD70, 0xBE60, 0xBF70, 0xC0A0, 0xC410, 0xC710, 0xCA50, 0xCC80, 0xD100}, /*90h*/{0x0060, 0x13F0, 0x0AF0, 0x10B0, 0x1920, 0x2720, 0x1E30, 0x1A20, 0x1600, 0x14F0, 0x0BF0, 0x0CF0, 0x0610, 0x0A00, 0x0A80, 0x0A80}, /*A0h*/{0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100}, }, // add an entry here for new battery type }; static const batt_type_params param_table[BATT_MAX] = { /*LG */ {&init_param_table[BATT_LG], &model_table[BATT_LG] }, /*MCNAIR*/ {&init_param_table[BATT_MCNAIR], &model_table[BATT_MCNAIR]}, // add an entry here for new battery type }; static const batt_type_params* type_params = &param_table[BATT_LG]; static inline int max17042_dumpreg( char *pRegName, int iReg ) { uint16_t val; MAX_READ( iReg, (uchar*)&val); DEBUG("%s (%02xh) is 0x%04x\n", pRegName, iReg, val ); return val; } #define MAX17042_DUMPREG( reg ) max17042_dumpreg( #reg, reg ) static int max17042_check_init_config(void) { uint16_t buf=0; const max17042_init_params* params = type_params->init_params; MAX_READ(MAX17042_CONFIG, (uchar*)&buf); DEBUG("uboot verify: %02x CONFIG is %04x ; should be %04x & 0xFDFB\n", MAX17042_CONFIG, buf, params->Config); // in case of warm boot, kernel might have changed bits Ten and Aen if ( (buf & ~0x0204) != ( params->Config & ~0x0204) ) return 1; buf=0; MAX_READ(MAX17042_RelaxCFG, (uchar*)&buf); DEBUG("uboot verify: %02x RELAXCFG is %04x ; should be %04x\n", MAX17042_RelaxCFG, buf, params->RelaxCFG); if ( buf != params->RelaxCFG ) return 1; buf=0; MAX_READ(MAX17042_FilterCFG, (uchar*)&buf); DEBUG("uboot verify: %02x FILTERCFG is %04x ; should be %04x\n", MAX17042_FilterCFG, buf, params->FilterCFG); if ( buf != params->FilterCFG ) return 1; buf=0; MAX_READ(MAX17042_LearnCFG, (uchar*)&buf); DEBUG("uboot verify: %02x LEARNCFG is %04x ; should be %04x & 0xFF0F\n", MAX17042_LearnCFG, buf, params->LearnCFG); if ( (buf & 0xFF0F) != ( params->LearnCFG & 0xFF0F) ) return 1; MAX_READ( MAX17042_DesignCap, (u8*)&buf); DEBUG("uboot verify: %02x DesignCap is %04x ; should be %04x\n", MAX17042_DesignCap, buf, params->Capacity); if ( buf != params->Capacity ) return 1; MAX_READ( MAX17042_Vempty, (u8*)&buf); DEBUG("uboot verify: %02x Vempty is %04x ; should be %04x\n", MAX17042_Vempty, buf, params->Vempty); if ( buf != params->Vempty ) return 1; buf=0; MAX_READ(MAX17042_TempLim, (uchar*)&buf); DEBUG("uboot verify: %02x TEMPLIM is %04x ; should be %04x\n", MAX17042_TempLim, buf, TEMPLIM); if ( buf != TEMPLIM ) return 1; buf=0; MAX_READ(MAX17042_MiscCFG, (uchar*)&buf); DEBUG("uboot verify: %02x MiscCFG is %04x ; should be %04x & %04x\n", MAX17042_MiscCFG, buf, MISCCFG, MISCCFG_MASK ); if ( (buf & MISCCFG_MASK) != (MISCCFG & MISCCFG_MASK) ) return 1; buf=0; MAX_READ(MAX17042_TGAIN, (uchar*)&buf); DEBUG("uboot verify: %02x TGAIN is %04x ; should be %04x\n", MAX17042_TGAIN, buf, TGAIN); if ( buf != TGAIN ) return 1; buf=0; MAX_READ(MAX17042_TOFF, (uchar*)&buf); DEBUG("uboot verify: %02x TOFF is %04x ; should be %04x\n", MAX17042_TOFF, buf, TOFF); if ( buf != TOFF ) return 1; buf=0; MAX_READ(MAX17042_CGAIN, (uchar*)&buf); DEBUG("uboot verify: %02x CGAIN is %04x ; should be %04x\n", MAX17042_CGAIN, buf, CGAIN); if ( buf != CGAIN ) return 1; buf=0; MAX_READ(MAX17042_COFF, (uchar*)&buf); DEBUG("uboot verify: %02x COFF is %04x ; should be %04x\n", MAX17042_COFF, buf, COFF); if ( buf != COFF ) return 1; buf=0; MAX_READ(MAX17042_FCTC, (uchar*)&buf); DEBUG("uboot verify: %02x FCTC is %04x ; should be %04x\n", MAX17042_FCTC, buf, FCTC); if ( buf != FCTC ) return 1; return 0; } static int max17042_init_config(void) { int err; const max17042_init_params* params = type_params->init_params; err =MAX_WRITE(MAX17042_CONFIG, (uchar*)&(params->Config)); if ( err != 0 ) { DEBUG("uboot: write err CONFIG \n"); return err; } // DEBUG("config = 0x%04x\n", params->Config); err =MAX_WRITE(MAX17042_RelaxCFG, (uchar*)&params->RelaxCFG); if ( err != 0 ) { DEBUG( "uboot: write err RelaxCFG \n"); return err; } // DEBUG("relaxcfg = 0x%04x\n", params->RelaxCFG); err =MAX_WRITE(MAX17042_FilterCFG, (uchar*)&params->FilterCFG); if ( err != 0 ) { DEBUG( "write err FilterCFG \n"); return err; } // DEBUG("filtercfg = 0x%04x\n", params->FilterCFG); err =MAX_WRITE(MAX17042_LearnCFG, (uchar*)& params->LearnCFG); if ( err != 0 ) { DEBUG( "write err LearnCFG\n"); return err; } // DEBUG("LearnCFG = 0x%04x\n", params->learncfg); err =MAX_WRITE(MAX17042_Vempty, (uchar*)& params->Vempty); if ( err != 0 ) { DEBUG( "write err Vempty\n"); return err; } // DEBUG("Vempty = 0x%04x\n", params->Vempty); return max17042_check_init_config(); } int is_max17042_por(void) { uint16_t stat = 0; int ret; stat = MAX17042_DUMPREG(MAX17042_STATUS); ret = (stat & MAX17042_STATUS_bit_POR) ? 1: 0 ; return ret; } //return 1: memory lost on power_on //return 0; memory is in place static int is_power_on_rst(void) { int ret = 0; uint16_t stat = 0; stat = MAX17042_DUMPREG(MAX17042_STATUS); /*POR bit check*/ /* previous code has the operator precedence problem where != is evaluated before bitand ! */ if ( (stat & MAX17042_STATUS_bit_POR) != 0 ) { ret = 1; } if( (stat & (1 <<15))!=0) DEBUG("MAX17042+UBOOT: POWER SUPPLY Detected!\n"); else DEBUG("MAX17042+UBOOT: BATTERY Detected!\n"); is_power_on = ret; return ret; } static void max17042_clear_POR(void) { uint16_t stat = 0; stat = MAX17042_DUMPREG(MAX17042_STATUS); if ( stat & MAX17042_STATUS_bit_POR ) { DEBUG("STATUS = 0x%04x -- clearing POR\n", stat ); stat &= ~MAX17042_STATUS_bit_POR; MAX_WRITE(MAX17042_STATUS,(uchar*)&stat); MAX17042_DUMPREG(MAX17042_STATUS); } } static int max17042_save_start_para(void) { int err; uint16_t buf; err =MAX_READ(MAX17042_SOCmix, (uchar*)&buf); if ( err != 0 ) { DEBUG("read err MixedSOC \n"); return err; } else save_store.val_SOCmix = buf; err =MAX_READ(MAX17042_dQacc, (uchar*)&buf); if ( err != 0 ) { DEBUG( "read err dQ_acc \n"); return err; } else save_store.val_dQacc = buf; err =MAX_READ(MAX17042_dPacc, (uchar*)&buf); if ( err != 0 ) { DEBUG( "read err dP_acc \n"); return err; } else save_store.val_dPacc = buf; return 0; } static void max17042_unlock_model(void) { static uint16_t val1 = 0x0059; static uint16_t val2 = 0x00C4; MAX_WRITE(0x62, (uchar*)&val1); udelay(10); MAX_WRITE(0x63, (uchar*)&val2); } static int max17042_write_model(void) { int i; int err=1; const max17042_custom_model* model = type_params->model; for ( i = 0; i < 16; i++) { err = MAX_WRITE((0x80+i), (uchar*)(&model->buf_80h[i])); if ( err != 0 ) { DEBUG( "write err model 0x80 \n"); return err; } //DEBUG(" %x write %04x\n", (0x80+i), model->buf_80h[i]); udelay(10); err = MAX_WRITE((0x90+i), (uchar*)(&model->buf_90h[i])); if ( err != 0 ) { DEBUG( "write err model 0x90 \n"); return err; } //DEBUG(" %x write %04x\n", (0x90+i), model->buf_90h[i]); udelay(10); MAX_WRITE((0xA0+i), (uchar*)(&model->buf_A0h[i])); if ( err != 0 ) { DEBUG( "write err model 0xA0 \n"); return err; } //DEBUG(" %x write %04x\n", (0xA0+i), model->buf_A0h[i]); udelay(10); } return 0; } static int max17042_read_verify_model(void) { int i; uint16_t buf; int err = 1; const max17042_custom_model* model = type_params->model; for ( i = 0; i < 16; i++) { err = MAX_READ((0x80+i), (uchar*)&buf); if ( err != 0 ) { DEBUG( "read err model 0x80 \n"); return err; } else if ( buf != model->buf_80h[i] ) { DEBUG(" err 80h item %d not matched\n", i); return 1; } //DEBUG(" %x model: %04x\n", (0x80+i), buf); udelay(10); err = MAX_READ((0x90+i), (uchar*)&buf); if ( err != 0 ) { DEBUG( "read err model 0x90 \n"); return err; }else if ( buf != model->buf_90h[i] ) { DEBUG(" err 90h item %d not matched\n", i); return 1; } //DEBUG(" %x model: %04x\n", (0x90+i), buf); udelay(10); err = MAX_READ((0xA0+i), (uchar*)&buf); if ( err != 0 ) { DEBUG( "read err model 0xA0 \n"); return err; }else if ( buf != model->buf_A0h[i] ) { DEBUG(" err A0h item %d not matched\n", i); return 1; } //DEBUG(" %x model: %04x\n", (0xA0+i), buf); udelay(10); } return 0; } static void max17042_lock_model(void) { static const uint16_t lock = 0x0000; MAX_WRITE(0x62, (uchar*)&lock); udelay(10); MAX_WRITE(0x63, (uchar*)&lock); udelay(100); return; } static int max17042_verify_lock_model(void) { int i; uint16_t buf; int err = 1; for ( i = 0; i < 16; i++) { err = MAX_READ((0x80+i), (uchar*)&buf); //DEBUG(" %x model: %04x\n", (0x80+i), buf); if ( err != 0 ) { DEBUG( "read err model 0x80 \n"); return err; } else if ( buf != 0x0000 ) { DEBUG(" err model not locked!\n", i); return 1; } udelay(10); err = MAX_READ((0x90+i), (uchar*)&buf); //DEBUG(" %x model: %04x\n", (0x90+i), buf); if ( err != 0 ) { DEBUG( "read err model 0x90 \n"); return err; }else if ( buf != 0x0000 ) { DEBUG(" err model not locked\n", i); return 1; } udelay(10); err = MAX_READ((0xA0+i), (uchar*)&buf); //DEBUG(" %x model: %04x\n", (0xA0+i), buf); if ( err != 0 ) { DEBUG( "read err model 0xA0 \n"); return err; }else if ( buf != 0x0000 ) { DEBUG(" err model not locked\n", i); return 1; } udelay(10); } return 0; } int max17042_soft_por(void) { uint16_t buf = 0; int iReps; iReps = 0; while ( 1 ) { if ( iReps++ > 10 ) { DEBUG("Soft POR : unlock failure\n"); return 1; } // DEBUG("Soft POR : attempting unlock\n"); max17042_lock_model(); buf = 0; MAX_WRITE(MAX17042_STATUS, (uchar*)&buf); // clear all Status // note: clear POR bit is not enough here udelay(1000); MAX_READ(MAX17042_STATUS, (uchar*)&buf); if ( buf != 0 ) continue; MAX_READ(0x62, (uchar*)&buf); if ( buf != 0 ) continue; MAX_READ(0x63, (uchar*)&buf); if ( buf != 0 ) continue; break; } // DEBUG("Soft POR: unlocked\n"); for ( iReps = 0; iReps < 10; iReps++ ) { buf = 0x000F; MAX_WRITE(0x60, (uchar*)&buf); udelay(2*1000); if ( is_max17042_por() ) { DEBUG("Soft POR: Success!\n"); return 0; } } DEBUG("Soft POR: failed\n"); return 1; } static int max_write_verify( u8 reg, const u8* val) { int err; uint16_t buf1, buf2; int iTmp; buf1 = *(uint16_t*)val; // DEBUG("%s: write 0x%04x to reg 0x%x\n", __FUNCTION__, buf1, reg ); for ( iTmp=0; iTmp < 3; iTmp++ ) { err = MAX_WRITE( reg, (uchar*)val ); udelay(50); err = MAX_READ( reg, (u8*)&buf2 ); if ( buf1 == buf2 ) return 0; DEBUG("Retry write 0x%04x to reg 0x%x\n", buf1, reg ); } DEBUG ("Failed to write 0x%04x to reg 0x%x (contains 0x%04x)\n", buf1, reg, buf2 ); return 1; } static int max17042_set_cycles( uint16_t cycles ) { return max_write_verify(MAX17042_Cycles, (u8*)&cycles); } static int max17042_restore_fullcap(void) { int err; uint16_t fullcap0, remcap, SOCmix, dPacc, dQacc; if ( !is_history_exist ) { printf("%s: no history file exists!\n", __FUNCTION__); return 1; } DEBUG("Restoring learned full capacity\n"); err = MAX_READ(MAX17042_FullCap0, (u8*)&fullcap0); if ( err != 0 ) { DEBUG( "read err reg 0x%x\n", MAX17042_FullCap0); return err; } err =MAX_READ(MAX17042_SOCmix, (uchar*)&SOCmix); if ( err != 0 ) { DEBUG( "read err reg 0x%x\n", MAX17042_SOCmix); return err; } remcap = (uint16_t)( ((int)SOCmix * (int)fullcap0) / 25600 ); DEBUG("FullCap0=0x%04x SOCmix=0x%04x, remcap=0x%04x\n", fullcap0, SOCmix, remcap); err = max_write_verify(MAX17042_RemCapmix, (u8*)&remcap); if ( err != 0 ) { return err; } err = max_write_verify(MAX17042_FullCap,(u8*)&save_store.val_FullCAP); if ( err != 0 ) { return err; } DEBUG("FullCAP = 0x%04x\n", save_store.val_FullCAP); dQacc = (save_store.val_FullCAPNom / 4); err = max_write_verify(MAX17042_dQacc, (u8*)&dQacc); if ( err != 0 ) { return err; } dPacc = 0x1900; err = max_write_verify(MAX17042_dPacc, (u8*)&dPacc); if ( err != 0 ) { return err; } return 0; } static int max17042_restore_learned_para(void) { int err; if ( !is_history_exist ) { printf("%s: error: no history file exists!\n", __FUNCTION__); return 1; } DEBUG("Restoring learned parameters\n"); //21. Restore Learned Parameters err = max_write_verify( MAX17042_RCOMP0, (u8*)&save_store.val_RCOMP0 ); if ( err != 0 ) { return err; } err = max_write_verify ( MAX17042_TempCo, (u8*)&save_store.val_TempCo ); if ( err != 0 ) { return err; } err = max_write_verify( MAX17042_Iavg_empty, (u8*)&save_store.val_Iavg_empty); if ( err != 0 ) { return err; } err = max_write_verify( MAX17042_k_empty0, (u8*)&save_store.val_k_empty0 ); if ( err != 0 ) { return err; } err = max_write_verify(MAX17042_FullCAPNom, (u8*)&save_store.val_FullCAPNom); if ( err != 0 ) { return err; } //22. delay 350ms; udelay ( 350 *1000 ); //23. RestoreFullCap err = max17042_restore_fullcap(); if ( err != 0 ) { return err; } //24. delay 350ms; udelay ( 350 *1000 ); //25. restore Cycles err = max17042_set_cycles( save_store.val_Cycles ); if (err != 0 ) { DEBUG("restoring cycles failed\n"); return err; } return 0; } static int max17042_write_custom_para(void) { uint16_t buf; int err; /* * Note: This hardcoded values are specific to Encore as supplied * by Maxim via email, 16/07/2010 */ DEBUG("%s: use hardcoded values\n", __FUNCTION__); buf = 0x0080; err = max_write_verify( MAX17042_RCOMP0, (u8*)&buf ); if ( err != 0 ) { return err; } buf = 0x3670; err = max_write_verify ( MAX17042_TempCo, (u8*)&buf ); if ( err != 0 ) { DEBUG( "write verify err 0x39 \n"); return err; } buf = 0x2F2C; err = MAX_WRITE( MAX17042_Empty_TempCo, (u8*)&buf); if ( err != 0 ) { DEBUG( "write err 0x3A \n"); return err; } buf = 0x078F; err = max_write_verify( MAX17042_k_empty0, (u8*)&buf ); if ( err != 0 ) { DEBUG( "write verify err 0x3B \n"); return err; } // IchgTerm should map to 50 mA buf = (uint16_t)(0.050 * 0.01 / 0.0000015625); err = MAX_WRITE( MAX17042_ICHGTerm, (u8*)&buf ); if ( err != 0 ) { DEBUG( "write verify err reg 0x%x\n", MAX17042_ICHGTerm); return err; } DEBUG("ICHGTerm = 0x%04x\n", buf); return 0; } static int max17042_update_cap_para(void) { int err; uint16_t buf; buf = type_params->init_params->Capacity; DEBUG(" use hardcoded Capacity 0x%04x\n", buf); err = max_write_verify( MAX17042_FullCap, (u8*)&buf); if ( err != 0 ) { return err; } err = MAX_WRITE( MAX17042_DesignCap, (u8*)&buf); if ( err != 0 ) { DEBUG( "write verify err reg 0x%x\n", MAX17042_DesignCap); return err; } err = max_write_verify( MAX17042_FullCAPNom, (u8*)&buf); if ( err != 0 ) { DEBUG( "write verify err reg 0x%x\n", MAX17042_FullCAPNom); return err; } return 0; } static int max17042_write_vfsoc(void) { int err = 0; uint16_t buf; err = MAX_READ(0xFF, (u8*)&buf); if ( err != 0 ) { DEBUG( "read err 0xFF\n"); return err; } VFSOC = buf; // used in step 16 DEBUG("VFSOC = 0x%04x\n", VFSOC); buf = 0x0080; // unlock code MAX_WRITE(MAX17042_VFSOC_Unlock, (u8*)&buf); err = max_write_verify(0x48, (u8*)&VFSOC); buf = 0x0000; // lock code MAX_WRITE(MAX17042_VFSOC_Unlock, (u8*)&buf); return err; } static int max17042_load_cap_para( void ) { uint16_t buf, remcap, repcap, dq_acc, fullcap0; //16. MAX_READ(MAX17042_FullCap0, (u8*)&fullcap0); remcap = (uint16_t)( ((int)VFSOC * (int)fullcap0) / 25600 ); DEBUG("fullcap0=0x%04x VFSOC=0x%04x remcap=0x%04x\n", fullcap0, VFSOC, remcap); MAX_WRITE(MAX17042_RemCapmix, (u8*)&remcap); repcap = remcap; max_write_verify(MAX17042_RemCapREP, (u8*)&repcap); //write dQ_acc and dP_acc to 200% of capacity dq_acc = save_store.val_DesignCap / 4; max_write_verify(MAX17042_dQacc, (u8*)&dq_acc); buf = 0x3200; max_write_verify(MAX17042_dPacc, (u8*)&buf); max_write_verify(MAX17042_FullCap, (u8*)&save_store.val_DesignCap); MAX_WRITE(MAX17042_DesignCap, (u8*)&save_store.val_DesignCap); max_write_verify(MAX17042_FullCAPNom, (u8*)&save_store.val_DesignCap); return 0; } static batt_type get_battery_type(int load) { batt_type ret = BATT_LG; char *token = (char*) 0x81000000; token[0] = 'L'; token[1] = 'G'; if (load) { // Ignore the result of this command, if it fails it's LG battery... run_command("mmcinit 1; fatload mmc 1:4 0x81000000 devconf/BatteryType 0x40", 0); } if(('L' == token[0] || 'l' == token[0]) && ('G' == token[1] || 'g' == token[1]) ) { } else if (('M' == token[0] || 'm' == token[0]) && ('C' == token[1] || 'c' == token[1]) && ('N' == token[2] || 'n' == token[2]) && ('A' == token[3] || 'a' == token[3]) && ('I' == token[4] || 'i' == token[4]) && ('R' == token[5] || 'r' == token[5]) ) { ret = BATT_MCNAIR; } DEBUG("MAX17042+UBOOT: battery type=%s\n", (BATT_LG == ret)? "LG" : "MCNAIR"); return ret; } int max17042_init(int load) { uint16_t data; int i; static const uint16_t* bufp = (uint16_t*) 0x81000000; uint16_t* savestorep; int err, retries=2, force_por=0; uint16_t designcap; type_params = &param_table[get_battery_type(load)]; designcap = type_params->init_params->Capacity; i2c_init(100, MAX17042_ADDR); if ( MAX_READ(MAX17042_STATUS, (uchar*)&data) != 0) { DEBUG("MAX17042+UBOOT: No battery or 0V battery!\n"); return 1; } DEBUG("MAX17042+UBOOT: gas gauge detected (0x%04x)\n",data); //check if we need restore registers inside is_power_on_rst(); if ( is_power_on ) { DEBUG("MAX17042+UBOOT:POR detected!\n"); } else { DEBUG("MAX17042+UBOOT:WARM BOOT \n"); } if (load) { run_command("mmcinit 1; fatload mmc 1:5 0x81000000 max17042.bin 0x1000", 0); } if (*bufp != 0x1234 || !load) { DEBUG(" No valid max17042 init data found, assume no battery history \n"); is_history_exist = 0; } else { DEBUG(" Valid max17042 init data is loaded into memory \n"); } if ( is_history_exist == 1 ) { savestorep = (uint16_t*)&save_store; for ( i = 0; i <(sizeof(save_store) / sizeof(uint16_t)); i++) { DEBUG (" 0x%04x\n", *bufp); *savestorep++ = *bufp++; } #define MIN_CAP_AGING 25/100 // allow no less than 25% of design capacity before rejecting #define MAX_CAP_AGING 13/10 // reject history capacity if it seems overly big #define MIN_CAPNOM_AGING 25/100 // allow no less than 25% of nominal design capacity before rejecting #define MAX_CAPNOM_AGING 15/10 // reject history capacity if it seems overly big if ( (save_store.val_FullCAP < (uint16_t)(((uint32_t)designcap)*MIN_CAP_AGING)) || (save_store.val_FullCAP > (uint16_t)(((uint32_t)designcap)*MAX_CAP_AGING)) || (save_store.val_FullCAPNom < (uint16_t)(((uint32_t)designcap)*MIN_CAPNOM_AGING)) || (save_store.val_FullCAPNom > (uint16_t)(((uint32_t)designcap)*MAX_CAPNOM_AGING)) ) { printf("Resetting battery defaults due to faulty CAPACITY (0x%x, 0x%x)\n", save_store.val_FullCAP, save_store.val_FullCAPNom); force_por = 1; is_history_exist = 0; } else { DEBUG(" verify if mem loaded: FullcapNom was saved as %04x\n", save_store.val_FullCAPNom ); } // In case val_DesignCap in history data does not match battery's design capacity, // we should throw away the history data. if(save_store.val_DesignCap != designcap) { printf("Resetting battery defaults because Design Capactiy(0x%04X)in history data" " does not match battery's Design Capacity(0x%04X)\n", save_store.val_DesignCap, designcap); force_por = 1; is_history_exist = 0; } } save_store.val_DesignCap = designcap; i2c_init(100, 0x36); //no need if ( !is_power_on ) { // when there is no history file, assume it is a POR //if ( is_history_exist && max17042_check_init_config() == 0 ) // UPDATE: if history file doesn't exist don't do a POR, if (!force_por && max17042_check_init_config() == 0 ) { DEBUG("MAX17042+UBOOT: warm config is okay\n"); return 0; } else { /* when the config is bad but it's not a POR, then something * is quite wrong. */ DEBUG("MAX17042+UBOOT: warm config bad. soft POR\n"); is_power_on = 1; max17042_soft_por(); } } //1. Delay 500ms udelay( 500 * 1000 ); MAX17042_DUMPREG( MAX17042_Version ); MAX17042_DUMPREG( MAX17042_DesignCap ); MAX17042_DUMPREG( MAX17042_OCV ); MAX17042_DUMPREG( MAX17042_FSTAT ); MAX17042_DUMPREG( MAX17042_SOCvf ); //2. Init Configuration max17042_init_config(); //3. Save starting para max17042_save_start_para(); //4. unlock model access max17042_unlock_model(); do { //5. write custom model max17042_write_model(); //6. read model //7. verify model err = max17042_read_verify_model(); } while ( err != 0 && --retries > 0 ); if ( retries == 0 ) { DEBUG( " writing model failed\n"); return err; } retries = 2; do { //8. lock model access max17042_lock_model(); //9. verify model access is locked err = max17042_verify_lock_model(); } while ( err != 0 && --retries > 0 ); if ( retries == 0 ) { DEBUG( " locking model failed\n"); return err; } //10. write custom parameters err = max17042_write_custom_para( ); if ( err != 0 ) { DEBUG("write custom parameters failed\n"); return err; } //11 update full capacity parameters err = max17042_update_cap_para( ); if ( err != 0 ) { DEBUG("update capacity parameters failed\n"); return err; } //13. delay 350ms; udelay ( 350 *1000 ); //14. write VFSOC to VFSCO0 err = max17042_write_vfsoc(); if ( err != 0 ) { DEBUG("write vfsoc failed\n"); return err; } /* 15.5 Advance to Colomb-Counter Mode * We do this all the time. In the factory the battery is fresh (close to * design capacity, and when there is a history file we restore a known good * capacity after this, so that case it's safe to assume we have a good estimate * as well. */ err = max17042_set_cycles( 0x00A0 ); if ( err != 0 ) { DEBUG("set cycles 0x00A0 failed\n"); return err; } err = max17042_load_cap_para( ); if ( err != 0 ) { DEBUG("load capacity parameters failed\n"); return err; } max17042_clear_POR(); if ( is_history_exist ) { err = max17042_restore_learned_para(); if ( err != 0 ) { DEBUG("restore learned parameters failed\n"); return err; } } is_power_on = 0; DEBUG("Max17042 init is done\n"); return 0; } /*get the volage reading*/ int max17042_voltage( uint16_t* val) { int err; /*reading Vcell*/ err = MAX_READ(0x09, (u8*)val); if ( err != 0 ) { printf( "read 0x09 Vcell err\n"); return err; } else { (*val)>>=3; return 0; } } /*get the volage reading*/ int max17042_vfocv( uint16_t* val) { int err; /*reading Vcell*/ err = MAX_READ(0xFB, (u8*)val); if ( err != 0 ) { printf( "read 0xFB open circuit v\n"); return err; } else { (*val)>>=3; return 0; } } int max17042_soc( uint16_t* val) { int err; err = MAX_READ(0x06, (u8*)val); if ( err != 0 ) { printf( "read 0x06 SOCREP err\n"); return err; } (*val) >>= 8; //upper byte is good enough return 0; } //resolution 0.0039-degree, or 3900uC int max17042_temp( uint32_t* temp) { int err; uint16_t val; err = MAX_READ(0x08, (u8*)&val); if ( err != 0 ) { printf( "read 0x08 reg(temperature) err!\n"); return err; } else { if ( val & (1<<15) ) { *temp = COMPLEMENT_VAL(val, TEMP_RESOLUTION, 1); } else { *temp = (val & 0x7FFF) * TEMP_RESOLUTION; } return err; } }
Java
obj-y := msm_fb.o obj-$(CONFIG_FB_MSM_LOGO) += logo.o obj-$(CONFIG_FB_BACKLIGHT) += msm_fb_bl.o ifeq ($(CONFIG_FB_MSM_MDP_HW),y) # MDP obj-y += mdp.o obj-$(CONFIG_DEBUG_FS) += mdp_debugfs.o ifeq ($(CONFIG_FB_MSM_MDP40),y) obj-y += mdp4_util.o obj-y += mdp4_hsic.o else obj-y += mdp_hw_init.o obj-y += mdp_ppp.o ifeq ($(CONFIG_FB_MSM_MDP31),y) obj-y += mdp_ppp_v31.o else obj-y += mdp_ppp_v20.o endif endif ifeq ($(CONFIG_FB_MSM_OVERLAY),y) obj-y += mdp4_overlay.o obj-y += mdp4_overlay_lcdc.o ifeq ($(CONFIG_FB_MSM_MIPI_DSI),y) obj-y += mdp4_overlay_dsi_video.o obj-y += mdp4_overlay_dsi_cmd.o else obj-y += mdp4_overlay_mddi.o endif else obj-y += mdp_dma_lcdc.o endif obj-$(CONFIG_FB_MSM_MDP303) += mdp_dma_dsi_video.o ifeq ($(CONFIG_FB_MSM_DTV),y) obj-y += mdp4_dtv.o obj-y += mdp4_overlay_dtv.o endif obj-y += mdp_dma.o obj-y += mdp_dma_s.o obj-y += mdp_vsync.o obj-y += mdp_cursor.o obj-y += mdp_dma_tv.o obj-$(CONFIG_ARCH_MSM7X27A) += msm_dss_io_7x27a.o obj-$(CONFIG_ARCH_MSM8X60) += msm_dss_io_8x60.o obj-$(CONFIG_ARCH_MSM8960) += msm_dss_io_8960.o # EBI2 obj-$(CONFIG_FB_MSM_EBI2) += ebi2_lcd.o # LCDC obj-$(CONFIG_FB_MSM_LCDC) += lcdc.o # MDDI msm_mddi-objs := mddi.o mddihost.o mddihosti.o obj-$(CONFIG_FB_MSM_MDDI) += msm_mddi.o # External MDDI msm_mddi_ext-objs := mddihost_e.o mddi_ext.o obj-$(CONFIG_FB_MSM_EXTMDDI) += msm_mddi_ext.o # MIPI gereric msm_mipi-objs := mipi_dsi.o mipi_dsi_host.o obj-$(CONFIG_FB_MSM_MIPI_DSI) += msm_mipi.o # MIPI manufacture obj-$(CONFIG_FB_MSM_MIPI_DSI_TOSHIBA) += mipi_toshiba.o obj-$(CONFIG_FB_MSM_MIPI_DSI_NOVATEK) += mipi_novatek.o obj-$(CONFIG_FB_MSM_MIPI_DSI_ORISE) += mipi_orise.o obj-$(CONFIG_FB_MSM_MIPI_DSI_RENESAS) += mipi_renesas.o obj-$(CONFIG_FB_MSM_MIPI_DSI_TRULY) += mipi_truly.o obj-$(CONFIG_FB_MSM_MIPI_DSI_SIMULATOR) += mipi_simulator.o # MIPI Bridge obj-$(CONFIG_FB_MSM_MIPI_DSI_TC358764_DSI2LVDS) += mipi_tc358764_dsi2lvds.o # TVEnc obj-$(CONFIG_FB_MSM_TVOUT) += tvenc.o ifeq ($(CONFIG_FB_MSM_OVERLAY),y) obj-$(CONFIG_FB_MSM_TVOUT) += mdp4_overlay_atv.o endif # MSM FB Panel obj-y += msm_fb_panel.o obj-$(CONFIG_FB_MSM_EBI2_TMD_QVGA_EPSON_QCIF) += ebi2_tmd20.o obj-$(CONFIG_FB_MSM_EBI2_TMD_QVGA_EPSON_QCIF) += ebi2_l2f.o ifeq ($(CONFIG_FB_MSM_MDDI_AUTO_DETECT),y) obj-y += mddi_prism.o obj-y += mddi_toshiba.o obj-y += mddi_toshiba_vga.o obj-y += mddi_toshiba_wvga_pt.o obj-y += mddi_toshiba_wvga.o obj-y += mddi_sharp.o obj-y += mddi_orise.o obj-y += mddi_quickvx.o else obj-$(CONFIG_FB_MSM_MDDI_PRISM_WVGA) += mddi_prism.o obj-$(CONFIG_FB_MSM_MDDI_TOSHIBA_COMMON) += mddi_toshiba.o obj-$(CONFIG_FB_MSM_MDDI_TOSHIBA_COMMON_VGA) += mddi_toshiba_vga.o obj-$(CONFIG_FB_MSM_MDDI_TOSHIBA_WVGA_PORTRAIT) += mddi_toshiba_wvga_pt.o obj-$(CONFIG_FB_MSM_MDDI_TOSHIBA_WVGA) += mddi_toshiba_wvga.o obj-$(CONFIG_FB_MSM_MDDI_SHARP_QVGA_128x128) += mddi_sharp.o obj-$(CONFIG_FB_MSM_MDDI_ORISE) += mddi_orise.o obj-$(CONFIG_FB_MSM_MDDI_QUICKVX) += mddi_quickvx.o endif ifeq ($(CONFIG_FB_MSM_MIPI_PANEL_DETECT),y) obj-y += mipi_toshiba_video_wvga_pt.o mipi_toshiba_video_wsvga_pt.o mipi_toshiba_video_wuxga.o obj-y += mipi_novatek_video_qhd_pt.o mipi_novatek_cmd_qhd_pt.o obj-y += mipi_orise_video_720p_pt.o mipi_orise_cmd_720p_pt.o obj-y += mipi_renesas_video_fwvga_pt.o mipi_renesas_cmd_fwvga_pt.o obj-y += mipi_chimei_wxga_pt.o obj-y += mipi_chimei_wuxga.o obj-y += mipi_truly_video_wvga_pt.o else obj-$(CONFIG_FB_MSM_MIPI_TOSHIBA_VIDEO_WVGA_PT) += mipi_toshiba_video_wvga_pt.o obj-$(CONFIG_FB_MSM_MIPI_TOSHIBA_VIDEO_WSVGA_PT) += mipi_toshiba_video_wsvga_pt.o obj-$(CONFIG_FB_MSM_MIPI_TOSHIBA_VIDEO_WUXGA) += mipi_toshiba_video_wuxga.o obj-$(CONFIG_FB_MSM_MIPI_NOVATEK_VIDEO_QHD_PT) += mipi_novatek_video_qhd_pt.o obj-$(CONFIG_FB_MSM_MIPI_ORISE_VIDEO_720P_PT) += mipi_orise_video_720p_pt.o obj-$(CONFIG_FB_MSM_MIPI_ORISE_CMD_720P_PT) += mipi_orise_cmd_720p_pt.o obj-$(CONFIG_FB_MSM_MIPI_NOVATEK_CMD_QHD_PT) += mipi_novatek_cmd_qhd_pt.o obj-$(CONFIG_FB_MSM_MIPI_RENESAS_VIDEO_FWVGA_PT) += mipi_renesas_video_fwvga_pt.o obj-$(CONFIG_FB_MSM_MIPI_RENESAS_CMD_FWVGA_PT) += mipi_renesas_cmd_fwvga_pt.o obj-$(CONFIG_FB_MSM_MIPI_TRULY_VIDEO_WVGA_PT) += mipi_truly_video_wvga_pt.o obj-$(CONFIG_FB_MSM_MIPI_SIMULATOR_VIDEO) += mipi_simulator_video.o obj-$(CONFIG_FB_MSM_MIPI_CHIMEI_WXGA) += mipi_chimei_wxga_pt.o obj-$(CONFIG_FB_MSM_MIPI_CHIMEI_WUXGA) += mipi_chimei_wuxga.o endif obj-$(CONFIG_FB_MSM_LCDC_PANEL) += lcdc_panel.o obj-$(CONFIG_FB_MSM_LCDC_PRISM_WVGA) += lcdc_prism.o obj-$(CONFIG_FB_MSM_LCDC_SAMSUNG_WSVGA) += lcdc_samsung_wsvga.o obj-$(CONFIG_FB_MSM_LCDC_CHIMEI_WXGA) += lcdc_chimei_wxga.o obj-$(CONFIG_FB_MSM_LCDC_NT35582_WVGA) += lcdc_nt35582_wvga.o obj-$(CONFIG_FB_MSM_LCDC_EXTERNAL_WXGA) += lcdc_external.o obj-$(CONFIG_FB_MSM_HDMI_SII_EXTERNAL_720P) += hdmi_sii9022.o obj-$(CONFIG_FB_MSM_LCDC_GORDON_VGA) += lcdc_gordon.o obj-$(CONFIG_FB_MSM_LCDC_WXGA) += lcdc_wxga.o obj-$(CONFIG_FB_MSM_LCDC_TOSHIBA_WVGA_PT) += lcdc_toshiba_wvga_pt.o obj-$(CONFIG_FB_MSM_LCDC_TOSHIBA_FWVGA_PT) += lcdc_toshiba_fwvga_pt.o obj-$(CONFIG_FB_MSM_LCDC_SHARP_WVGA_PT) += lcdc_sharp_wvga_pt.o obj-$(CONFIG_FB_MSM_LCDC_AUO_WVGA) += lcdc_auo_wvga.o obj-$(CONFIG_FB_MSM_LCDC_SAMSUNG_OLED_PT) += lcdc_samsung_oled_pt.o obj-$(CONFIG_FB_MSM_HDMI_ADV7520_PANEL) += adv7520.o obj-$(CONFIG_FB_MSM_LCDC_ST15_WXGA) += lcdc_st15.o obj-$(CONFIG_FB_MSM_HDMI_MSM_PANEL) += hdmi_msm.o obj-$(CONFIG_FB_MSM_EXT_INTERFACE_COMMON) += external_common.o obj-$(CONFIG_FB_MSM_TVOUT) += tvout_msm.o obj-$(CONFIG_FB_MSM_EXTMDDI_SVGA) += mddi_ext_lcd.o obj-$(CONFIG_FB_MSM_WRITEBACK_MSM_PANEL) += mdp4_wfd_writeback_panel.o obj-$(CONFIG_FB_MSM_WRITEBACK_MSM_PANEL) += mdp4_wfd_writeback.o obj-$(CONFIG_FB_MSM_WRITEBACK_MSM_PANEL) += mdp4_overlay_writeback.o obj-$(CONFIG_MSM_VIDC_1080P) += vidc/ obj-$(CONFIG_MSM_VIDC_720P) += vidc/ else obj-$(CONFIG_FB_MSM_EBI2) += ebi2_host.o obj-$(CONFIG_FB_MSM_EBI2) += ebi2_lcd.o obj-y += msm_fb_panel.o obj-$(CONFIG_FB_MSM_EBI2_EPSON_S1D_QVGA_PANEL) += ebi2_epson_s1d_qvga.o endif obj-$(CONFIG_FB_MSM_SAGA_PANEL) += lcdc_sony_wvga.o obj-$(CONFIG_FB_MSM_SPADE_PANEL) += lcdc_spade_wvga.o obj-$(CONFIG_FB_MSM_VISION_PANEL) += lcdc_sony_wvga.o lcdc_samsung_s6e63m0_wvga.o lcdc_samsung_tl2796a_wvga.o clean: rm *.o .*cmd
Java
<meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="x-ua-compatible" content="ie=edge">
Java
/* * * This source code is released for free distribution under the terms of the * GNU General Public License. * * This module contains functions for generating tags for Rust files. */ /* * INCLUDE FILES */ #include "general.h" /* must always come first */ #include "main.h" #include <string.h> #include "keyword.h" #include "parse.h" #include "entry.h" #include "options.h" #include "read.h" #include "vstring.h" /* * MACROS */ #define MAX_STRING_LENGTH 64 /* * DATA DECLARATIONS */ typedef enum { K_MOD, K_STRUCT, K_TRAIT, K_IMPL, K_FN, K_ENUM, K_TYPE, K_STATIC, K_MACRO, K_FIELD, K_VARIANT, K_METHOD, K_NONE } RustKind; static kindOption rustKinds[] = { {TRUE, 'n', "namespace", "module"}, {TRUE, 's', "struct", "structural type"}, {TRUE, 'i', "interface", "trait interface"}, {TRUE, 'c', "class", "implementation"}, {TRUE, 'f', "function", "Function"}, {TRUE, 'g', "enum", "Enum"}, {TRUE, 't', "typedef", "Type Alias"}, {TRUE, 'v', "variable", "Global variable"}, {TRUE, 'M', "macro", "Macro Definition"}, {TRUE, 'm', "field", "A struct field"}, {TRUE, 'e', "enumerator", "An enum variant"}, {TRUE, 'F', "method", "A method"}, }; typedef enum { TOKEN_WHITESPACE, TOKEN_STRING, TOKEN_IDENT, TOKEN_LSHIFT, TOKEN_RSHIFT, TOKEN_RARROW, TOKEN_EOF } tokenType; typedef struct { /* Characters */ int cur_c; int next_c; /* Tokens */ int cur_token; vString* token_str; unsigned long line; MIOPos pos; } lexerState; /* * FUNCTION PROTOTYPES */ static void parseBlock (lexerState *lexer, boolean delim, int kind, vString *scope); /* * FUNCTION DEFINITIONS */ /* Resets the scope string to the old length */ static void resetScope (vString *scope, size_t old_len) { scope->length = old_len; scope->buffer[old_len] = '\0'; } /* Adds a name to the end of the scope string */ static void addToScope (vString *scope, vString *name) { if (vStringLength(scope) > 0) vStringCatS(scope, "::"); vStringCat(scope, name); } /* Write the lexer's current token to string, taking care of special tokens */ static void writeCurTokenToStr (lexerState *lexer, vString *out_str) { switch (lexer->cur_token) { case TOKEN_IDENT: vStringCat(out_str, lexer->token_str); break; case TOKEN_STRING: vStringPut(out_str, '"'); vStringCat(out_str, lexer->token_str); vStringPut(out_str, '"'); break; case TOKEN_WHITESPACE: vStringPut(out_str, ' '); break; case TOKEN_LSHIFT: vStringCatS(out_str, "<<"); break; case TOKEN_RSHIFT: vStringCatS(out_str, ">>"); break; case TOKEN_RARROW: vStringCatS(out_str, "->"); break; default: vStringPut(out_str, (char) lexer->cur_token); } } /* Reads a character from the file */ static void advanceChar (lexerState *lexer) { lexer->cur_c = lexer->next_c; lexer->next_c = fileGetc(); } /* Reads N characters from the file */ static void advanceNChar (lexerState *lexer, int n) { while (n--) advanceChar(lexer); } static boolean isWhitespace (int c) { return c == ' ' || c == '\t' || c == '\r' || c == '\n'; } static boolean isAscii (int c) { return (c >= 0) && (c < 0x80); } /* This isn't quite right for Unicode identifiers */ static boolean isIdentifierStart (int c) { return (isAscii(c) && (isalpha(c) || c == '_')) || !isAscii(c); } /* This isn't quite right for Unicode identifiers */ static boolean isIdentifierContinue (int c) { return (isAscii(c) && (isalnum(c) || c == '_')) || !isAscii(c); } static void scanWhitespace (lexerState *lexer) { while (isWhitespace(lexer->cur_c)) advanceChar(lexer); } /* Normal line comments start with two /'s and continue until the next \n * (NOT any other newline character!). Additionally, a shebang in the beginning * of the file also counts as a line comment. * Block comments start with / followed by a * and end with a * followed by a /. * Unlike in C/C++ they nest. */ static void scanComments (lexerState *lexer) { /* // or #! */ if (lexer->next_c == '/' || lexer->next_c == '!') { advanceNChar(lexer, 2); while (lexer->cur_c != EOF && lexer->cur_c != '\n') advanceChar(lexer); } else if (lexer->next_c == '*') { int level = 1; advanceNChar(lexer, 2); while (lexer->cur_c != EOF && level > 0) { if (lexer->cur_c == '*' && lexer->next_c == '/') { level--; advanceNChar(lexer, 2); } else if (lexer->cur_c == '/' && lexer->next_c == '*') { level++; advanceNChar(lexer, 2); } else { advanceChar(lexer); } } } } static void scanIdentifier (lexerState *lexer) { vStringClear(lexer->token_str); do { vStringPut(lexer->token_str, (char) lexer->cur_c); advanceChar(lexer); } while(lexer->cur_c != EOF && isIdentifierContinue(lexer->cur_c)); } /* Double-quoted strings, we only care about the \" escape. These * last past the end of the line, so be careful not too store too much * of them (see MAX_STRING_LENGTH). The only place we look at their * contents is in the function definitions, and there the valid strings are * things like "C" and "Rust" */ static void scanString (lexerState *lexer) { vStringClear(lexer->token_str); advanceChar(lexer); while (lexer->cur_c != EOF && lexer->cur_c != '"') { if (lexer->cur_c == '\\' && lexer->next_c == '"') advanceChar(lexer); if (vStringLength(lexer->token_str) < MAX_STRING_LENGTH) vStringPut(lexer->token_str, (char) lexer->cur_c); advanceChar(lexer); } advanceChar(lexer); } /* Raw strings look like this: r"" or r##""## where the number of * hashes must match */ static void scanRawString (lexerState *lexer) { size_t num_initial_hashes = 0; vStringClear(lexer->token_str); advanceChar(lexer); /* Count how many leading hashes there are */ while (lexer->cur_c == '#') { num_initial_hashes++; advanceChar(lexer); } if (lexer->cur_c != '"') return; advanceChar(lexer); while (lexer->cur_c != EOF) { if (vStringLength(lexer->token_str) < MAX_STRING_LENGTH) vStringPut(lexer->token_str, (char) lexer->cur_c); /* Count how many trailing hashes there are. If the number is equal or more * than the number of leading hashes, break. */ if (lexer->cur_c == '"') { size_t num_trailing_hashes = 0; advanceChar(lexer); while (lexer->cur_c == '#' && num_trailing_hashes < num_initial_hashes) { num_trailing_hashes++; if (vStringLength(lexer->token_str) < MAX_STRING_LENGTH) vStringPut(lexer->token_str, (char) lexer->cur_c); advanceChar(lexer); } if (num_trailing_hashes == num_initial_hashes) { /* Strip the trailing hashes and quotes */ if (vStringLength(lexer->token_str) < MAX_STRING_LENGTH && vStringLength(lexer->token_str) > num_trailing_hashes + 1) { lexer->token_str->length = vStringLength(lexer->token_str) - num_trailing_hashes - 1; lexer->token_str->buffer[lexer->token_str->length] = '\0'; } break; } } else { advanceChar(lexer); } } } /* Advances the parser one token, optionally skipping whitespace * (otherwise it is concatenated and returned as a single whitespace token). * Whitespace is needed to properly render function signatures. Unrecognized * token starts are stored literally, e.g. token may equal to a character '#'. */ static int advanceToken (lexerState *lexer, boolean skip_whitspace) { boolean have_whitespace = FALSE; lexer->line = getSourceLineNumber(); lexer->pos = getInputFilePosition(); while (lexer->cur_c != EOF) { if (isWhitespace(lexer->cur_c)) { scanWhitespace(lexer); have_whitespace = TRUE; } else if (lexer->cur_c == '/' && (lexer->next_c == '/' || lexer->next_c == '*')) { scanComments(lexer); have_whitespace = TRUE; } else { if (have_whitespace && !skip_whitspace) return lexer->cur_token = TOKEN_WHITESPACE; break; } } lexer->line = getSourceLineNumber(); lexer->pos = getInputFilePosition(); while (lexer->cur_c != EOF) { if (lexer->cur_c == '"') { scanString(lexer); return lexer->cur_token = TOKEN_STRING; } else if (lexer->cur_c == 'r' && (lexer->next_c == '#' || lexer->next_c == '"')) { scanRawString(lexer); return lexer->cur_token = TOKEN_STRING; } else if (isIdentifierStart(lexer->cur_c)) { scanIdentifier(lexer); return lexer->cur_token = TOKEN_IDENT; } /* These shift tokens aren't too important for tag-generation per se, * but they confuse the skipUntil code which tracks the <> pairs. */ else if (lexer->cur_c == '>' && lexer->next_c == '>') { advanceNChar(lexer, 2); return lexer->cur_token = TOKEN_RSHIFT; } else if (lexer->cur_c == '<' && lexer->next_c == '<') { advanceNChar(lexer, 2); return lexer->cur_token = TOKEN_LSHIFT; } else if (lexer->cur_c == '-' && lexer->next_c == '>') { advanceNChar(lexer, 2); return lexer->cur_token = TOKEN_RARROW; } else { int c = lexer->cur_c; advanceChar(lexer); return lexer->cur_token = c; } } return lexer->cur_token = TOKEN_EOF; } static void initLexer (lexerState *lexer) { advanceNChar(lexer, 2); lexer->token_str = vStringNew(); if (lexer->cur_c == '#' && lexer->next_c == '!') scanComments(lexer); advanceToken(lexer, TRUE); } static void deInitLexer (lexerState *lexer) { vStringDelete(lexer->token_str); lexer->token_str = NULL; } static void addTag (vString* ident, const char* type, const char* arg_list, int kind, unsigned long line, MIOPos pos, vString *scope, int parent_kind) { if (kind == K_NONE) return; tagEntryInfo tag; initTagEntry(&tag, ident->buffer); tag.lineNumber = line; tag.filePosition = pos; tag.sourceFileName = getSourceFileName(); tag.kindName = rustKinds[kind].name; tag.kind = rustKinds[kind].letter; tag.extensionFields.arglist = arg_list; tag.extensionFields.varType = type; if (parent_kind != K_NONE) { tag.extensionFields.scope[0] = rustKinds[parent_kind].name; tag.extensionFields.scope[1] = scope->buffer; } makeTagEntry(&tag); } /* Skip tokens until one of the goal tokens is hit. Escapes when level = 0 if there are no goal tokens. * Keeps track of balanced <>'s, ()'s, []'s, and {}'s and ignores the goal tokens within those pairings */ static void skipUntil (lexerState *lexer, int goal_tokens[], int num_goal_tokens) { int angle_level = 0; int paren_level = 0; int brace_level = 0; int bracket_level = 0; while (lexer->cur_token != TOKEN_EOF) { if (angle_level == 0 && paren_level == 0 && brace_level == 0 && bracket_level == 0) { int ii = 0; for(ii = 0; ii < num_goal_tokens; ii++) { if (lexer->cur_token == goal_tokens[ii]) { break; } } if (ii < num_goal_tokens) break; } switch (lexer->cur_token) { case '<': angle_level++; break; case '(': paren_level++; break; case '{': brace_level++; break; case '[': bracket_level++; break; case '>': angle_level--; break; case ')': paren_level--; break; case '}': brace_level--; break; case ']': bracket_level--; break; case TOKEN_RSHIFT: if (angle_level >= 2) angle_level -= 2; break; /* TOKEN_LSHIFT is never interpreted as two <'s in valid Rust code */ default: break; } /* Has to be after the token switch to catch the case when we start with the initial level token */ if (num_goal_tokens == 0 && angle_level == 0 && paren_level == 0 && brace_level == 0 && bracket_level == 0) break; advanceToken(lexer, TRUE); } } /* Function format: * "fn" <ident>[<type_bounds>] "(" [<args>] ")" ["->" <ret_type>] "{" [<body>] "}"*/ static void parseFn (lexerState *lexer, vString *scope, int parent_kind) { int kind = (parent_kind == K_TRAIT || parent_kind == K_IMPL) ? K_METHOD : K_FN; vString *name; vString *arg_list; unsigned long line; MIOPos pos; int paren_level = 0; boolean found_paren = FALSE; boolean valid_signature = TRUE; advanceToken(lexer, TRUE); if (lexer->cur_token != TOKEN_IDENT) return; name = vStringNewCopy(lexer->token_str); arg_list = vStringNew(); line = lexer->line; pos = lexer->pos; advanceToken(lexer, TRUE); /* HACK: This is a bit coarse as far as what tag entry means by * 'arglist'... */ while (lexer->cur_token != '{' && lexer->cur_token != ';') { if (lexer->cur_token == '}') { valid_signature = FALSE; break; } else if (lexer->cur_token == '(') { found_paren = TRUE; paren_level++; } else if (lexer->cur_token == ')') { paren_level--; if (paren_level < 0) { valid_signature = FALSE; break; } } else if (lexer->cur_token == TOKEN_EOF) { valid_signature = FALSE; break; } writeCurTokenToStr(lexer, arg_list); advanceToken(lexer, FALSE); } if (!found_paren || paren_level != 0) valid_signature = FALSE; if (valid_signature) { vStringStripTrailing(arg_list); addTag(name, NULL, arg_list->buffer, kind, line, pos, scope, parent_kind); addToScope(scope, name); parseBlock(lexer, TRUE, kind, scope); } vStringDelete(name); vStringDelete(arg_list); } /* Mod format: * "mod" <ident> "{" [<body>] "}" * "mod" <ident> ";"*/ static void parseMod (lexerState *lexer, vString *scope, int parent_kind) { advanceToken(lexer, TRUE); if (lexer->cur_token != TOKEN_IDENT) return; addTag(lexer->token_str, NULL, NULL, K_MOD, lexer->line, lexer->pos, scope, parent_kind); addToScope(scope, lexer->token_str); advanceToken(lexer, TRUE); parseBlock(lexer, TRUE, K_MOD, scope); } /* Trait format: * "trait" <ident> [<type_bounds>] "{" [<body>] "}" */ static void parseTrait (lexerState *lexer, vString *scope, int parent_kind) { int goal_tokens[] = {'{'}; advanceToken(lexer, TRUE); if (lexer->cur_token != TOKEN_IDENT) return; addTag(lexer->token_str, NULL, NULL, K_TRAIT, lexer->line, lexer->pos, scope, parent_kind); addToScope(scope, lexer->token_str); advanceToken(lexer, TRUE); skipUntil(lexer, goal_tokens, 1); parseBlock(lexer, TRUE, K_TRAIT, scope); } /* Skips type blocks of the form <T:T<T>, ...> */ static void skipTypeBlock (lexerState *lexer) { if (lexer->cur_token == '<') { skipUntil(lexer, NULL, 0); advanceToken(lexer, TRUE); } } /* Essentially grabs the last ident before 'for', '<' and '{', which * tends to correspond to what we want as the impl tag entry name */ static void parseQualifiedType (lexerState *lexer, vString* name) { while (lexer->cur_token != TOKEN_EOF) { if (lexer->cur_token == TOKEN_IDENT) { if (strcmp(lexer->token_str->buffer, "for") == 0) break; vStringClear(name); vStringCat(name, lexer->token_str); } else if (lexer->cur_token == '<' || lexer->cur_token == '{') { break; } advanceToken(lexer, TRUE); } skipTypeBlock(lexer); } /* Impl format: * "impl" [<type_bounds>] <qualified_ident>[<type_bounds>] ["for" <qualified_ident>[<type_bounds>]] "{" [<body>] "}" */ static void parseImpl (lexerState *lexer, vString *scope, int parent_kind) { unsigned long line; MIOPos pos; vString *name; advanceToken(lexer, TRUE); line = lexer->line; pos = lexer->pos; skipTypeBlock(lexer); name = vStringNew(); parseQualifiedType(lexer, name); if (lexer->cur_token == TOKEN_IDENT && strcmp(lexer->token_str->buffer, "for") == 0) { advanceToken(lexer, TRUE); parseQualifiedType(lexer, name); } addTag(name, NULL, NULL, K_IMPL, line, pos, scope, parent_kind); addToScope(scope, name); parseBlock(lexer, TRUE, K_IMPL, scope); vStringDelete(name); } /* Static format: * "static" ["mut"] <ident> */ static void parseStatic (lexerState *lexer, vString *scope, int parent_kind) { advanceToken(lexer, TRUE); if (lexer->cur_token != TOKEN_IDENT) return; if (strcmp(lexer->token_str->buffer, "mut") == 0) { advanceToken(lexer, TRUE); } if (lexer->cur_token != TOKEN_IDENT) return; addTag(lexer->token_str, NULL, NULL, K_STATIC, lexer->line, lexer->pos, scope, parent_kind); } /* Type format: * "type" <ident> */ static void parseType (lexerState *lexer, vString *scope, int parent_kind) { advanceToken(lexer, TRUE); if (lexer->cur_token != TOKEN_IDENT) return; addTag(lexer->token_str, NULL, NULL, K_TYPE, lexer->line, lexer->pos, scope, parent_kind); } /* Structs and enums are very similar syntax-wise. * It is possible to parse variants a bit more cleverly (e.g. make tuple variants functions and * struct variants structs) but it'd be too clever and the signature wouldn't make too much sense without * the enum's definition (e.g. for the type bounds) * * Struct/Enum format: * "struct/enum" <ident>[<type_bounds>] "{" [<ident>,]+ "}" * "struct/enum" <ident>[<type_bounds>] ";" * */ static void parseStructOrEnum (lexerState *lexer, vString *scope, int parent_kind, boolean is_struct) { int kind = is_struct ? K_STRUCT : K_ENUM; int field_kind = is_struct ? K_FIELD : K_VARIANT; int goal_tokens1[] = {';', '{'}; advanceToken(lexer, TRUE); if (lexer->cur_token != TOKEN_IDENT) return; addTag(lexer->token_str, NULL, NULL, kind, lexer->line, lexer->pos, scope, parent_kind); addToScope(scope, lexer->token_str); skipUntil(lexer, goal_tokens1, 2); if (lexer->cur_token == '{') { vString *field_name = vStringNew(); while (lexer->cur_token != TOKEN_EOF) { int goal_tokens2[] = {'}', ','}; /* Skip attributes. Format: * #[..] or #![..] * */ if (lexer->cur_token == '#') { advanceToken(lexer, TRUE); if (lexer->cur_token == '!') advanceToken(lexer, TRUE); if (lexer->cur_token == '[') { /* It's an attribute, skip it. */ skipUntil(lexer, NULL, 0); } else { /* Something's up with this field, skip to the next one */ skipUntil(lexer, goal_tokens2, 2); continue; } } if (lexer->cur_token == TOKEN_IDENT) { if (strcmp(lexer->token_str->buffer, "priv") == 0 || strcmp(lexer->token_str->buffer, "pub") == 0) { advanceToken(lexer, TRUE); if (lexer->cur_token != TOKEN_IDENT) { /* Something's up with this field, skip to the next one */ skipUntil(lexer, goal_tokens2, 2); continue; } } vStringClear(field_name); vStringCat(field_name, lexer->token_str); addTag(field_name, NULL, NULL, field_kind, lexer->line, lexer->pos, scope, kind); skipUntil(lexer, goal_tokens2, 2); } if (lexer->cur_token == '}') { advanceToken(lexer, TRUE); break; } advanceToken(lexer, TRUE); } vStringDelete(field_name); } } /* Skip the body of the macro. Can't use skipUntil here as * the body of the macro may have arbitrary code which confuses it (e.g. * bitshift operators/function return arrows) */ static void skipMacro (lexerState *lexer) { int level = 0; int plus_token = 0; int minus_token = 0; advanceToken(lexer, TRUE); switch (lexer->cur_token) { case '(': plus_token = '('; minus_token = ')'; break; case '{': plus_token = '{'; minus_token = '}'; break; case '[': plus_token = '['; minus_token = ']'; break; default: return; } while (lexer->cur_token != TOKEN_EOF) { if (lexer->cur_token == plus_token) level++; else if (lexer->cur_token == minus_token) level--; if (level == 0) break; advanceToken(lexer, TRUE); } advanceToken(lexer, TRUE); } /* * Macro rules format: * "macro_rules" "!" <ident> <macro_body> */ static void parseMacroRules (lexerState *lexer, vString *scope, int parent_kind) { advanceToken(lexer, TRUE); if (lexer->cur_token != '!') return; advanceToken(lexer, TRUE); if (lexer->cur_token != TOKEN_IDENT) return; addTag(lexer->token_str, NULL, NULL, K_MACRO, lexer->line, lexer->pos, scope, parent_kind); skipMacro(lexer); } /* * Rust is very liberal with nesting, so this function is used pretty much for any block */ static void parseBlock (lexerState *lexer, boolean delim, int kind, vString *scope) { int level = 1; if (delim) { if (lexer->cur_token != '{') return; advanceToken(lexer, TRUE); } while (lexer->cur_token != TOKEN_EOF) { if (lexer->cur_token == TOKEN_IDENT) { size_t old_scope_len = vStringLength(scope); if (strcmp(lexer->token_str->buffer, "fn") == 0) { parseFn(lexer, scope, kind); } else if(strcmp(lexer->token_str->buffer, "mod") == 0) { parseMod(lexer, scope, kind); } else if(strcmp(lexer->token_str->buffer, "static") == 0) { parseStatic(lexer, scope, kind); } else if(strcmp(lexer->token_str->buffer, "trait") == 0) { parseTrait(lexer, scope, kind); } else if(strcmp(lexer->token_str->buffer, "type") == 0) { parseType(lexer, scope, kind); } else if(strcmp(lexer->token_str->buffer, "impl") == 0) { parseImpl(lexer, scope, kind); } else if(strcmp(lexer->token_str->buffer, "struct") == 0) { parseStructOrEnum(lexer, scope, kind, TRUE); } else if(strcmp(lexer->token_str->buffer, "enum") == 0) { parseStructOrEnum(lexer, scope, kind, FALSE); } else if(strcmp(lexer->token_str->buffer, "macro_rules") == 0) { parseMacroRules(lexer, scope, kind); } else { advanceToken(lexer, TRUE); if (lexer->cur_token == '!') { skipMacro(lexer); } } resetScope(scope, old_scope_len); } else if (lexer->cur_token == '{') { level++; advanceToken(lexer, TRUE); } else if (lexer->cur_token == '}') { level--; advanceToken(lexer, TRUE); } else if (lexer->cur_token == '\'') { /* Skip over the 'static lifetime, as it confuses the static parser above */ advanceToken(lexer, TRUE); if (lexer->cur_token == TOKEN_IDENT && strcmp(lexer->token_str->buffer, "static") == 0) advanceToken(lexer, TRUE); } else { advanceToken(lexer, TRUE); } if (delim && level <= 0) break; } } static void findRustTags (void) { lexerState lexer; vString* scope = vStringNew(); initLexer(&lexer); parseBlock(&lexer, FALSE, K_NONE, scope); vStringDelete(scope); deInitLexer(&lexer); } extern parserDefinition *RustParser (void) { static const char *const extensions[] = { "rs", NULL }; parserDefinition *def = parserNew ("Rust"); def->kinds = rustKinds; def->kindCount = KIND_COUNT (rustKinds); def->extensions = extensions; def->parser = findRustTags; return def; }
Java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <string.h> #include <math.h> #include "vmi.h" #include "cbigint.h" #include "harmonyglob.h" #include "exceptions.h" #if defined(LINUX) || defined(FREEBSD) || defined(ZOS) || defined(MACOSX) || defined(AIX) #define USE_LL #endif #define LOW_I32_FROM_VAR(u64) LOW_I32_FROM_LONG64(u64) #define LOW_I32_FROM_PTR(u64ptr) LOW_I32_FROM_LONG64_PTR(u64ptr) #define HIGH_I32_FROM_VAR(u64) HIGH_I32_FROM_LONG64(u64) #define HIGH_I32_FROM_PTR(u64ptr) HIGH_I32_FROM_LONG64_PTR(u64ptr) #define MAX_ACCURACY_WIDTH 17 #define DEFAULT_WIDTH MAX_ACCURACY_WIDTH JNIEXPORT jdouble JNICALL Java_org_apache_harmony_luni_util_FloatingPointParser_parseDblImpl (JNIEnv * env, jclass clazz, jstring s, jint e); JNIEXPORT void JNICALL Java_org_apache_harmony_luni_util_NumberConverter_bigIntDigitGeneratorInstImpl (JNIEnv * env, jobject inst, jlong f, jint e, jboolean isDenormalized, jboolean mantissaIsZero, jint p); jdouble createDouble (JNIEnv * env, const char *s, jint e); jdouble createDouble1 (JNIEnv * env, U_64 * f, IDATA length, jint e); jdouble doubleAlgorithm (JNIEnv * env, U_64 * f, IDATA length, jint e, jdouble z); U_64 dblparse_shiftRight64 (U_64 * lp, volatile int mbe); static const jdouble tens[] = { 1.0, 1.0e1, 1.0e2, 1.0e3, 1.0e4, 1.0e5, 1.0e6, 1.0e7, 1.0e8, 1.0e9, 1.0e10, 1.0e11, 1.0e12, 1.0e13, 1.0e14, 1.0e15, 1.0e16, 1.0e17, 1.0e18, 1.0e19, 1.0e20, 1.0e21, 1.0e22 }; #define tenToTheE(e) (*(tens + (e))) #define LOG5_OF_TWO_TO_THE_N 23 #define INV_LOG_OF_TEN_BASE_2 (0.30102999566398114) #define DOUBLE_MIN_VALUE 5.0e-324 #define sizeOfTenToTheE(e) (((e) / 19) + 1) #if defined(USE_LL) #define INFINITE_LONGBITS (0x7FF0000000000000LL) #else #if defined(USE_L) #define INFINITE_LONGBITS (0x7FF0000000000000L) #else #define INFINITE_LONGBITS (0x7FF0000000000000) #endif /* USE_L */ #endif /* USE_LL */ #define MINIMUM_LONGBITS (0x1) #if defined(USE_LL) #define MANTISSA_MASK (0x000FFFFFFFFFFFFFLL) #define EXPONENT_MASK (0x7FF0000000000000LL) #define NORMAL_MASK (0x0010000000000000LL) #else #if defined(USE_L) #define MANTISSA_MASK (0x000FFFFFFFFFFFFFL) #define EXPONENT_MASK (0x7FF0000000000000L) #define NORMAL_MASK (0x0010000000000000L) #else #define MANTISSA_MASK (0x000FFFFFFFFFFFFF) #define EXPONENT_MASK (0x7FF0000000000000) #define NORMAL_MASK (0x0010000000000000) #endif /* USE_L */ #endif /* USE_LL */ #define DOUBLE_TO_LONGBITS(dbl) (*((U_64 *)(&dbl))) /* Keep a count of the number of times we decrement and increment to * approximate the double, and attempt to detect the case where we * could potentially toggle back and forth between decrementing and * incrementing. It is possible for us to be stuck in the loop when * incrementing by one or decrementing by one may exceed or stay below * the value that we are looking for. In this case, just break out of * the loop if we toggle between incrementing and decrementing for more * than twice. */ #define INCREMENT_DOUBLE(_x, _decCount, _incCount) \ { \ ++DOUBLE_TO_LONGBITS(_x); \ _incCount++; \ if( (_incCount > 2) && (_decCount > 2) ) { \ if( _decCount > _incCount ) { \ DOUBLE_TO_LONGBITS(_x) += _decCount - _incCount; \ } else if( _incCount > _decCount ) { \ DOUBLE_TO_LONGBITS(_x) -= _incCount - _decCount; \ } \ break; \ } \ } #define DECREMENT_DOUBLE(_x, _decCount, _incCount) \ { \ --DOUBLE_TO_LONGBITS(_x); \ _decCount++; \ if( (_incCount > 2) && (_decCount > 2) ) { \ if( _decCount > _incCount ) { \ DOUBLE_TO_LONGBITS(_x) += _decCount - _incCount; \ } else if( _incCount > _decCount ) { \ DOUBLE_TO_LONGBITS(_x) -= _incCount - _decCount; \ } \ break; \ } \ } #define ERROR_OCCURED(x) (HIGH_I32_FROM_VAR(x) < 0) #define allocateU64(x, n) if (!((x) = (U_64*) hymem_allocate_memory((n) * sizeof(U_64)))) goto OutOfMemory; #define release(r) if ((r)) hymem_free_memory((r)); /*NB the Number converter methods are synchronized so it is possible to *have global data for use by bigIntDigitGenerator */ #define RM_SIZE 21 #define STemp_SIZE 22 jdouble createDouble (JNIEnv * env, const char *s, jint e) { /* assumes s is a null terminated string with at least one * character in it */ U_64 def[DEFAULT_WIDTH]; U_64 defBackup[DEFAULT_WIDTH]; U_64 *f, *fNoOverflow, *g, *tempBackup; U_32 overflow; jdouble result; IDATA index = 1; int unprocessedDigits = 0; f = def; fNoOverflow = defBackup; *f = 0; tempBackup = g = 0; do { if (*s >= '0' && *s <= '9') { /* Make a back up of f before appending, so that we can * back out of it if there is no more room, i.e. index > * MAX_ACCURACY_WIDTH. */ memcpy (fNoOverflow, f, sizeof (U_64) * index); overflow = simpleAppendDecimalDigitHighPrecision (f, index, *s - '0'); if (overflow) { f[index++] = overflow; /* There is an overflow, but there is no more room * to store the result. We really only need the top 52 * bits anyway, so we must back out of the overflow, * and ignore the rest of the string. */ if (index >= MAX_ACCURACY_WIDTH) { index--; memcpy (f, fNoOverflow, sizeof (U_64) * index); break; } if (tempBackup) { fNoOverflow = tempBackup; } } } else index = -1; } while (index > 0 && *(++s) != '\0'); /* We've broken out of the parse loop either because we've reached * the end of the string or we've overflowed the maximum accuracy * limit of a double. If we still have unprocessed digits in the * given string, then there are three possible results: * 1. (unprocessed digits + e) == 0, in which case we simply * convert the existing bits that are already parsed * 2. (unprocessed digits + e) < 0, in which case we simply * convert the existing bits that are already parsed along * with the given e * 3. (unprocessed digits + e) > 0 indicates that the value is * simply too big to be stored as a double, so return Infinity */ if ((unprocessedDigits = strlen (s)) > 0) { e += unprocessedDigits; if (index > -1) { if (e == 0) result = toDoubleHighPrecision (f, index); else if (e < 0) result = createDouble1 (env, f, index, e); else { DOUBLE_TO_LONGBITS (result) = INFINITE_LONGBITS; } } else { LOW_I32_FROM_VAR (result) = -1; HIGH_I32_FROM_VAR (result) = -1; } } else { if (index > -1) { if (e == 0) result = toDoubleHighPrecision (f, index); else result = createDouble1 (env, f, index, e); } else { LOW_I32_FROM_VAR (result) = -1; HIGH_I32_FROM_VAR (result) = -1; } } return result; } jdouble createDouble1 (JNIEnv * env, U_64 * f, IDATA length, jint e) { IDATA numBits; jdouble result; #define APPROX_MIN_MAGNITUDE -309 #define APPROX_MAX_MAGNITUDE 309 numBits = highestSetBitHighPrecision (f, length) + 1; numBits -= lowestSetBitHighPrecision (f, length); if (numBits < 54 && e >= 0 && e < LOG5_OF_TWO_TO_THE_N) { return toDoubleHighPrecision (f, length) * tenToTheE (e); } else if (numBits < 54 && e < 0 && (-e) < LOG5_OF_TWO_TO_THE_N) { return toDoubleHighPrecision (f, length) / tenToTheE (-e); } else if (e >= 0 && e < APPROX_MAX_MAGNITUDE) { result = toDoubleHighPrecision (f, length) * pow (10.0, (double) e); } else if (e >= APPROX_MAX_MAGNITUDE) { /* Convert the partial result to make sure that the * non-exponential part is not zero. This check fixes the case * where the user enters 0.0e309! */ result = toDoubleHighPrecision (f, length); /* Don't go straight to zero as the fact that x*0 = 0 independent of x might cause the algorithm to produce an incorrect result. Instead try the min value first and let it fall to zero if need be. */ if (result == 0.0) DOUBLE_TO_LONGBITS (result) = MINIMUM_LONGBITS; else DOUBLE_TO_LONGBITS (result) = INFINITE_LONGBITS; } else if (e > APPROX_MIN_MAGNITUDE) { result = toDoubleHighPrecision (f, length) / pow (10.0, (double) -e); } if (e <= APPROX_MIN_MAGNITUDE) { result = toDoubleHighPrecision (f, length) * pow (10.0, (double) (e + 52)); result = result * pow (10.0, (double) -52); } /* Don't go straight to zero as the fact that x*0 = 0 independent of x might cause the algorithm to produce an incorrect result. Instead try the min value first and let it fall to zero if need be. */ if (result == 0.0) DOUBLE_TO_LONGBITS (result) = MINIMUM_LONGBITS; return doubleAlgorithm (env, f, length, e, result); } U_64 dblparse_shiftRight64 (U_64 * lp, volatile int mbe) { U_64 b1Value = 0; U_32 hi = HIGH_U32_FROM_LONG64_PTR (lp); U_32 lo = LOW_U32_FROM_LONG64_PTR (lp); int srAmt; if (mbe == 0) return 0; if (mbe >= 128) { HIGH_U32_FROM_LONG64_PTR (lp) = 0; LOW_U32_FROM_LONG64_PTR (lp) = 0; return 0; } /* Certain platforms do not handle de-referencing a 64-bit value * from a pointer on the stack correctly (e.g. MVL-hh/XScale) * because the pointer may not be properly aligned, so we'll have * to handle two 32-bit chunks. */ if (mbe < 32) { LOW_U32_FROM_LONG64 (b1Value) = 0; HIGH_U32_FROM_LONG64 (b1Value) = lo << (32 - mbe); LOW_U32_FROM_LONG64_PTR (lp) = (hi << (32 - mbe)) | (lo >> mbe); HIGH_U32_FROM_LONG64_PTR (lp) = hi >> mbe; } else if (mbe == 32) { LOW_U32_FROM_LONG64 (b1Value) = 0; HIGH_U32_FROM_LONG64 (b1Value) = lo; LOW_U32_FROM_LONG64_PTR (lp) = hi; HIGH_U32_FROM_LONG64_PTR (lp) = 0; } else if (mbe < 64) { srAmt = mbe - 32; LOW_U32_FROM_LONG64 (b1Value) = lo << (32 - srAmt); HIGH_U32_FROM_LONG64 (b1Value) = (hi << (32 - srAmt)) | (lo >> srAmt); LOW_U32_FROM_LONG64_PTR (lp) = hi >> srAmt; HIGH_U32_FROM_LONG64_PTR (lp) = 0; } else if (mbe == 64) { LOW_U32_FROM_LONG64 (b1Value) = lo; HIGH_U32_FROM_LONG64 (b1Value) = hi; LOW_U32_FROM_LONG64_PTR (lp) = 0; HIGH_U32_FROM_LONG64_PTR (lp) = 0; } else if (mbe < 96) { srAmt = mbe - 64; b1Value = *lp; HIGH_U32_FROM_LONG64_PTR (lp) = 0; LOW_U32_FROM_LONG64_PTR (lp) = 0; LOW_U32_FROM_LONG64 (b1Value) >>= srAmt; LOW_U32_FROM_LONG64 (b1Value) |= (hi << (32 - srAmt)); HIGH_U32_FROM_LONG64 (b1Value) >>= srAmt; } else if (mbe == 96) { LOW_U32_FROM_LONG64 (b1Value) = hi; HIGH_U32_FROM_LONG64 (b1Value) = 0; HIGH_U32_FROM_LONG64_PTR (lp) = 0; LOW_U32_FROM_LONG64_PTR (lp) = 0; } else { LOW_U32_FROM_LONG64 (b1Value) = hi >> (mbe - 96); HIGH_U32_FROM_LONG64 (b1Value) = 0; HIGH_U32_FROM_LONG64_PTR (lp) = 0; LOW_U32_FROM_LONG64_PTR (lp) = 0; } return b1Value; } #if defined(WIN32) /* disable global optimizations on the microsoft compiler for the * doubleAlgorithm function otherwise it won't compile */ #pragma optimize("g",off) #endif /* The algorithm for the function doubleAlgorithm() below can be found * in: * * "How to Read Floating-Point Numbers Accurately", William D. * Clinger, Proceedings of the ACM SIGPLAN '90 Conference on * Programming Language Design and Implementation, June 20-22, * 1990, pp. 92-101. * * There is a possibility that the function will end up in an endless * loop if the given approximating floating-point number (a very small * floating-point whose value is very close to zero) straddles between * two approximating integer values. We modified the algorithm slightly * to detect the case where it oscillates back and forth between * incrementing and decrementing the floating-point approximation. It * is currently set such that if the oscillation occurs more than twice * then return the original approximation. */ jdouble doubleAlgorithm (JNIEnv * env, U_64 * f, IDATA length, jint e, jdouble z) { U_64 m; IDATA k, comparison, comparison2; U_64 *x, *y, *D, *D2; IDATA xLength, yLength, DLength, D2Length, decApproxCount, incApproxCount; PORT_ACCESS_FROM_ENV (env); x = y = D = D2 = 0; xLength = yLength = DLength = D2Length = 0; decApproxCount = incApproxCount = 0; do { m = doubleMantissa (z); k = doubleExponent (z); if (x && x != f) jclmem_free_memory (env, x); release (y); release (D); release (D2); if (e >= 0 && k >= 0) { xLength = sizeOfTenToTheE (e) + length; allocateU64 (x, xLength); memset (x + length, 0, sizeof (U_64) * (xLength - length)); memcpy (x, f, sizeof (U_64) * length); timesTenToTheEHighPrecision (x, xLength, e); yLength = (k >> 6) + 2; allocateU64 (y, yLength); memset (y + 1, 0, sizeof (U_64) * (yLength - 1)); *y = m; simpleShiftLeftHighPrecision (y, yLength, k); } else if (e >= 0) { xLength = sizeOfTenToTheE (e) + length + ((-k) >> 6) + 1; allocateU64 (x, xLength); memset (x + length, 0, sizeof (U_64) * (xLength - length)); memcpy (x, f, sizeof (U_64) * length); timesTenToTheEHighPrecision (x, xLength, e); simpleShiftLeftHighPrecision (x, xLength, -k); yLength = 1; allocateU64 (y, 1); *y = m; } else if (k >= 0) { xLength = length; x = f; yLength = sizeOfTenToTheE (-e) + 2 + (k >> 6); allocateU64 (y, yLength); memset (y + 1, 0, sizeof (U_64) * (yLength - 1)); *y = m; timesTenToTheEHighPrecision (y, yLength, -e); simpleShiftLeftHighPrecision (y, yLength, k); } else { xLength = length + ((-k) >> 6) + 1; allocateU64 (x, xLength); memset (x + length, 0, sizeof (U_64) * (xLength - length)); memcpy (x, f, sizeof (U_64) * length); simpleShiftLeftHighPrecision (x, xLength, -k); yLength = sizeOfTenToTheE (-e) + 1; allocateU64 (y, yLength); memset (y + 1, 0, sizeof (U_64) * (yLength - 1)); *y = m; timesTenToTheEHighPrecision (y, yLength, -e); } comparison = compareHighPrecision (x, xLength, y, yLength); if (comparison > 0) { /* x > y */ DLength = xLength; allocateU64 (D, DLength); memcpy (D, x, DLength * sizeof (U_64)); subtractHighPrecision (D, DLength, y, yLength); } else if (comparison) { /* y > x */ DLength = yLength; allocateU64 (D, DLength); memcpy (D, y, DLength * sizeof (U_64)); subtractHighPrecision (D, DLength, x, xLength); } else { /* y == x */ DLength = 1; allocateU64 (D, 1); *D = 0; } D2Length = DLength + 1; allocateU64 (D2, D2Length); m <<= 1; multiplyHighPrecision (D, DLength, &m, 1, D2, D2Length); m >>= 1; comparison2 = compareHighPrecision (D2, D2Length, y, yLength); if (comparison2 < 0) { if (comparison < 0 && m == NORMAL_MASK) { simpleShiftLeftHighPrecision (D2, D2Length, 1); if (compareHighPrecision (D2, D2Length, y, yLength) > 0) { DECREMENT_DOUBLE (z, decApproxCount, incApproxCount); } else { break; } } else { break; } } else if (comparison2 == 0) { if ((LOW_U32_FROM_VAR (m) & 1) == 0) { if (comparison < 0 && m == NORMAL_MASK) { DECREMENT_DOUBLE (z, decApproxCount, incApproxCount); } else { break; } } else if (comparison < 0) { DECREMENT_DOUBLE (z, decApproxCount, incApproxCount); break; } else { INCREMENT_DOUBLE (z, decApproxCount, incApproxCount); break; } } else if (comparison < 0) { DECREMENT_DOUBLE (z, decApproxCount, incApproxCount); } else { if (DOUBLE_TO_LONGBITS (z) == INFINITE_LONGBITS) break; INCREMENT_DOUBLE (z, decApproxCount, incApproxCount); } } while (1); if (x && x != f) jclmem_free_memory (env, x); release (y); release (D); release (D2); return z; OutOfMemory: if (x && x != f) jclmem_free_memory (env, x); release (y); release (D); release (D2); DOUBLE_TO_LONGBITS (z) = -2; return z; } #if defined(WIN32) #pragma optimize("",on) /*restore optimizations */ #endif JNIEXPORT jdouble JNICALL Java_org_apache_harmony_luni_util_FloatingPointParser_parseDblImpl (JNIEnv * env, jclass clazz, jstring s, jint e) { jdouble dbl; const char *str = (*env)->GetStringUTFChars (env, s, 0); dbl = createDouble (env, str, e); (*env)->ReleaseStringUTFChars (env, s, str); if (!ERROR_OCCURED (dbl)) { return dbl; } else if (LOW_I32_FROM_VAR (dbl) == (I_32) - 1) { /* NumberFormatException */ throwNewExceptionByName(env, "java/lang/NumberFormatException", ""); } else { /* OutOfMemoryError */ throwNewOutOfMemoryError(env, ""); } return 0.0; } /* The algorithm for this particular function can be found in: * * Printing Floating-Point Numbers Quickly and Accurately, Robert * G. Burger, and R. Kent Dybvig, Programming Language Design and * Implementation (PLDI) 1996, pp.108-116. * * The previous implementation of this function combined m+ and m- into * one single M which caused some inaccuracy of the last digit. The * particular case below shows this inaccuracy: * * System.out.println(new Double((1.234123412431233E107)).toString()); * System.out.println(new Double((1.2341234124312331E107)).toString()); * System.out.println(new Double((1.2341234124312332E107)).toString()); * * outputs the following: * * 1.234123412431233E107 * 1.234123412431233E107 * 1.234123412431233E107 * * instead of: * * 1.234123412431233E107 * 1.2341234124312331E107 * 1.2341234124312331E107 * */ JNIEXPORT void JNICALL Java_org_apache_harmony_luni_util_NumberConverter_bigIntDigitGeneratorInstImpl (JNIEnv * env, jobject inst, jlong f, jint e, jboolean isDenormalized, jboolean mantissaIsZero, jint p) { int RLength, SLength, TempLength, mplus_Length, mminus_Length; int high, low, i; jint k, firstK, U; jint getCount, setCount; jint *uArray; jclass clazz; jfieldID fid; jintArray uArrayObject; U_64 R[RM_SIZE], S[STemp_SIZE], mplus[RM_SIZE], mminus[RM_SIZE], Temp[STemp_SIZE]; memset (R, 0, RM_SIZE * sizeof (U_64)); memset (S, 0, STemp_SIZE * sizeof (U_64)); memset (mplus, 0, RM_SIZE * sizeof (U_64)); memset (mminus, 0, RM_SIZE * sizeof (U_64)); memset (Temp, 0, STemp_SIZE * sizeof (U_64)); if (e >= 0) { *R = f; *mplus = *mminus = 1; simpleShiftLeftHighPrecision (mminus, RM_SIZE, e); if (f != (2 << (p - 1))) { simpleShiftLeftHighPrecision (R, RM_SIZE, e + 1); *S = 2; /* * m+ = m+ << e results in 1.0e23 to be printed as * 0.9999999999999999E23 * m+ = m+ << e+1 results in 1.0e23 to be printed as * 1.0e23 (caused too much rounding) * 470fffffffffffff = 2.0769187434139308E34 * 4710000000000000 = 2.076918743413931E34 */ simpleShiftLeftHighPrecision (mplus, RM_SIZE, e); } else { simpleShiftLeftHighPrecision (R, RM_SIZE, e + 2); *S = 4; simpleShiftLeftHighPrecision (mplus, RM_SIZE, e + 1); } } else { if (isDenormalized || (f != (2 << (p - 1)))) { *R = f << 1; *S = 1; simpleShiftLeftHighPrecision (S, STemp_SIZE, 1 - e); *mplus = *mminus = 1; } else { *R = f << 2; *S = 1; simpleShiftLeftHighPrecision (S, STemp_SIZE, 2 - e); *mplus = 2; *mminus = 1; } } k = (int) ceil ((e + p - 1) * INV_LOG_OF_TEN_BASE_2 - 1e-10); if (k > 0) { timesTenToTheEHighPrecision (S, STemp_SIZE, k); } else { timesTenToTheEHighPrecision (R, RM_SIZE, -k); timesTenToTheEHighPrecision (mplus, RM_SIZE, -k); timesTenToTheEHighPrecision (mminus, RM_SIZE, -k); } RLength = mplus_Length = mminus_Length = RM_SIZE; SLength = TempLength = STemp_SIZE; memset (Temp + RM_SIZE, 0, (STemp_SIZE - RM_SIZE) * sizeof (U_64)); memcpy (Temp, R, RM_SIZE * sizeof (U_64)); while (RLength > 1 && R[RLength - 1] == 0) --RLength; while (mplus_Length > 1 && mplus[mplus_Length - 1] == 0) --mplus_Length; while (mminus_Length > 1 && mminus[mminus_Length - 1] == 0) --mminus_Length; while (SLength > 1 && S[SLength - 1] == 0) --SLength; TempLength = (RLength > mplus_Length ? RLength : mplus_Length) + 1; addHighPrecision (Temp, TempLength, mplus, mplus_Length); if (compareHighPrecision (Temp, TempLength, S, SLength) >= 0) { firstK = k; } else { firstK = k - 1; simpleAppendDecimalDigitHighPrecision (R, ++RLength, 0); simpleAppendDecimalDigitHighPrecision (mplus, ++mplus_Length, 0); simpleAppendDecimalDigitHighPrecision (mminus, ++mminus_Length, 0); while (RLength > 1 && R[RLength - 1] == 0) --RLength; while (mplus_Length > 1 && mplus[mplus_Length - 1] == 0) --mplus_Length; while (mminus_Length > 1 && mminus[mminus_Length - 1] == 0) --mminus_Length; } clazz = (*env)->GetObjectClass (env, inst); fid = (*env)->GetFieldID (env, clazz, "uArray", "[I"); uArrayObject = (jintArray) (*env)->GetObjectField (env, inst, fid); uArray = (*env)->GetIntArrayElements (env, uArrayObject, 0); getCount = setCount = 0; do { U = 0; for (i = 3; i >= 0; --i) { TempLength = SLength + 1; Temp[SLength] = 0; memcpy (Temp, S, SLength * sizeof (U_64)); simpleShiftLeftHighPrecision (Temp, TempLength, i); if (compareHighPrecision (R, RLength, Temp, TempLength) >= 0) { subtractHighPrecision (R, RLength, Temp, TempLength); U += 1 << i; } } low = compareHighPrecision (R, RLength, mminus, mminus_Length) <= 0; memset (Temp + RLength, 0, (STemp_SIZE - RLength) * sizeof (U_64)); memcpy (Temp, R, RLength * sizeof (U_64)); TempLength = (RLength > mplus_Length ? RLength : mplus_Length) + 1; addHighPrecision (Temp, TempLength, mplus, mplus_Length); high = compareHighPrecision (Temp, TempLength, S, SLength) >= 0; if (low || high) break; simpleAppendDecimalDigitHighPrecision (R, ++RLength, 0); simpleAppendDecimalDigitHighPrecision (mplus, ++mplus_Length, 0); simpleAppendDecimalDigitHighPrecision (mminus, ++mminus_Length, 0); while (RLength > 1 && R[RLength - 1] == 0) --RLength; while (mplus_Length > 1 && mplus[mplus_Length - 1] == 0) --mplus_Length; while (mminus_Length > 1 && mminus[mminus_Length - 1] == 0) --mminus_Length; uArray[setCount++] = U; } while (1); simpleShiftLeftHighPrecision (R, ++RLength, 1); if (low && !high) uArray[setCount++] = U; else if (high && !low) uArray[setCount++] = U + 1; else if (compareHighPrecision (R, RLength, S, SLength) < 0) uArray[setCount++] = U; else uArray[setCount++] = U + 1; (*env)->ReleaseIntArrayElements (env, uArrayObject, uArray, 0); fid = (*env)->GetFieldID (env, clazz, "setCount", "I"); (*env)->SetIntField (env, inst, fid, setCount); fid = (*env)->GetFieldID (env, clazz, "getCount", "I"); (*env)->SetIntField (env, inst, fid, getCount); fid = (*env)->GetFieldID (env, clazz, "firstK", "I"); (*env)->SetIntField (env, inst, fid, firstK); }
Java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author Evgeniya G. Maenkova */ package org.apache.harmony.awt.text; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.security.AccessController; import java.security.PrivilegedAction; import javax.swing.text.Element; import javax.swing.text.View; public abstract class TextFactory { private static final String FACTORY_IMPL_CLS_NAME = "javax.swing.text.TextFactoryImpl"; //$NON-NLS-1$ private static final TextFactory viewFactory = createTextFactory(); public static TextFactory getTextFactory() { return viewFactory; } private static TextFactory createTextFactory() { PrivilegedAction<TextFactory> createAction = new PrivilegedAction<TextFactory>() { public TextFactory run() { try { Class<?> factoryImplClass = Class .forName(FACTORY_IMPL_CLS_NAME); Constructor<?> defConstr = factoryImplClass.getDeclaredConstructor(new Class[0]); defConstr.setAccessible(true); return (TextFactory)defConstr.newInstance(new Object[0]); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return null; } }; return AccessController.doPrivileged(createAction); } public abstract RootViewContext createRootView(final Element element); public abstract View createPlainView(final Element e); public abstract View createWrappedPlainView(final Element e); public abstract View createFieldView(final Element e); public abstract View createPasswordView(Element e); public abstract TextCaret createCaret(); }
Java
/** ****************************************************************************** * @file fatfs.c * @brief Code for fatfs applications ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license * SLA0044, the "License"; You may not use this file except in compliance with * the License. You may obtain a copy of the License at: * www.st.com/SLA0044 * ****************************************************************************** */ #include "fatfs.h" uint8_t retSD; /* Return value for SD */ char SDPath[4]; /* SD logical drive path */ FATFS SDFatFS; /* File system object for SD logical drive */ FIL SDFile; /* File object for SD */ /* USER CODE BEGIN Variables */ /* USER CODE END Variables */ void MX_FATFS_Init(void) { /*## FatFS: Link the SD driver ###########################*/ retSD = FATFS_LinkDriver(&SD_Driver, SDPath); /* USER CODE BEGIN Init */ /* additional user code for init */ /* USER CODE END Init */ } /** * @brief Gets Time from RTC * @param None * @retval Time in DWORD */ DWORD get_fattime(void) { /* USER CODE BEGIN get_fattime */ return 0; /* USER CODE END get_fattime */ } /* USER CODE BEGIN Application */ /* USER CODE END Application */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Java
/* MMIX-specific support for 64-bit ELF. Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson <hp@bitrange.com> This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* No specific ABI or "processor-specific supplement" defined. */ /* TODO: - "Traditional" linker relaxation (shrinking whole sections). - Merge reloc stubs jumping to same location. - GETA stub relaxation (call a stub for out of range new R_MMIX_GETA_STUBBABLE). */ #include "bfd.h" #include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/mmix.h" #include "opcode/mmix.h" #define MINUS_ONE (((bfd_vma) 0) - 1) #define MAX_PUSHJ_STUB_SIZE (5 * 4) /* Put these everywhere in new code. */ #define FATAL_DEBUG \ _bfd_abort (__FILE__, __LINE__, \ "Internal: Non-debugged code (test-case missing)") #define BAD_CASE(x) \ _bfd_abort (__FILE__, __LINE__, \ "bad case for " #x) struct _mmix_elf_section_data { struct bfd_elf_section_data elf; union { struct bpo_reloc_section_info *reloc; struct bpo_greg_section_info *greg; } bpo; struct pushj_stub_info { /* Maximum number of stubs needed for this section. */ bfd_size_type n_pushj_relocs; /* Size of stubs after a mmix_elf_relax_section round. */ bfd_size_type stubs_size_sum; /* Per-reloc stubs_size_sum information. The stubs_size_sum member is the sum of these. Allocated in mmix_elf_check_common_relocs. */ bfd_size_type *stub_size; /* Offset of next stub during relocation. Somewhat redundant with the above: error coverage is easier and we don't have to reset the stubs_size_sum for relocation. */ bfd_size_type stub_offset; } pjs; }; #define mmix_elf_section_data(sec) \ ((struct _mmix_elf_section_data *) elf_section_data (sec)) /* For each section containing a base-plus-offset (BPO) reloc, we attach this struct as mmix_elf_section_data (section)->bpo, which is otherwise NULL. */ struct bpo_reloc_section_info { /* The base is 1; this is the first number in this section. */ size_t first_base_plus_offset_reloc; /* Number of BPO-relocs in this section. */ size_t n_bpo_relocs_this_section; /* Running index, used at relocation time. */ size_t bpo_index; /* We don't have access to the bfd_link_info struct in mmix_final_link_relocate. What we really want to get at is the global single struct greg_relocation, so we stash it here. */ asection *bpo_greg_section; }; /* Helper struct (in global context) for the one below. There's one of these created for every BPO reloc. */ struct bpo_reloc_request { bfd_vma value; /* Valid after relaxation. The base is 0; the first register number must be added. The offset is in range 0..255. */ size_t regindex; size_t offset; /* The order number for this BPO reloc, corresponding to the order in which BPO relocs were found. Used to create an index after reloc requests are sorted. */ size_t bpo_reloc_no; /* Set when the value is computed. Better than coding "guard values" into the other members. Is FALSE only for BPO relocs in a GC:ed section. */ bfd_boolean valid; }; /* We attach this as mmix_elf_section_data (sec)->bpo in the linker-allocated greg contents section (MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME), which is linked into the register contents section (MMIX_REG_CONTENTS_SECTION_NAME). This section is created by the linker; using the same hook as for usual with BPO relocs does not collide. */ struct bpo_greg_section_info { /* After GC, this reflects the number of remaining, non-excluded BPO-relocs. */ size_t n_bpo_relocs; /* This is the number of allocated bpo_reloc_requests; the size of sorted_indexes. Valid after the check.*relocs functions are called for all incoming sections. It includes the number of BPO relocs in sections that were GC:ed. */ size_t n_max_bpo_relocs; /* A counter used to find out when to fold the BPO gregs, since we don't have a single "after-relaxation" hook. */ size_t n_remaining_bpo_relocs_this_relaxation_round; /* The number of linker-allocated GREGs resulting from BPO relocs. This is an approximation after _bfd_mmix_before_linker_allocation and supposedly accurate after mmix_elf_relax_section is called for all incoming non-collected sections. */ size_t n_allocated_bpo_gregs; /* Index into reloc_request[], sorted on increasing "value", secondary by increasing index for strict sorting order. */ size_t *bpo_reloc_indexes; /* An array of all relocations, with the "value" member filled in by the relaxation function. */ struct bpo_reloc_request *reloc_request; }; static bfd_boolean mmix_elf_link_output_symbol_hook PARAMS ((struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *, struct elf_link_hash_entry *)); static bfd_reloc_status_type mmix_elf_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static void mmix_info_to_howto_rela PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static int mmix_elf_sort_relocs PARAMS ((const PTR, const PTR)); static bfd_boolean mmix_elf_new_section_hook PARAMS ((bfd *, asection *)); static bfd_boolean mmix_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static bfd_boolean mmix_elf_check_common_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static bfd_boolean mmix_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static asection * mmix_elf_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static bfd_boolean mmix_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static bfd_reloc_status_type mmix_final_link_relocate PARAMS ((reloc_howto_type *, asection *, bfd_byte *, bfd_vma, bfd_signed_vma, bfd_vma, const char *, asection *)); static bfd_reloc_status_type mmix_elf_perform_relocation PARAMS ((asection *, reloc_howto_type *, PTR, bfd_vma, bfd_vma)); static bfd_boolean mmix_elf_section_from_bfd_section PARAMS ((bfd *, asection *, int *)); static bfd_boolean mmix_elf_add_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); static bfd_boolean mmix_elf_is_local_label_name PARAMS ((bfd *, const char *)); static int bpo_reloc_request_sort_fn PARAMS ((const PTR, const PTR)); static bfd_boolean mmix_elf_relax_section PARAMS ((bfd *abfd, asection *sec, struct bfd_link_info *link_info, bfd_boolean *again)); extern bfd_boolean mmix_elf_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern void mmix_elf_symbol_processing PARAMS ((bfd *, asymbol *)); /* Only intended to be called from a debugger. */ extern void mmix_dump_bpo_gregs PARAMS ((struct bfd_link_info *, bfd_error_handler_type)); static void mmix_set_relaxable_size PARAMS ((bfd *, asection *, void *)); /* Watch out: this currently needs to have elements with the same index as their R_MMIX_ number. */ static reloc_howto_type elf_mmix_howto_table[] = { /* This reloc does nothing. */ HOWTO (R_MMIX_NONE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_NONE", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ /* An 8 bit absolute relocation. */ HOWTO (R_MMIX_8, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_8", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xff, /* dst_mask */ FALSE), /* pcrel_offset */ /* An 16 bit absolute relocation. */ HOWTO (R_MMIX_16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* An 24 bit absolute relocation. */ HOWTO (R_MMIX_24, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 24, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_24", /* name */ FALSE, /* partial_inplace */ ~0xffffff, /* src_mask */ 0xffffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* A 32 bit absolute relocation. */ HOWTO (R_MMIX_32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_32", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* 64 bit relocation. */ HOWTO (R_MMIX_64, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_64", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ MINUS_ONE, /* dst_mask */ FALSE), /* pcrel_offset */ /* An 8 bit PC-relative relocation. */ HOWTO (R_MMIX_PC_8, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_PC_8", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xff, /* dst_mask */ TRUE), /* pcrel_offset */ /* An 16 bit PC-relative relocation. */ HOWTO (R_MMIX_PC_16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_PC_16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* An 24 bit PC-relative relocation. */ HOWTO (R_MMIX_PC_24, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 24, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_PC_24", /* name */ FALSE, /* partial_inplace */ ~0xffffff, /* src_mask */ 0xffffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* A 32 bit absolute PC-relative relocation. */ HOWTO (R_MMIX_PC_32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_PC_32", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* 64 bit PC-relative relocation. */ HOWTO (R_MMIX_PC_64, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_PC_64", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ MINUS_ONE, /* dst_mask */ TRUE), /* pcrel_offset */ /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_MMIX_GNU_VTINHERIT, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ NULL, /* special_function */ "R_MMIX_GNU_VTINHERIT", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ TRUE), /* pcrel_offset */ /* GNU extension to record C++ vtable member usage. */ HOWTO (R_MMIX_GNU_VTENTRY, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ _bfd_elf_rel_vtable_reloc_fn, /* special_function */ "R_MMIX_GNU_VTENTRY", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ /* The GETA relocation is supposed to get any address that could possibly be reached by the GETA instruction. It can silently expand to get a 64-bit operand, but will complain if any of the two least significant bits are set. The howto members reflect a simple GETA. */ HOWTO (R_MMIX_GETA, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_GETA", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_GETA_1, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_GETA_1", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_GETA_2, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_GETA_2", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_GETA_3, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_GETA_3", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* The conditional branches are supposed to reach any (code) address. It can silently expand to a 64-bit operand, but will emit an error if any of the two least significant bits are set. The howto members reflect a simple branch. */ HOWTO (R_MMIX_CBRANCH, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_CBRANCH", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_CBRANCH_J, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_CBRANCH_J", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_CBRANCH_1, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_CBRANCH_1", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_CBRANCH_2, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_CBRANCH_2", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_CBRANCH_3, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_CBRANCH_3", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* The PUSHJ instruction can reach any (code) address, as long as it's the beginning of a function (no usable restriction). It can silently expand to a 64-bit operand, but will emit an error if any of the two least significant bits are set. It can also expand into a call to a stub; see R_MMIX_PUSHJ_STUBBABLE. The howto members reflect a simple PUSHJ. */ HOWTO (R_MMIX_PUSHJ, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_PUSHJ", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_PUSHJ_1, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_PUSHJ_1", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_PUSHJ_2, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_PUSHJ_2", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_PUSHJ_3, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_PUSHJ_3", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* A JMP is supposed to reach any (code) address. By itself, it can reach +-64M; the expansion can reach all 64 bits. Note that the 64M limit is soon reached if you link the program in wildly different memory segments. The howto members reflect a trivial JMP. */ HOWTO (R_MMIX_JMP, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 27, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_JMP", /* name */ FALSE, /* partial_inplace */ ~0x1ffffff, /* src_mask */ 0x1ffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_JMP_1, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 27, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_JMP_1", /* name */ FALSE, /* partial_inplace */ ~0x1ffffff, /* src_mask */ 0x1ffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_JMP_2, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 27, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_JMP_2", /* name */ FALSE, /* partial_inplace */ ~0x1ffffff, /* src_mask */ 0x1ffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_MMIX_JMP_3, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 27, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_JMP_3", /* name */ FALSE, /* partial_inplace */ ~0x1ffffff, /* src_mask */ 0x1ffffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* When we don't emit link-time-relaxable code from the assembler, or when relaxation has done all it can do, these relocs are used. For GETA/PUSHJ/branches. */ HOWTO (R_MMIX_ADDR19, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_ADDR19", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* For JMP. */ HOWTO (R_MMIX_ADDR27, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 27, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_ADDR27", /* name */ FALSE, /* partial_inplace */ ~0x1ffffff, /* src_mask */ 0x1ffffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* A general register or the value 0..255. If a value, then the instruction (offset -3) needs adjusting. */ HOWTO (R_MMIX_REG_OR_BYTE, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_REG_OR_BYTE", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xff, /* dst_mask */ FALSE), /* pcrel_offset */ /* A general register. */ HOWTO (R_MMIX_REG, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_REG", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xff, /* dst_mask */ FALSE), /* pcrel_offset */ /* A register plus an index, corresponding to the relocation expression. The sizes must correspond to the valid range of the expression, while the bitmasks correspond to what we store in the image. */ HOWTO (R_MMIX_BASE_PLUS_OFFSET, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_BASE_PLUS_OFFSET", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* A "magic" relocation for a LOCAL expression, asserting that the expression is less than the number of global registers. No actual modification of the contents is done. Implementing this as a relocation was less intrusive than e.g. putting such expressions in a section to discard *after* relocation. */ HOWTO (R_MMIX_LOCAL, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_LOCAL", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_MMIX_PUSHJ_STUBBABLE, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ mmix_elf_reloc, /* special_function */ "R_MMIX_PUSHJ_STUBBABLE", /* name */ FALSE, /* partial_inplace */ ~0x0100ffff, /* src_mask */ 0x0100ffff, /* dst_mask */ TRUE) /* pcrel_offset */ }; /* Map BFD reloc types to MMIX ELF reloc types. */ struct mmix_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; enum elf_mmix_reloc_type elf_reloc_val; }; static const struct mmix_reloc_map mmix_reloc_map[] = { {BFD_RELOC_NONE, R_MMIX_NONE}, {BFD_RELOC_8, R_MMIX_8}, {BFD_RELOC_16, R_MMIX_16}, {BFD_RELOC_24, R_MMIX_24}, {BFD_RELOC_32, R_MMIX_32}, {BFD_RELOC_64, R_MMIX_64}, {BFD_RELOC_8_PCREL, R_MMIX_PC_8}, {BFD_RELOC_16_PCREL, R_MMIX_PC_16}, {BFD_RELOC_24_PCREL, R_MMIX_PC_24}, {BFD_RELOC_32_PCREL, R_MMIX_PC_32}, {BFD_RELOC_64_PCREL, R_MMIX_PC_64}, {BFD_RELOC_VTABLE_INHERIT, R_MMIX_GNU_VTINHERIT}, {BFD_RELOC_VTABLE_ENTRY, R_MMIX_GNU_VTENTRY}, {BFD_RELOC_MMIX_GETA, R_MMIX_GETA}, {BFD_RELOC_MMIX_CBRANCH, R_MMIX_CBRANCH}, {BFD_RELOC_MMIX_PUSHJ, R_MMIX_PUSHJ}, {BFD_RELOC_MMIX_JMP, R_MMIX_JMP}, {BFD_RELOC_MMIX_ADDR19, R_MMIX_ADDR19}, {BFD_RELOC_MMIX_ADDR27, R_MMIX_ADDR27}, {BFD_RELOC_MMIX_REG_OR_BYTE, R_MMIX_REG_OR_BYTE}, {BFD_RELOC_MMIX_REG, R_MMIX_REG}, {BFD_RELOC_MMIX_BASE_PLUS_OFFSET, R_MMIX_BASE_PLUS_OFFSET}, {BFD_RELOC_MMIX_LOCAL, R_MMIX_LOCAL}, {BFD_RELOC_MMIX_PUSHJ_STUBBABLE, R_MMIX_PUSHJ_STUBBABLE} }; static reloc_howto_type * bfd_elf64_bfd_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { unsigned int i; for (i = 0; i < sizeof (mmix_reloc_map) / sizeof (mmix_reloc_map[0]); i++) { if (mmix_reloc_map[i].bfd_reloc_val == code) return &elf_mmix_howto_table[mmix_reloc_map[i].elf_reloc_val]; } return NULL; } static bfd_boolean mmix_elf_new_section_hook (abfd, sec) bfd *abfd; asection *sec; { struct _mmix_elf_section_data *sdata; bfd_size_type amt = sizeof (*sdata); sdata = (struct _mmix_elf_section_data *) bfd_zalloc (abfd, amt); if (sdata == NULL) return FALSE; sec->used_by_bfd = (PTR) sdata; return _bfd_elf_new_section_hook (abfd, sec); } /* This function performs the actual bitfiddling and sanity check for a final relocation. Each relocation gets its *worst*-case expansion in size when it arrives here; any reduction in size should have been caught in linker relaxation earlier. When we get here, the relocation looks like the smallest instruction with SWYM:s (nop:s) appended to the max size. We fill in those nop:s. R_MMIX_GETA: (FIXME: Relaxation should break this up in 1, 2, 3 tetra) GETA $N,foo -> SETL $N,foo & 0xffff INCML $N,(foo >> 16) & 0xffff INCMH $N,(foo >> 32) & 0xffff INCH $N,(foo >> 48) & 0xffff R_MMIX_CBRANCH: (FIXME: Relaxation should break this up, but condbranches needing relaxation might be rare enough to not be worthwhile.) [P]Bcc $N,foo -> [~P]B~cc $N,.+20 SETL $255,foo & ... INCML ... INCMH ... INCH ... GO $255,$255,0 R_MMIX_PUSHJ: (FIXME: Relaxation...) PUSHJ $N,foo -> SETL $255,foo & ... INCML ... INCMH ... INCH ... PUSHGO $N,$255,0 R_MMIX_JMP: (FIXME: Relaxation...) JMP foo -> SETL $255,foo & ... INCML ... INCMH ... INCH ... GO $255,$255,0 R_MMIX_ADDR19 and R_MMIX_ADDR27 are just filled in. */ static bfd_reloc_status_type mmix_elf_perform_relocation (isec, howto, datap, addr, value) asection *isec; reloc_howto_type *howto; PTR datap; bfd_vma addr; bfd_vma value; { bfd *abfd = isec->owner; bfd_reloc_status_type flag = bfd_reloc_ok; bfd_reloc_status_type r; int offs = 0; int reg = 255; /* The worst case bits are all similar SETL/INCML/INCMH/INCH sequences. We handle the differences here and the common sequence later. */ switch (howto->type) { case R_MMIX_GETA: offs = 0; reg = bfd_get_8 (abfd, (bfd_byte *) datap + 1); /* We change to an absolute value. */ value += addr; break; case R_MMIX_CBRANCH: { int in1 = bfd_get_16 (abfd, (bfd_byte *) datap) << 16; /* Invert the condition and prediction bit, and set the offset to five instructions ahead. We *can* do better if we want to. If the branch is found to be within limits, we could leave the branch as is; there'll just be a bunch of NOP:s after it. But we shouldn't see this sequence often enough that it's worth doing it. */ bfd_put_32 (abfd, (((in1 ^ ((PRED_INV_BIT | COND_INV_BIT) << 24)) & ~0xffff) | (24/4)), (bfd_byte *) datap); /* Put a "GO $255,$255,0" after the common sequence. */ bfd_put_32 (abfd, ((GO_INSN_BYTE | IMM_OFFSET_BIT) << 24) | 0xffff00, (bfd_byte *) datap + 20); /* Common sequence starts at offset 4. */ offs = 4; /* We change to an absolute value. */ value += addr; } break; case R_MMIX_PUSHJ_STUBBABLE: /* If the address fits, we're fine. */ if ((value & 3) == 0 /* Note rightshift 0; see R_MMIX_JMP case below. */ && (r = bfd_check_overflow (complain_overflow_signed, howto->bitsize, 0, bfd_arch_bits_per_address (abfd), value)) == bfd_reloc_ok) goto pcrel_mmix_reloc_fits; else { bfd_size_type size = isec->rawsize ? isec->rawsize : isec->size; /* We have the bytes at the PUSHJ insn and need to get the position for the stub. There's supposed to be room allocated for the stub. */ bfd_byte *stubcontents = ((bfd_byte *) datap - (addr - (isec->output_section->vma + isec->output_offset)) + size + mmix_elf_section_data (isec)->pjs.stub_offset); bfd_vma stubaddr; /* The address doesn't fit, so redirect the PUSHJ to the location of the stub. */ r = mmix_elf_perform_relocation (isec, &elf_mmix_howto_table [R_MMIX_ADDR19], datap, addr, isec->output_section->vma + isec->output_offset + size + (mmix_elf_section_data (isec) ->pjs.stub_offset) - addr); if (r != bfd_reloc_ok) return r; stubaddr = (isec->output_section->vma + isec->output_offset + size + mmix_elf_section_data (isec)->pjs.stub_offset); /* We generate a simple JMP if that suffices, else the whole 5 insn stub. */ if (bfd_check_overflow (complain_overflow_signed, elf_mmix_howto_table[R_MMIX_ADDR27].bitsize, 0, bfd_arch_bits_per_address (abfd), addr + value - stubaddr) == bfd_reloc_ok) { bfd_put_32 (abfd, JMP_INSN_BYTE << 24, stubcontents); r = mmix_elf_perform_relocation (isec, &elf_mmix_howto_table [R_MMIX_ADDR27], stubcontents, stubaddr, value + addr - stubaddr); mmix_elf_section_data (isec)->pjs.stub_offset += 4; if (size + mmix_elf_section_data (isec)->pjs.stub_offset > isec->size) abort (); return r; } else { /* Put a "GO $255,0" after the common sequence. */ bfd_put_32 (abfd, ((GO_INSN_BYTE | IMM_OFFSET_BIT) << 24) | 0xff00, (bfd_byte *) stubcontents + 16); /* Prepare for the general code to set the first part of the linker stub, and */ value += addr; datap = stubcontents; mmix_elf_section_data (isec)->pjs.stub_offset += MAX_PUSHJ_STUB_SIZE; } } break; case R_MMIX_PUSHJ: { int inreg = bfd_get_8 (abfd, (bfd_byte *) datap + 1); /* Put a "PUSHGO $N,$255,0" after the common sequence. */ bfd_put_32 (abfd, ((PUSHGO_INSN_BYTE | IMM_OFFSET_BIT) << 24) | (inreg << 16) | 0xff00, (bfd_byte *) datap + 16); /* We change to an absolute value. */ value += addr; } break; case R_MMIX_JMP: /* This one is a little special. If we get here on a non-relaxing link, and the destination is actually in range, we don't need to execute the nops. If so, we fall through to the bit-fiddling relocs. FIXME: bfd_check_overflow seems broken; the relocation is rightshifted before testing, so supply a zero rightshift. */ if (! ((value & 3) == 0 && (r = bfd_check_overflow (complain_overflow_signed, howto->bitsize, 0, bfd_arch_bits_per_address (abfd), value)) == bfd_reloc_ok)) { /* If the relocation doesn't fit in a JMP, we let the NOP:s be modified below, and put a "GO $255,$255,0" after the address-loading sequence. */ bfd_put_32 (abfd, ((GO_INSN_BYTE | IMM_OFFSET_BIT) << 24) | 0xffff00, (bfd_byte *) datap + 16); /* We change to an absolute value. */ value += addr; break; } /* FALLTHROUGH. */ case R_MMIX_ADDR19: case R_MMIX_ADDR27: pcrel_mmix_reloc_fits: /* These must be in range, or else we emit an error. */ if ((value & 3) == 0 /* Note rightshift 0; see above. */ && (r = bfd_check_overflow (complain_overflow_signed, howto->bitsize, 0, bfd_arch_bits_per_address (abfd), value)) == bfd_reloc_ok) { bfd_vma in1 = bfd_get_32 (abfd, (bfd_byte *) datap); bfd_vma highbit; if ((bfd_signed_vma) value < 0) { highbit = 1 << 24; value += (1 << (howto->bitsize - 1)); } else highbit = 0; value >>= 2; bfd_put_32 (abfd, (in1 & howto->src_mask) | highbit | (value & howto->dst_mask), (bfd_byte *) datap); return bfd_reloc_ok; } else return bfd_reloc_overflow; case R_MMIX_BASE_PLUS_OFFSET: { struct bpo_reloc_section_info *bpodata = mmix_elf_section_data (isec)->bpo.reloc; asection *bpo_greg_section = bpodata->bpo_greg_section; struct bpo_greg_section_info *gregdata = mmix_elf_section_data (bpo_greg_section)->bpo.greg; size_t bpo_index = gregdata->bpo_reloc_indexes[bpodata->bpo_index++]; /* A consistency check: The value we now have in "relocation" must be the same as the value we stored for that relocation. It doesn't cost much, so can be left in at all times. */ if (value != gregdata->reloc_request[bpo_index].value) { (*_bfd_error_handler) (_("%s: Internal inconsistency error for value for\n\ linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n"), bfd_get_filename (isec->owner), (unsigned long) (value >> 32), (unsigned long) value, (unsigned long) (gregdata->reloc_request[bpo_index].value >> 32), (unsigned long) gregdata->reloc_request[bpo_index].value); bfd_set_error (bfd_error_bad_value); return bfd_reloc_overflow; } /* Then store the register number and offset for that register into datap and datap + 1 respectively. */ bfd_put_8 (abfd, gregdata->reloc_request[bpo_index].regindex + bpo_greg_section->output_section->vma / 8, datap); bfd_put_8 (abfd, gregdata->reloc_request[bpo_index].offset, ((unsigned char *) datap) + 1); return bfd_reloc_ok; } case R_MMIX_REG_OR_BYTE: case R_MMIX_REG: if (value > 255) return bfd_reloc_overflow; bfd_put_8 (abfd, value, datap); return bfd_reloc_ok; default: BAD_CASE (howto->type); } /* This code adds the common SETL/INCML/INCMH/INCH worst-case sequence. */ /* Lowest two bits must be 0. We return bfd_reloc_overflow for everything that looks strange. */ if (value & 3) flag = bfd_reloc_overflow; bfd_put_32 (abfd, (SETL_INSN_BYTE << 24) | (value & 0xffff) | (reg << 16), (bfd_byte *) datap + offs); bfd_put_32 (abfd, (INCML_INSN_BYTE << 24) | ((value >> 16) & 0xffff) | (reg << 16), (bfd_byte *) datap + offs + 4); bfd_put_32 (abfd, (INCMH_INSN_BYTE << 24) | ((value >> 32) & 0xffff) | (reg << 16), (bfd_byte *) datap + offs + 8); bfd_put_32 (abfd, (INCH_INSN_BYTE << 24) | ((value >> 48) & 0xffff) | (reg << 16), (bfd_byte *) datap + offs + 12); return flag; } /* Set the howto pointer for an MMIX ELF reloc (type RELA). */ static void mmix_info_to_howto_rela (abfd, cache_ptr, dst) bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; Elf_Internal_Rela *dst; { unsigned int r_type; r_type = ELF64_R_TYPE (dst->r_info); BFD_ASSERT (r_type < (unsigned int) R_MMIX_max); cache_ptr->howto = &elf_mmix_howto_table[r_type]; } /* Any MMIX-specific relocation gets here at assembly time or when linking to other formats (such as mmo); this is the relocation function from the reloc_table. We don't get here for final pure ELF linking. */ static bfd_reloc_status_type mmix_elf_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) bfd *abfd; arelent *reloc_entry; asymbol *symbol; PTR data; asection *input_section; bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_reloc_status_type r; asection *reloc_target_output_section; bfd_reloc_status_type flag = bfd_reloc_ok; bfd_vma output_base = 0; bfd_vma addr; r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); /* If that was all that was needed (i.e. this isn't a final link, only some segment adjustments), we're done. */ if (r != bfd_reloc_continue) return r; if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0 && output_bfd == (bfd *) NULL) return bfd_reloc_undefined; /* Is the address of the relocation really within the section? */ if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) return bfd_reloc_outofrange; /* Work out which section the relocation is targeted at and the initial relocation command value. */ /* Get symbol value. (Common symbols are special.) */ if (bfd_is_com_section (symbol->section)) relocation = 0; else relocation = symbol->value; reloc_target_output_section = bfd_get_output_section (symbol); /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ if (output_bfd) output_base = 0; else output_base = reloc_target_output_section->vma; relocation += output_base + symbol->section->output_offset; /* Get position of relocation. */ addr = (reloc_entry->address + input_section->output_section->vma + input_section->output_offset); if (output_bfd != (bfd *) NULL) { /* Add in supplied addend. */ relocation += reloc_entry->addend; /* This is a partial relocation, and we want to apply the relocation to the reloc entry rather than the raw data. Modify the reloc inplace to reflect what we now know. */ reloc_entry->addend = relocation; reloc_entry->address += input_section->output_offset; return flag; } return mmix_final_link_relocate (reloc_entry->howto, input_section, data, reloc_entry->address, reloc_entry->addend, relocation, bfd_asymbol_name (symbol), reloc_target_output_section); } /* Relocate an MMIX ELF section. Modified from elf32-fr30.c; look to it for guidance if you're thinking of copying this. */ static bfd_boolean mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; bfd *input_bfd; asection *input_section; bfd_byte *contents; Elf_Internal_Rela *relocs; Elf_Internal_Sym *local_syms; asection **local_sections; { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; bfd_size_type size; size_t pjsno = 0; size = input_section->rawsize ? input_section->rawsize : input_section->size; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; /* Zero the stub area before we start. */ if (input_section->rawsize != 0 && input_section->size > input_section->rawsize) memset (contents + input_section->rawsize, 0, input_section->size - input_section->rawsize); for (rel = relocs; rel < relend; rel ++) { reloc_howto_type *howto; unsigned long r_symndx; Elf_Internal_Sym *sym; asection *sec; struct elf_link_hash_entry *h; bfd_vma relocation; bfd_reloc_status_type r; const char *name = NULL; int r_type; bfd_boolean undefined_signalled = FALSE; r_type = ELF64_R_TYPE (rel->r_info); if (r_type == R_MMIX_GNU_VTINHERIT || r_type == R_MMIX_GNU_VTENTRY) continue; r_symndx = ELF64_R_SYM (rel->r_info); if (info->relocatable) { /* This is a relocatable link. For most relocs we don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) { sec = local_sections [r_symndx]; rel->r_addend += sec->output_offset + sym->st_value; } } /* For PUSHJ stub relocs however, we may need to change the reloc and the section contents, if the reloc doesn't reach beyond the end of the output section and previous stubs. Then we change the section contents to be a PUSHJ to the end of the input section plus stubs (we can do that without using a reloc), and then we change the reloc to be a R_MMIX_PUSHJ at the stub location. */ if (r_type == R_MMIX_PUSHJ_STUBBABLE) { /* We've already checked whether we need a stub; use that knowledge. */ if (mmix_elf_section_data (input_section)->pjs.stub_size[pjsno] != 0) { Elf_Internal_Rela relcpy; if (mmix_elf_section_data (input_section) ->pjs.stub_size[pjsno] != MAX_PUSHJ_STUB_SIZE) abort (); /* There's already a PUSHJ insn there, so just fill in the offset bits to the stub. */ if (mmix_final_link_relocate (elf_mmix_howto_table + R_MMIX_ADDR19, input_section, contents, rel->r_offset, 0, input_section ->output_section->vma + input_section->output_offset + size + mmix_elf_section_data (input_section) ->pjs.stub_offset, NULL, NULL) != bfd_reloc_ok) return FALSE; /* Put a JMP insn at the stub; it goes with the R_MMIX_JMP reloc. */ bfd_put_32 (output_bfd, JMP_INSN_BYTE << 24, contents + size + mmix_elf_section_data (input_section) ->pjs.stub_offset); /* Change the reloc to be at the stub, and to a full R_MMIX_JMP reloc. */ rel->r_info = ELF64_R_INFO (r_symndx, R_MMIX_JMP); rel->r_offset = (size + mmix_elf_section_data (input_section) ->pjs.stub_offset); mmix_elf_section_data (input_section)->pjs.stub_offset += MAX_PUSHJ_STUB_SIZE; /* Shift this reloc to the end of the relocs to maintain the r_offset sorted reloc order. */ relcpy = *rel; memmove (rel, rel + 1, (char *) relend - (char *) rel); relend[-1] = relcpy; /* Back up one reloc, or else we'd skip the next reloc in turn. */ rel--; } pjsno++; } continue; } /* This is a final link. */ howto = elf_mmix_howto_table + ELF64_R_TYPE (rel->r_info); h = NULL; sym = NULL; sec = NULL; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections [r_symndx]; relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); if (name == NULL) name = bfd_section_name (input_bfd, sec); } else { bfd_boolean unresolved_reloc; RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, h, sec, relocation, unresolved_reloc, undefined_signalled); name = h->root.root.string; } r = mmix_final_link_relocate (howto, input_section, contents, rel->r_offset, rel->r_addend, relocation, name, sec); if (r != bfd_reloc_ok) { bfd_boolean check_ok = TRUE; const char * msg = (const char *) NULL; switch (r) { case bfd_reloc_overflow: check_ok = info->callbacks->reloc_overflow (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset); break; case bfd_reloc_undefined: /* We may have sent this message above. */ if (! undefined_signalled) check_ok = info->callbacks->undefined_symbol (info, name, input_bfd, input_section, rel->r_offset, TRUE); undefined_signalled = TRUE; break; case bfd_reloc_outofrange: msg = _("internal error: out of range error"); break; case bfd_reloc_notsupported: msg = _("internal error: unsupported relocation error"); break; case bfd_reloc_dangerous: msg = _("internal error: dangerous relocation"); break; default: msg = _("internal error: unknown error"); break; } if (msg) check_ok = info->callbacks->warning (info, msg, name, input_bfd, input_section, rel->r_offset); if (! check_ok) return FALSE; } } return TRUE; } /* Perform a single relocation. By default we use the standard BFD routines. A few relocs we have to do ourselves. */ static bfd_reloc_status_type mmix_final_link_relocate (howto, input_section, contents, r_offset, r_addend, relocation, symname, symsec) reloc_howto_type *howto; asection *input_section; bfd_byte *contents; bfd_vma r_offset; bfd_signed_vma r_addend; bfd_vma relocation; const char *symname; asection *symsec; { bfd_reloc_status_type r = bfd_reloc_ok; bfd_vma addr = (input_section->output_section->vma + input_section->output_offset + r_offset); bfd_signed_vma srel = (bfd_signed_vma) relocation + r_addend; switch (howto->type) { /* All these are PC-relative. */ case R_MMIX_PUSHJ_STUBBABLE: case R_MMIX_PUSHJ: case R_MMIX_CBRANCH: case R_MMIX_ADDR19: case R_MMIX_GETA: case R_MMIX_ADDR27: case R_MMIX_JMP: contents += r_offset; srel -= (input_section->output_section->vma + input_section->output_offset + r_offset); r = mmix_elf_perform_relocation (input_section, howto, contents, addr, srel); break; case R_MMIX_BASE_PLUS_OFFSET: if (symsec == NULL) return bfd_reloc_undefined; /* Check that we're not relocating against a register symbol. */ if (strcmp (bfd_get_section_name (symsec->owner, symsec), MMIX_REG_CONTENTS_SECTION_NAME) == 0 || strcmp (bfd_get_section_name (symsec->owner, symsec), MMIX_REG_SECTION_NAME) == 0) { /* Note: This is separated out into two messages in order to ease the translation into other languages. */ if (symname == NULL || *symname == 0) (*_bfd_error_handler) (_("%s: base-plus-offset relocation against register symbol: (unknown) in %s"), bfd_get_filename (input_section->owner), bfd_get_section_name (symsec->owner, symsec)); else (*_bfd_error_handler) (_("%s: base-plus-offset relocation against register symbol: %s in %s"), bfd_get_filename (input_section->owner), symname, bfd_get_section_name (symsec->owner, symsec)); return bfd_reloc_overflow; } goto do_mmix_reloc; case R_MMIX_REG_OR_BYTE: case R_MMIX_REG: /* For now, we handle these alike. They must refer to an register symbol, which is either relative to the register section and in the range 0..255, or is in the register contents section with vma regno * 8. */ /* FIXME: A better way to check for reg contents section? FIXME: Postpone section->scaling to mmix_elf_perform_relocation? */ if (symsec == NULL) return bfd_reloc_undefined; if (strcmp (bfd_get_section_name (symsec->owner, symsec), MMIX_REG_CONTENTS_SECTION_NAME) == 0) { if ((srel & 7) != 0 || srel < 32*8 || srel > 255*8) { /* The bfd_reloc_outofrange return value, though intuitively a better value, will not get us an error. */ return bfd_reloc_overflow; } srel /= 8; } else if (strcmp (bfd_get_section_name (symsec->owner, symsec), MMIX_REG_SECTION_NAME) == 0) { if (srel < 0 || srel > 255) /* The bfd_reloc_outofrange return value, though intuitively a better value, will not get us an error. */ return bfd_reloc_overflow; } else { /* Note: This is separated out into two messages in order to ease the translation into other languages. */ if (symname == NULL || *symname == 0) (*_bfd_error_handler) (_("%s: register relocation against non-register symbol: (unknown) in %s"), bfd_get_filename (input_section->owner), bfd_get_section_name (symsec->owner, symsec)); else (*_bfd_error_handler) (_("%s: register relocation against non-register symbol: %s in %s"), bfd_get_filename (input_section->owner), symname, bfd_get_section_name (symsec->owner, symsec)); /* The bfd_reloc_outofrange return value, though intuitively a better value, will not get us an error. */ return bfd_reloc_overflow; } do_mmix_reloc: contents += r_offset; r = mmix_elf_perform_relocation (input_section, howto, contents, addr, srel); break; case R_MMIX_LOCAL: /* This isn't a real relocation, it's just an assertion that the final relocation value corresponds to a local register. We ignore the actual relocation; nothing is changed. */ { asection *regsec = bfd_get_section_by_name (input_section->output_section->owner, MMIX_REG_CONTENTS_SECTION_NAME); bfd_vma first_global; /* Check that this is an absolute value, or a reference to the register contents section or the register (symbol) section. Absolute numbers can get here as undefined section. Undefined symbols are signalled elsewhere, so there's no conflict in us accidentally handling it. */ if (!bfd_is_abs_section (symsec) && !bfd_is_und_section (symsec) && strcmp (bfd_get_section_name (symsec->owner, symsec), MMIX_REG_CONTENTS_SECTION_NAME) != 0 && strcmp (bfd_get_section_name (symsec->owner, symsec), MMIX_REG_SECTION_NAME) != 0) { (*_bfd_error_handler) (_("%s: directive LOCAL valid only with a register or absolute value"), bfd_get_filename (input_section->owner)); return bfd_reloc_overflow; } /* If we don't have a register contents section, then $255 is the first global register. */ if (regsec == NULL) first_global = 255; else { first_global = bfd_get_section_vma (abfd, regsec) / 8; if (strcmp (bfd_get_section_name (symsec->owner, symsec), MMIX_REG_CONTENTS_SECTION_NAME) == 0) { if ((srel & 7) != 0 || srel < 32*8 || srel > 255*8) /* The bfd_reloc_outofrange return value, though intuitively a better value, will not get us an error. */ return bfd_reloc_overflow; srel /= 8; } } if ((bfd_vma) srel >= first_global) { /* FIXME: Better error message. */ (*_bfd_error_handler) (_("%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld."), bfd_get_filename (input_section->owner), (long) srel, (long) first_global); return bfd_reloc_overflow; } } r = bfd_reloc_ok; break; default: r = _bfd_final_link_relocate (howto, input_section->owner, input_section, contents, r_offset, relocation, r_addend); } return r; } /* Return the section that should be marked against GC for a given relocation. */ static asection * mmix_elf_gc_mark_hook (sec, info, rel, h, sym) asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; { if (h != NULL) { switch (ELF64_R_TYPE (rel->r_info)) { case R_MMIX_GNU_VTINHERIT: case R_MMIX_GNU_VTENTRY: break; default: switch (h->root.type) { case bfd_link_hash_defined: case bfd_link_hash_defweak: return h->root.u.def.section; case bfd_link_hash_common: return h->root.u.c.p->section; default: break; } } } else return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } /* Update relocation info for a GC-excluded section. We could supposedly perform the allocation after GC, but there's no suitable hook between GC (or section merge) and the point when all input sections must be present. Better to waste some memory and (perhaps) a little time. */ static bfd_boolean mmix_elf_gc_sweep_hook (abfd, info, sec, relocs) bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED; asection *sec ATTRIBUTE_UNUSED; const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; { struct bpo_reloc_section_info *bpodata = mmix_elf_section_data (sec)->bpo.reloc; asection *allocated_gregs_section; /* If no bpodata here, we have nothing to do. */ if (bpodata == NULL) return TRUE; allocated_gregs_section = bpodata->bpo_greg_section; mmix_elf_section_data (allocated_gregs_section)->bpo.greg->n_bpo_relocs -= bpodata->n_bpo_relocs_this_section; return TRUE; } /* Sort register relocs to come before expanding relocs. */ static int mmix_elf_sort_relocs (p1, p2) const PTR p1; const PTR p2; { const Elf_Internal_Rela *r1 = (const Elf_Internal_Rela *) p1; const Elf_Internal_Rela *r2 = (const Elf_Internal_Rela *) p2; int r1_is_reg, r2_is_reg; /* Sort primarily on r_offset & ~3, so relocs are done to consecutive insns. */ if ((r1->r_offset & ~(bfd_vma) 3) > (r2->r_offset & ~(bfd_vma) 3)) return 1; else if ((r1->r_offset & ~(bfd_vma) 3) < (r2->r_offset & ~(bfd_vma) 3)) return -1; r1_is_reg = (ELF64_R_TYPE (r1->r_info) == R_MMIX_REG_OR_BYTE || ELF64_R_TYPE (r1->r_info) == R_MMIX_REG); r2_is_reg = (ELF64_R_TYPE (r2->r_info) == R_MMIX_REG_OR_BYTE || ELF64_R_TYPE (r2->r_info) == R_MMIX_REG); if (r1_is_reg != r2_is_reg) return r2_is_reg - r1_is_reg; /* Neither or both are register relocs. Then sort on full offset. */ if (r1->r_offset > r2->r_offset) return 1; else if (r1->r_offset < r2->r_offset) return -1; return 0; } /* Subset of mmix_elf_check_relocs, common to ELF and mmo linking. */ static bfd_boolean mmix_elf_check_common_relocs (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; asection *sec; const Elf_Internal_Rela *relocs; { bfd *bpo_greg_owner = NULL; asection *allocated_gregs_section = NULL; struct bpo_greg_section_info *gregdata = NULL; struct bpo_reloc_section_info *bpodata = NULL; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; /* We currently have to abuse this COFF-specific member, since there's no target-machine-dedicated member. There's no alternative outside the bfd_link_info struct; we can't specialize a hash-table since they're different between ELF and mmo. */ bpo_greg_owner = (bfd *) info->base_file; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { switch (ELF64_R_TYPE (rel->r_info)) { /* This relocation causes a GREG allocation. We need to count them, and we need to create a section for them, so we need an object to fake as the owner of that section. We can't use the ELF dynobj for this, since the ELF bits assume lots of DSO-related stuff if that member is non-NULL. */ case R_MMIX_BASE_PLUS_OFFSET: /* We don't do anything with this reloc for a relocatable link. */ if (info->relocatable) break; if (bpo_greg_owner == NULL) { bpo_greg_owner = abfd; info->base_file = (PTR) bpo_greg_owner; } if (allocated_gregs_section == NULL) allocated_gregs_section = bfd_get_section_by_name (bpo_greg_owner, MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME); if (allocated_gregs_section == NULL) { allocated_gregs_section = bfd_make_section_with_flags (bpo_greg_owner, MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME, (SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED)); /* Setting both SEC_ALLOC and SEC_LOAD means the section is treated like any other section, and we'd get errors for address overlap with the text section. Let's set none of those flags, as that is what currently happens for usual GREG allocations, and that works. */ if (allocated_gregs_section == NULL || !bfd_set_section_alignment (bpo_greg_owner, allocated_gregs_section, 3)) return FALSE; gregdata = (struct bpo_greg_section_info *) bfd_zalloc (bpo_greg_owner, sizeof (struct bpo_greg_section_info)); if (gregdata == NULL) return FALSE; mmix_elf_section_data (allocated_gregs_section)->bpo.greg = gregdata; } else if (gregdata == NULL) gregdata = mmix_elf_section_data (allocated_gregs_section)->bpo.greg; /* Get ourselves some auxiliary info for the BPO-relocs. */ if (bpodata == NULL) { /* No use doing a separate iteration pass to find the upper limit - just use the number of relocs. */ bpodata = (struct bpo_reloc_section_info *) bfd_alloc (bpo_greg_owner, sizeof (struct bpo_reloc_section_info) * (sec->reloc_count + 1)); if (bpodata == NULL) return FALSE; mmix_elf_section_data (sec)->bpo.reloc = bpodata; bpodata->first_base_plus_offset_reloc = bpodata->bpo_index = gregdata->n_max_bpo_relocs; bpodata->bpo_greg_section = allocated_gregs_section; bpodata->n_bpo_relocs_this_section = 0; } bpodata->n_bpo_relocs_this_section++; gregdata->n_max_bpo_relocs++; /* We don't get another chance to set this before GC; we've not set up any hook that runs before GC. */ gregdata->n_bpo_relocs = gregdata->n_max_bpo_relocs; break; case R_MMIX_PUSHJ_STUBBABLE: mmix_elf_section_data (sec)->pjs.n_pushj_relocs++; break; } } /* Allocate per-reloc stub storage and initialize it to the max stub size. */ if (mmix_elf_section_data (sec)->pjs.n_pushj_relocs != 0) { size_t i; mmix_elf_section_data (sec)->pjs.stub_size = bfd_alloc (abfd, mmix_elf_section_data (sec)->pjs.n_pushj_relocs * sizeof (mmix_elf_section_data (sec) ->pjs.stub_size[0])); if (mmix_elf_section_data (sec)->pjs.stub_size == NULL) return FALSE; for (i = 0; i < mmix_elf_section_data (sec)->pjs.n_pushj_relocs; i++) mmix_elf_section_data (sec)->pjs.stub_size[i] = MAX_PUSHJ_STUB_SIZE; } return TRUE; } /* Look through the relocs for a section during the first phase. */ static bfd_boolean mmix_elf_check_relocs (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; asection *sec; const Elf_Internal_Rela *relocs; { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf64_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; /* First we sort the relocs so that any register relocs come before expansion-relocs to the same insn. FIXME: Not done for mmo. */ qsort ((PTR) relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), mmix_elf_sort_relocs); /* Do the common part. */ if (!mmix_elf_check_common_relocs (abfd, info, sec, relocs)) return FALSE; if (info->relocatable) return TRUE; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { struct elf_link_hash_entry *h; unsigned long r_symndx; r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) h = NULL; else { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; } switch (ELF64_R_TYPE (rel->r_info)) { /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_MMIX_GNU_VTINHERIT: if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) return FALSE; break; /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_MMIX_GNU_VTENTRY: if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) return FALSE; break; } } return TRUE; } /* Wrapper for mmix_elf_check_common_relocs, called when linking to mmo. Copied from elf_link_add_object_symbols. */ bfd_boolean _bfd_mmix_check_all_relocs (abfd, info) bfd *abfd; struct bfd_link_info *info; { asection *o; for (o = abfd->sections; o != NULL; o = o->next) { Elf_Internal_Rela *internal_relocs; bfd_boolean ok; if ((o->flags & SEC_RELOC) == 0 || o->reloc_count == 0 || ((info->strip == strip_all || info->strip == strip_debugger) && (o->flags & SEC_DEBUGGING) != 0) || bfd_is_abs_section (o->output_section)) continue; internal_relocs = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL, (Elf_Internal_Rela *) NULL, info->keep_memory); if (internal_relocs == NULL) return FALSE; ok = mmix_elf_check_common_relocs (abfd, info, o, internal_relocs); if (! info->keep_memory) free (internal_relocs); if (! ok) return FALSE; } return TRUE; } /* Change symbols relative to the reg contents section to instead be to the register section, and scale them down to correspond to the register number. */ static bfd_boolean mmix_elf_link_output_symbol_hook (info, name, sym, input_sec, h) struct bfd_link_info *info ATTRIBUTE_UNUSED; const char *name ATTRIBUTE_UNUSED; Elf_Internal_Sym *sym; asection *input_sec; struct elf_link_hash_entry *h ATTRIBUTE_UNUSED; { if (input_sec != NULL && input_sec->name != NULL && ELF_ST_TYPE (sym->st_info) != STT_SECTION && strcmp (input_sec->name, MMIX_REG_CONTENTS_SECTION_NAME) == 0) { sym->st_value /= 8; sym->st_shndx = SHN_REGISTER; } return TRUE; } /* We fake a register section that holds values that are register numbers. Having a SHN_REGISTER and register section translates better to other formats (e.g. mmo) than for example a STT_REGISTER attribute. This section faking is based on a construct in elf32-mips.c. */ static asection mmix_elf_reg_section; static asymbol mmix_elf_reg_section_symbol; static asymbol *mmix_elf_reg_section_symbol_ptr; /* Handle the special section numbers that a symbol may use. */ void mmix_elf_symbol_processing (abfd, asym) bfd *abfd ATTRIBUTE_UNUSED; asymbol *asym; { elf_symbol_type *elfsym; elfsym = (elf_symbol_type *) asym; switch (elfsym->internal_elf_sym.st_shndx) { case SHN_REGISTER: if (mmix_elf_reg_section.name == NULL) { /* Initialize the register section. */ mmix_elf_reg_section.name = MMIX_REG_SECTION_NAME; mmix_elf_reg_section.flags = SEC_NO_FLAGS; mmix_elf_reg_section.output_section = &mmix_elf_reg_section; mmix_elf_reg_section.symbol = &mmix_elf_reg_section_symbol; mmix_elf_reg_section.symbol_ptr_ptr = &mmix_elf_reg_section_symbol_ptr; mmix_elf_reg_section_symbol.name = MMIX_REG_SECTION_NAME; mmix_elf_reg_section_symbol.flags = BSF_SECTION_SYM; mmix_elf_reg_section_symbol.section = &mmix_elf_reg_section; mmix_elf_reg_section_symbol_ptr = &mmix_elf_reg_section_symbol; } asym->section = &mmix_elf_reg_section; break; default: break; } } /* Given a BFD section, try to locate the corresponding ELF section index. */ static bfd_boolean mmix_elf_section_from_bfd_section (abfd, sec, retval) bfd * abfd ATTRIBUTE_UNUSED; asection * sec; int * retval; { if (strcmp (bfd_get_section_name (abfd, sec), MMIX_REG_SECTION_NAME) == 0) *retval = SHN_REGISTER; else return FALSE; return TRUE; } /* Hook called by the linker routine which adds symbols from an object file. We must handle the special SHN_REGISTER section number here. We also check that we only have *one* each of the section-start symbols, since otherwise having two with the same value would cause them to be "merged", but with the contents serialized. */ bfd_boolean mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Sym *sym; const char **namep ATTRIBUTE_UNUSED; flagword *flagsp ATTRIBUTE_UNUSED; asection **secp; bfd_vma *valp ATTRIBUTE_UNUSED; { if (sym->st_shndx == SHN_REGISTER) { *secp = bfd_make_section_old_way (abfd, MMIX_REG_SECTION_NAME); (*secp)->flags |= SEC_LINKER_CREATED; } else if ((*namep)[0] == '_' && (*namep)[1] == '_' && (*namep)[2] == '.' && strncmp (*namep, MMIX_LOC_SECTION_START_SYMBOL_PREFIX, strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX)) == 0) { /* See if we have another one. */ struct bfd_link_hash_entry *h = bfd_link_hash_lookup (info->hash, *namep, FALSE, FALSE, FALSE); if (h != NULL && h->type != bfd_link_hash_undefined) { /* How do we get the asymbol (or really: the filename) from h? h->u.def.section->owner is NULL. */ ((*_bfd_error_handler) (_("%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n"), bfd_get_filename (abfd), *namep, *namep + strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX))); bfd_set_error (bfd_error_bad_value); return FALSE; } } return TRUE; } /* We consider symbols matching "L.*:[0-9]+" to be local symbols. */ bfd_boolean mmix_elf_is_local_label_name (abfd, name) bfd *abfd; const char *name; { const char *colpos; int digits; /* Also include the default local-label definition. */ if (_bfd_elf_is_local_label_name (abfd, name)) return TRUE; if (*name != 'L') return FALSE; /* If there's no ":", or more than one, it's not a local symbol. */ colpos = strchr (name, ':'); if (colpos == NULL || strchr (colpos + 1, ':') != NULL) return FALSE; /* Check that there are remaining characters and that they are digits. */ if (colpos[1] == 0) return FALSE; digits = strspn (colpos + 1, "0123456789"); return digits != 0 && colpos[1 + digits] == 0; } /* We get rid of the register section here. */ bfd_boolean mmix_elf_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; { /* We never output a register section, though we create one for temporary measures. Check that nobody entered contents into it. */ asection *reg_section; reg_section = bfd_get_section_by_name (abfd, MMIX_REG_SECTION_NAME); if (reg_section != NULL) { /* FIXME: Pass error state gracefully. */ if (bfd_get_section_flags (abfd, reg_section) & SEC_HAS_CONTENTS) _bfd_abort (__FILE__, __LINE__, _("Register section has contents\n")); /* Really remove the section, if it hasn't already been done. */ if (!bfd_section_removed_from_list (abfd, reg_section)) { bfd_section_list_remove (abfd, reg_section); --abfd->section_count; } } if (! bfd_elf_final_link (abfd, info)) return FALSE; /* Since this section is marked SEC_LINKER_CREATED, it isn't output by the regular linker machinery. We do it here, like other targets with special sections. */ if (info->base_file != NULL) { asection *greg_section = bfd_get_section_by_name ((bfd *) info->base_file, MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME); if (!bfd_set_section_contents (abfd, greg_section->output_section, greg_section->contents, (file_ptr) greg_section->output_offset, greg_section->size)) return FALSE; } return TRUE; } /* We need to include the maximum size of PUSHJ-stubs in the initial section size. This is expected to shrink during linker relaxation. */ static void mmix_set_relaxable_size (abfd, sec, ptr) bfd *abfd ATTRIBUTE_UNUSED; asection *sec; void *ptr; { struct bfd_link_info *info = ptr; /* Make sure we only do this for section where we know we want this, otherwise we might end up resetting the size of COMMONs. */ if (mmix_elf_section_data (sec)->pjs.n_pushj_relocs == 0) return; sec->rawsize = sec->size; sec->size += (mmix_elf_section_data (sec)->pjs.n_pushj_relocs * MAX_PUSHJ_STUB_SIZE); /* For use in relocatable link, we start with a max stubs size. See mmix_elf_relax_section. */ if (info->relocatable && sec->output_section) mmix_elf_section_data (sec->output_section)->pjs.stubs_size_sum += (mmix_elf_section_data (sec)->pjs.n_pushj_relocs * MAX_PUSHJ_STUB_SIZE); } /* Initialize stuff for the linker-generated GREGs to match R_MMIX_BASE_PLUS_OFFSET relocs seen by the linker. */ bfd_boolean _bfd_mmix_before_linker_allocation (abfd, info) bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { asection *bpo_gregs_section; bfd *bpo_greg_owner; struct bpo_greg_section_info *gregdata; size_t n_gregs; bfd_vma gregs_size; size_t i; size_t *bpo_reloc_indexes; bfd *ibfd; /* Set the initial size of sections. */ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) bfd_map_over_sections (ibfd, mmix_set_relaxable_size, info); /* The bpo_greg_owner bfd is supposed to have been set by mmix_elf_check_relocs when the first R_MMIX_BASE_PLUS_OFFSET is seen. If there is no such object, there was no R_MMIX_BASE_PLUS_OFFSET. */ bpo_greg_owner = (bfd *) info->base_file; if (bpo_greg_owner == NULL) return TRUE; bpo_gregs_section = bfd_get_section_by_name (bpo_greg_owner, MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME); if (bpo_gregs_section == NULL) return TRUE; /* We use the target-data handle in the ELF section data. */ gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg; if (gregdata == NULL) return FALSE; n_gregs = gregdata->n_bpo_relocs; gregdata->n_allocated_bpo_gregs = n_gregs; /* When this reaches zero during relaxation, all entries have been filled in and the size of the linker gregs can be calculated. */ gregdata->n_remaining_bpo_relocs_this_relaxation_round = n_gregs; /* Set the zeroth-order estimate for the GREGs size. */ gregs_size = n_gregs * 8; if (!bfd_set_section_size (bpo_greg_owner, bpo_gregs_section, gregs_size)) return FALSE; /* Allocate and set up the GREG arrays. They're filled in at relaxation time. Note that we must use the max number ever noted for the array, since the index numbers were created before GC. */ gregdata->reloc_request = bfd_zalloc (bpo_greg_owner, sizeof (struct bpo_reloc_request) * gregdata->n_max_bpo_relocs); gregdata->bpo_reloc_indexes = bpo_reloc_indexes = bfd_alloc (bpo_greg_owner, gregdata->n_max_bpo_relocs * sizeof (size_t)); if (bpo_reloc_indexes == NULL) return FALSE; /* The default order is an identity mapping. */ for (i = 0; i < gregdata->n_max_bpo_relocs; i++) { bpo_reloc_indexes[i] = i; gregdata->reloc_request[i].bpo_reloc_no = i; } return TRUE; } /* Fill in contents in the linker allocated gregs. Everything is calculated at this point; we just move the contents into place here. */ bfd_boolean _bfd_mmix_after_linker_allocation (abfd, link_info) bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *link_info; { asection *bpo_gregs_section; bfd *bpo_greg_owner; struct bpo_greg_section_info *gregdata; size_t n_gregs; size_t i, j; size_t lastreg; bfd_byte *contents; /* The bpo_greg_owner bfd is supposed to have been set by mmix_elf_check_relocs when the first R_MMIX_BASE_PLUS_OFFSET is seen. If there is no such object, there was no R_MMIX_BASE_PLUS_OFFSET. */ bpo_greg_owner = (bfd *) link_info->base_file; if (bpo_greg_owner == NULL) return TRUE; bpo_gregs_section = bfd_get_section_by_name (bpo_greg_owner, MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME); /* This can't happen without DSO handling. When DSOs are handled without any R_MMIX_BASE_PLUS_OFFSET seen, there will be no such section. */ if (bpo_gregs_section == NULL) return TRUE; /* We use the target-data handle in the ELF section data. */ gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg; if (gregdata == NULL) return FALSE; n_gregs = gregdata->n_allocated_bpo_gregs; bpo_gregs_section->contents = contents = bfd_alloc (bpo_greg_owner, bpo_gregs_section->size); if (contents == NULL) return FALSE; /* Sanity check: If these numbers mismatch, some relocation has not been accounted for and the rest of gregdata is probably inconsistent. It's a bug, but it's more helpful to identify it than segfaulting below. */ if (gregdata->n_remaining_bpo_relocs_this_relaxation_round != gregdata->n_bpo_relocs) { (*_bfd_error_handler) (_("Internal inconsistency: remaining %u != max %u.\n\ Please report this bug."), gregdata->n_remaining_bpo_relocs_this_relaxation_round, gregdata->n_bpo_relocs); return FALSE; } for (lastreg = 255, i = 0, j = 0; j < n_gregs; i++) if (gregdata->reloc_request[i].regindex != lastreg) { bfd_put_64 (bpo_greg_owner, gregdata->reloc_request[i].value, contents + j * 8); lastreg = gregdata->reloc_request[i].regindex; j++; } return TRUE; } /* Sort valid relocs to come before non-valid relocs, then on increasing value. */ static int bpo_reloc_request_sort_fn (p1, p2) const PTR p1; const PTR p2; { const struct bpo_reloc_request *r1 = (const struct bpo_reloc_request *) p1; const struct bpo_reloc_request *r2 = (const struct bpo_reloc_request *) p2; /* Primary function is validity; non-valid relocs sorted after valid ones. */ if (r1->valid != r2->valid) return r2->valid - r1->valid; /* Then sort on value. Don't simplify and return just the difference of the values: the upper bits of the 64-bit value would be truncated on a host with 32-bit ints. */ if (r1->value != r2->value) return r1->value > r2->value ? 1 : -1; /* As a last re-sort, use the relocation number, so we get a stable sort. The *addresses* aren't stable since items are swapped during sorting. It depends on the qsort implementation if this actually happens. */ return r1->bpo_reloc_no > r2->bpo_reloc_no ? 1 : (r1->bpo_reloc_no < r2->bpo_reloc_no ? -1 : 0); } /* For debug use only. Dumps the global register allocations resulting from base-plus-offset relocs. */ void mmix_dump_bpo_gregs (link_info, pf) struct bfd_link_info *link_info; bfd_error_handler_type pf; { bfd *bpo_greg_owner; asection *bpo_gregs_section; struct bpo_greg_section_info *gregdata; unsigned int i; if (link_info == NULL || link_info->base_file == NULL) return; bpo_greg_owner = (bfd *) link_info->base_file; bpo_gregs_section = bfd_get_section_by_name (bpo_greg_owner, MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME); if (bpo_gregs_section == NULL) return; gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg; if (gregdata == NULL) return; if (pf == NULL) pf = _bfd_error_handler; /* These format strings are not translated. They are for debug purposes only and never displayed to an end user. Should they escape, we surely want them in original. */ (*pf) (" n_bpo_relocs: %u\n n_max_bpo_relocs: %u\n n_remain...round: %u\n\ n_allocated_bpo_gregs: %u\n", gregdata->n_bpo_relocs, gregdata->n_max_bpo_relocs, gregdata->n_remaining_bpo_relocs_this_relaxation_round, gregdata->n_allocated_bpo_gregs); if (gregdata->reloc_request) for (i = 0; i < gregdata->n_max_bpo_relocs; i++) (*pf) ("%4u (%4u)/%4u#%u: 0x%08lx%08lx r: %3u o: %3u\n", i, (gregdata->bpo_reloc_indexes != NULL ? gregdata->bpo_reloc_indexes[i] : (size_t) -1), gregdata->reloc_request[i].bpo_reloc_no, gregdata->reloc_request[i].valid, (unsigned long) (gregdata->reloc_request[i].value >> 32), (unsigned long) gregdata->reloc_request[i].value, gregdata->reloc_request[i].regindex, gregdata->reloc_request[i].offset); } /* This links all R_MMIX_BASE_PLUS_OFFSET relocs into a special array, and when the last such reloc is done, an index-array is sorted according to the values and iterated over to produce register numbers (indexed by 0 from the first allocated register number) and offsets for use in real relocation. PUSHJ stub accounting is also done here. Symbol- and reloc-reading infrastructure copied from elf-m10200.c. */ static bfd_boolean mmix_elf_relax_section (abfd, sec, link_info, again) bfd *abfd; asection *sec; struct bfd_link_info *link_info; bfd_boolean *again; { Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *internal_relocs; Elf_Internal_Rela *irel, *irelend; asection *bpo_gregs_section = NULL; struct bpo_greg_section_info *gregdata; struct bpo_reloc_section_info *bpodata = mmix_elf_section_data (sec)->bpo.reloc; /* The initialization is to quiet compiler warnings. The value is to spot a missing actual initialization. */ size_t bpono = (size_t) -1; size_t pjsno = 0; bfd *bpo_greg_owner; Elf_Internal_Sym *isymbuf = NULL; bfd_size_type size = sec->rawsize ? sec->rawsize : sec->size; mmix_elf_section_data (sec)->pjs.stubs_size_sum = 0; /* Assume nothing changes. */ *again = FALSE; /* We don't have to do anything if this section does not have relocs, or if this is not a code section. */ if ((sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0 || (sec->flags & SEC_CODE) == 0 || (sec->flags & SEC_LINKER_CREATED) != 0 /* If no R_MMIX_BASE_PLUS_OFFSET relocs and no PUSHJ-stub relocs, then nothing to do. */ || (bpodata == NULL && mmix_elf_section_data (sec)->pjs.n_pushj_relocs == 0)) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; bpo_greg_owner = (bfd *) link_info->base_file; if (bpodata != NULL) { bpo_gregs_section = bpodata->bpo_greg_section; gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg; bpono = bpodata->first_base_plus_offset_reloc; } else gregdata = NULL; /* Get a copy of the native relocations. */ internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory); if (internal_relocs == NULL) goto error_return; /* Walk through them looking for relaxing opportunities. */ irelend = internal_relocs + sec->reloc_count; for (irel = internal_relocs; irel < irelend; irel++) { bfd_vma symval; struct elf_link_hash_entry *h = NULL; /* We only process two relocs. */ if (ELF64_R_TYPE (irel->r_info) != (int) R_MMIX_BASE_PLUS_OFFSET && ELF64_R_TYPE (irel->r_info) != (int) R_MMIX_PUSHJ_STUBBABLE) continue; /* We process relocs in a distinctly different way when this is a relocatable link (for one, we don't look at symbols), so we avoid mixing its code with that for the "normal" relaxation. */ if (link_info->relocatable) { /* The only transformation in a relocatable link is to generate a full stub at the location of the stub calculated for the input section, if the relocated stub location, the end of the output section plus earlier stubs, cannot be reached. Thus relocatable linking can only lead to worse code, but it still works. */ if (ELF64_R_TYPE (irel->r_info) == R_MMIX_PUSHJ_STUBBABLE) { /* If we can reach the end of the output-section and beyond any current stubs, then we don't need a stub for this reloc. The relaxed order of output stub allocation may not exactly match the straightforward order, so we always assume presence of output stubs, which will allow relaxation only on relocations indifferent to the presence of output stub allocations for other relocations and thus the order of output stub allocation. */ if (bfd_check_overflow (complain_overflow_signed, 19, 0, bfd_arch_bits_per_address (abfd), /* Output-stub location. */ sec->output_section->rawsize + (mmix_elf_section_data (sec ->output_section) ->pjs.stubs_size_sum) /* Location of this PUSHJ reloc. */ - (sec->output_offset + irel->r_offset) /* Don't count *this* stub twice. */ - (mmix_elf_section_data (sec) ->pjs.stub_size[pjsno] + MAX_PUSHJ_STUB_SIZE)) == bfd_reloc_ok) mmix_elf_section_data (sec)->pjs.stub_size[pjsno] = 0; mmix_elf_section_data (sec)->pjs.stubs_size_sum += mmix_elf_section_data (sec)->pjs.stub_size[pjsno]; pjsno++; } continue; } /* Get the value of the symbol referred to by the reloc. */ if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info) { /* A local symbol. */ Elf_Internal_Sym *isym; asection *sym_sec; /* Read this BFD's local symbols if we haven't already. */ if (isymbuf == NULL) { isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; if (isymbuf == NULL) isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, symtab_hdr->sh_info, 0, NULL, NULL, NULL); if (isymbuf == 0) goto error_return; } isym = isymbuf + ELF64_R_SYM (irel->r_info); if (isym->st_shndx == SHN_UNDEF) sym_sec = bfd_und_section_ptr; else if (isym->st_shndx == SHN_ABS) sym_sec = bfd_abs_section_ptr; else if (isym->st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; else sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); symval = (isym->st_value + sym_sec->output_section->vma + sym_sec->output_offset); } else { unsigned long indx; /* An external symbol. */ indx = ELF64_R_SYM (irel->r_info) - symtab_hdr->sh_info; h = elf_sym_hashes (abfd)[indx]; BFD_ASSERT (h != NULL); if (h->root.type != bfd_link_hash_defined && h->root.type != bfd_link_hash_defweak) { /* This appears to be a reference to an undefined symbol. Just ignore it--it will be caught by the regular reloc processing. We need to keep BPO reloc accounting consistent, though else we'll abort instead of emitting an error message. */ if (ELF64_R_TYPE (irel->r_info) == R_MMIX_BASE_PLUS_OFFSET && gregdata != NULL) { gregdata->n_remaining_bpo_relocs_this_relaxation_round--; bpono++; } continue; } symval = (h->root.u.def.value + h->root.u.def.section->output_section->vma + h->root.u.def.section->output_offset); } if (ELF64_R_TYPE (irel->r_info) == (int) R_MMIX_PUSHJ_STUBBABLE) { bfd_vma value = symval + irel->r_addend; bfd_vma dot = (sec->output_section->vma + sec->output_offset + irel->r_offset); bfd_vma stubaddr = (sec->output_section->vma + sec->output_offset + size + mmix_elf_section_data (sec)->pjs.stubs_size_sum); if ((value & 3) == 0 && bfd_check_overflow (complain_overflow_signed, 19, 0, bfd_arch_bits_per_address (abfd), value - dot - (value > dot ? mmix_elf_section_data (sec) ->pjs.stub_size[pjsno] : 0)) == bfd_reloc_ok) /* If the reloc fits, no stub is needed. */ mmix_elf_section_data (sec)->pjs.stub_size[pjsno] = 0; else /* Maybe we can get away with just a JMP insn? */ if ((value & 3) == 0 && bfd_check_overflow (complain_overflow_signed, 27, 0, bfd_arch_bits_per_address (abfd), value - stubaddr - (value > dot ? mmix_elf_section_data (sec) ->pjs.stub_size[pjsno] - 4 : 0)) == bfd_reloc_ok) /* Yep, account for a stub consisting of a single JMP insn. */ mmix_elf_section_data (sec)->pjs.stub_size[pjsno] = 4; else /* Nope, go for the full insn stub. It doesn't seem useful to emit the intermediate sizes; those will only be useful for a >64M program assuming contiguous code. */ mmix_elf_section_data (sec)->pjs.stub_size[pjsno] = MAX_PUSHJ_STUB_SIZE; mmix_elf_section_data (sec)->pjs.stubs_size_sum += mmix_elf_section_data (sec)->pjs.stub_size[pjsno]; pjsno++; continue; } /* We're looking at a R_MMIX_BASE_PLUS_OFFSET reloc. */ gregdata->reloc_request[gregdata->bpo_reloc_indexes[bpono]].value = symval + irel->r_addend; gregdata->reloc_request[gregdata->bpo_reloc_indexes[bpono++]].valid = TRUE; gregdata->n_remaining_bpo_relocs_this_relaxation_round--; } /* Check if that was the last BPO-reloc. If so, sort the values and calculate how many registers we need to cover them. Set the size of the linker gregs, and if the number of registers changed, indicate that we need to relax some more because we have more work to do. */ if (gregdata != NULL && gregdata->n_remaining_bpo_relocs_this_relaxation_round == 0) { size_t i; bfd_vma prev_base; size_t regindex; /* First, reset the remaining relocs for the next round. */ gregdata->n_remaining_bpo_relocs_this_relaxation_round = gregdata->n_bpo_relocs; qsort ((PTR) gregdata->reloc_request, gregdata->n_max_bpo_relocs, sizeof (struct bpo_reloc_request), bpo_reloc_request_sort_fn); /* Recalculate indexes. When we find a change (however unlikely after the initial iteration), we know we need to relax again, since items in the GREG-array are sorted by increasing value and stored in the relaxation phase. */ for (i = 0; i < gregdata->n_max_bpo_relocs; i++) if (gregdata->bpo_reloc_indexes[gregdata->reloc_request[i].bpo_reloc_no] != i) { gregdata->bpo_reloc_indexes[gregdata->reloc_request[i].bpo_reloc_no] = i; *again = TRUE; } /* Allocate register numbers (indexing from 0). Stop at the first non-valid reloc. */ for (i = 0, regindex = 0, prev_base = gregdata->reloc_request[0].value; i < gregdata->n_bpo_relocs; i++) { if (gregdata->reloc_request[i].value > prev_base + 255) { regindex++; prev_base = gregdata->reloc_request[i].value; } gregdata->reloc_request[i].regindex = regindex; gregdata->reloc_request[i].offset = gregdata->reloc_request[i].value - prev_base; } /* If it's not the same as the last time, we need to relax again, because the size of the section has changed. I'm not sure we actually need to do any adjustments since the shrinking happens at the start of this section, but better safe than sorry. */ if (gregdata->n_allocated_bpo_gregs != regindex + 1) { gregdata->n_allocated_bpo_gregs = regindex + 1; *again = TRUE; } bpo_gregs_section->size = (regindex + 1) * 8; } if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents) { if (! link_info->keep_memory) free (isymbuf); else { /* Cache the symbols for elf_link_input_bfd. */ symtab_hdr->contents = (unsigned char *) isymbuf; } } if (internal_relocs != NULL && elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); if (sec->size < size + mmix_elf_section_data (sec)->pjs.stubs_size_sum) abort (); if (sec->size > size + mmix_elf_section_data (sec)->pjs.stubs_size_sum) { sec->size = size + mmix_elf_section_data (sec)->pjs.stubs_size_sum; *again = TRUE; } return TRUE; error_return: if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents) free (isymbuf); if (internal_relocs != NULL && elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); return FALSE; } #define ELF_ARCH bfd_arch_mmix #define ELF_MACHINE_CODE EM_MMIX /* According to mmix-doc page 36 (paragraph 45), this should be (1LL << 48LL). However, that's too much for something somewhere in the linker part of BFD; perhaps the start-address has to be a non-zero multiple of this number, or larger than this number. The symptom is that the linker complains: "warning: allocated section `.text' not in segment". We settle for 64k; the page-size used in examples is 8k. #define ELF_MAXPAGESIZE 0x10000 Unfortunately, this causes excessive padding in the supposedly small for-education programs that are the expected usage (where people would inspect output). We stick to 256 bytes just to have *some* default alignment. */ #define ELF_MAXPAGESIZE 0x100 #define TARGET_BIG_SYM bfd_elf64_mmix_vec #define TARGET_BIG_NAME "elf64-mmix" #define elf_info_to_howto_rel NULL #define elf_info_to_howto mmix_info_to_howto_rela #define elf_backend_relocate_section mmix_elf_relocate_section #define elf_backend_gc_mark_hook mmix_elf_gc_mark_hook #define elf_backend_gc_sweep_hook mmix_elf_gc_sweep_hook #define elf_backend_link_output_symbol_hook \ mmix_elf_link_output_symbol_hook #define elf_backend_add_symbol_hook mmix_elf_add_symbol_hook #define elf_backend_check_relocs mmix_elf_check_relocs #define elf_backend_symbol_processing mmix_elf_symbol_processing #define bfd_elf64_bfd_is_local_label_name \ mmix_elf_is_local_label_name #define elf_backend_may_use_rel_p 0 #define elf_backend_may_use_rela_p 1 #define elf_backend_default_use_rela_p 1 #define elf_backend_can_gc_sections 1 #define elf_backend_section_from_bfd_section \ mmix_elf_section_from_bfd_section #define bfd_elf64_new_section_hook mmix_elf_new_section_hook #define bfd_elf64_bfd_final_link mmix_elf_final_link #define bfd_elf64_bfd_relax_section mmix_elf_relax_section #include "elf64-target.h"
Java
puavo-sharedir ============== A script to manage "shared directories", using inotify and ACLs, and some additional scripts.
Java
#!/bin/sh # $Id: run_tic.sh,v 1.1 2011/08/18 02:20:39 tsaitc Exp $ ############################################################################## # Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # # to deal in the Software without restriction, including without limitation # # the rights to use, copy, modify, merge, publish, distribute, distribute # # with modifications, sublicense, and/or sell copies of the Software, and to # # permit persons to whom the Software is furnished to do so, subject to the # # following conditions: # # # # The above copyright notice and this permission notice shall be included in # # all copies or substantial portions of the Software. # # # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # # DEALINGS IN THE SOFTWARE. # # # # Except as contained in this notice, the name(s) of the above copyright # # holders shall not be used in advertising or otherwise to promote the sale, # # use or other dealings in this Software without prior written # # authorization. # ############################################################################## # # Author: Thomas E. Dickey 1996-on # # This script is used to install terminfo.src using tic. We use a script # because the path checking is too awkward to do in a makefile. # # Assumes: # The leaf directory names (lib, tabset, terminfo) # echo '** Building terminfo database, please wait...' # # The script is designed to be run from the misc/Makefile as # make install.data : ${suffix:=} : ${DESTDIR:=} : ${prefix:=$(ROOTDIR)/romfs/usr} : ${exec_prefix:=${prefix}} : ${bindir:=${exec_prefix}/bin} : ${top_srcdir:=..} : ${srcdir:=.} : ${datadir:=${prefix}/share} : ${TIC_PATH:=/usr/bin/tic} : ${ticdir:=${prefix}/share/terminfo} : ${source:=${top_srcdir}/misc/terminfo.src} : ${LN_S:="ln -s -f"} : ${cross_compiling:=no} : ${ext_funcs:=1} test -z "${DESTDIR}" && DESTDIR= # Allow tic to run either from the install-path, or from the build-directory. # Do not do this if we appear to be cross-compiling. In that case, we rely # on the host's copy of tic to compile the terminfo database. if test "x$cross_compiling" = "xno" then if test -f ../progs/tic$suffix then case "$PATH" in \:*) PATH="../progs:../lib:${DESTDIR}$bindir$PATH" ;; *) PATH="../progs:../lib:${DESTDIR}$bindir:$PATH" ;; esac export PATH if test shared = shared then SHLIB="sh $srcdir/shlib" TIC_PATH="$SHLIB tic" else TIC_PATH="tic" fi elif test "$TIC_PATH" = unknown then echo '? no tic program found' exit 1 fi else # Cross-compiling, so don't set PATH or run shlib. SHLIB= # reset $suffix, since it applies to the target, not the build platform. suffix= fi # set another env var that doesn't get reset when `shlib' runs, so `shlib' uses # the PATH we just set. SHLIB_PATH=$PATH export SHLIB_PATH # set a variable to simplify environment update in shlib SHLIB_HOST=linux-gnu export SHLIB_HOST # don't use user's TERMINFO variable TERMINFO=${DESTDIR}$ticdir ; export TERMINFO umask 022 # Construct the name of the old (obsolete) pathname, e.g., /usr/lib/terminfo. TICDIR=`echo $TERMINFO | sed -e 's%/share/\([^/]*\)$%/lib/\1%'` # Parent directory may not exist, which would confuse the install for hashed # database. Fix. PARENT=`echo "$TERMINFO" | sed -e 's%/[^/]*$%%'` if test -n "$PARENT" then test -d $PARENT || mkdir -p $PARENT fi # Remove the old terminfo stuff; we don't care if it existed before, and it # would generate a lot of confusing error messages if we tried to overwrite it. # We explicitly remove its contents rather than the directory itself, in case # the directory is actually a symbolic link. ( test -d "$TERMINFO" && cd $TERMINFO && rm -fr ? 2>/dev/null ) if test "$ext_funcs" = 1 ; then cat <<EOF Running $TIC_PATH to install $TERMINFO ... You may see messages regarding extended capabilities, e.g., AX. These are extended terminal capabilities which are compiled using tic -x If you have ncurses 4.2 applications, you should read the INSTALL document, and install the terminfo without the -x option. EOF if ( $TIC_PATH -x -s -o $TERMINFO $source ) then echo '** built new '$TERMINFO else echo '? tic could not build '$TERMINFO exit 1 fi else cat <<EOF Running $TIC_PATH to install $TERMINFO ... You may see messages regarding unknown capabilities, e.g., AX. These are extended terminal capabilities which may be compiled using tic -x If you have ncurses 4.2 applications, you should read the INSTALL document, and install the terminfo without the -x option. EOF if ( $TIC_PATH -s -o $TERMINFO $source ) then echo '** built new '$TERMINFO else echo '? tic could not build '$TERMINFO exit 1 fi fi # Make a symbolic link to provide compatibility with applications that expect # to find terminfo under /usr/lib. That is, we'll _try_ to do that. Not # all systems support symbolic links, and those that do provide a variety # of options for 'test'. if test "$TICDIR" != "$TERMINFO" ; then ( rm -f $TICDIR 2>/dev/null ) if ( cd $TICDIR 2>/dev/null ) then cd $TICDIR TICDIR=`pwd` if test $TICDIR != $TERMINFO ; then # Well, we tried. Some systems lie to us, so the # installer will have to double-check. echo "Verify if $TICDIR and $TERMINFO are the same." echo "The new terminfo is in $TERMINFO; the other should be a link to it." echo "Otherwise, remove $TICDIR and link it to $TERMINFO." fi else cd ${DESTDIR}$prefix # Construct a symbolic link that only assumes $ticdir has the # same $prefix as the other installed directories. RELATIVE=`echo $ticdir|sed -e 's%^'$prefix'/%%'` if test "$RELATIVE" != "$ticdir" ; then RELATIVE=../`echo $ticdir|sed -e 's%^'$prefix'/%%' -e 's%^/%%'` fi if ( ln -s -f $RELATIVE $TICDIR ) then echo '** sym-linked '$TICDIR' for compatibility' else echo '** could not sym-link '$TICDIR' for compatibility' fi fi fi # vile:shmode
Java
<?php /** * @package sauto * @subpackage Base * @author Dacian Strain {@link http://shop.elbase.eu} * @author Created on 17-Nov-2013 * @license GNU/GPL */ //-- No direct access defined('_JEXEC') || die('=;)'); $id =& JRequest::getVar( 'id', '', 'post', 'string' ); $db = JFactory::getDbo(); $query = "DELETE FROM #__sa_stare_auto WHERE `id` = '".$id."'"; $db->setQuery($query); $db->query(); $app =& JFactory::getApplication(); $redirect = 'index.php?option=com_sauto&task=setari&action=stare'; $app->redirect($redirect, 'Stare auto eliminata cu succes');
Java
var hilbert = (function() { // From Mike Bostock: http://bl.ocks.org/597287 // Adapted from Nick Johnson: http://bit.ly/biWkkq var pairs = [ [[0, 3], [1, 0], [3, 1], [2, 0]], [[2, 1], [1, 1], [3, 0], [0, 2]], [[2, 2], [3, 3], [1, 2], [0, 1]], [[0, 0], [3, 2], [1, 3], [2, 3]] ]; // d2xy and rot are from: // http://en.wikipedia.org/wiki/Hilbert_curve#Applications_and_mapping_algorithms var rot = function(n, x, y, rx, ry) { if (ry === 0) { if (rx === 1) { x = n - 1 - x; y = n - 1 - y; } return [y, x]; } return [x, y]; }; return { xy2d: function(x, y, z) { var quad = 0, pair, i = 0; while (--z >= 0) { pair = pairs[quad][(x & (1 << z) ? 2 : 0) | (y & (1 << z) ? 1 : 0)]; i = (i << 2) | pair[0]; quad = pair[1]; } return i; }, d2xy: function(z, t) { var n = 1 << z, x = 0, y = 0; for (var s = 1; s < n; s *= 2) { var rx = 1 & (t / 2), ry = 1 & (t ^ rx); var xy = rot(s, x, y, rx, ry); x = xy[0] + s * rx; y = xy[1] + s * ry; t /= 4; } return [x, y]; } }; })();
Java
/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ /*//////////////////// Responsive Framework CSS Rules Start */ /*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ @media screen and (min-width: 420px) { .mainMenuWrapper { padding-right: 24px; padding-left: 36px; } .mainMenuWrapper > li { float: left; box-sizing: border-box; width: 50%; } .mainMenuWrapper > li:nth-child(odd) { margin-left: -12px; } .mainMenuWrapper > li:nth-child(even) { margin-left: 12px; } } @media screen and (max-width: 380px) { .serviceWrapper { float: none; margin-right: 0px; width: 100%; } .serviceWrapper:last-child { border-bottom: 0px; } } /*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ /*//////////////////// Responsive Framework CSS Rules End */ /*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
Java
/* ************************************************************************************* * Linux * USB Host Controller Driver * * (c) Copyright 2006-2012, SoftWinners Co,Ld. * All Rights Reserved * * File Name : sw_hcd_virt_hub.c * * Author : javen * * Description : 虚拟 hub * * History : * <author> <time> <version > <desc> * javen 2010-12-20 1.0 create this file * ************************************************************************************* */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/time.h> #include <linux/timer.h> #include <asm/unaligned.h> #include "../include/sw_hcd_config.h" #include "../include/sw_hcd_core.h" #include "../include/sw_hcd_virt_hub.h" /* ******************************************************************************* * sw_hcd_port_suspend_ex * * Description: * only suspend USB port * * Parameters: * sw_hcd : input. USB控制器 * * Return value: * void * * note: * void * ******************************************************************************* */ void sw_hcd_port_suspend_ex(struct sw_hcd *sw_hcd) { /* if peripheral connect, suspend the device */ if (sw_hcd->is_active) { /* suspend usb port */ USBC_Host_SuspendPort(sw_hcd->sw_hcd_io->usb_bsp_hdle); /* delay for 1000ms */ mdelay(1000); } return; } /* ******************************************************************************* * sw_hcd_port_resume_ex * * Description: * only resume USB port * * Parameters: * sw_hcd : input. USB控制器 * * Return value: * void * * note: * void * ******************************************************************************* */ void sw_hcd_port_resume_ex(struct sw_hcd *sw_hcd) { /* resume port */ USBC_Host_RusumePort(sw_hcd->sw_hcd_io->usb_bsp_hdle); mdelay(500); USBC_Host_ClearRusumePortFlag(sw_hcd->sw_hcd_io->usb_bsp_hdle); return; } /* ******************************************************************************* * sw_hcd_port_reset_ex * * Description: * only reset USB port * * Parameters: * sw_hcd : input. USB控制器 * * Return value: * void * * note: * void * ******************************************************************************* */ void sw_hcd_port_reset_ex(struct sw_hcd *sw_hcd) { /* resume port */ sw_hcd_port_resume_ex(sw_hcd); /* reset port */ USBC_Host_ResetPort(sw_hcd->sw_hcd_io->usb_bsp_hdle); mdelay(50); USBC_Host_ClearResetPortFlag(sw_hcd->sw_hcd_io->usb_bsp_hdle); mdelay(500); return; } /* ******************************************************************************* * sw_hcd_port_suspend * * Description: * suspend USB port * * Parameters: * sw_hcd : input. USB控制器 * do_suspend : input. flag. is suspend USB port or not? * * Return value: * void * * note: * void * ******************************************************************************* */ static void sw_hcd_port_suspend(struct sw_hcd *sw_hcd, bool do_suspend) { u8 power = 0; void __iomem *usbc_base = sw_hcd->mregs; if (!is_host_active(sw_hcd)){ DMSG_PANIC("ERR: usb host is not active\n"); return; } /* NOTE: this doesn't necessarily put PHY into low power mode, * turning off its clock; that's a function of PHY integration and * sw_hcd_POWER_ENSUSPEND. PHY may need a clock (sigh) to detect * SE0 changing to connect (J) or wakeup (K) states. */ power = USBC_Readb(USBC_REG_PCTL(usbc_base)); if (do_suspend) { int retries = 10000; DMSG_INFO("[sw_hcd]: suspend port.\n"); power &= ~(1 << USBC_BP_POWER_H_RESUME); power |= (1 << USBC_BP_POWER_H_SUSPEND); USBC_Writeb(power, USBC_REG_PCTL(usbc_base)); /* Needed for OPT A tests */ power = USBC_Readb(USBC_REG_PCTL(usbc_base)); while (power & (1 << USBC_BP_POWER_H_SUSPEND)) { power = USBC_Readb(USBC_REG_PCTL(usbc_base)); if (retries-- < 1) break; } DMSG_DBG_HCD("DBG: Root port suspended, power %02x\n", power); sw_hcd->port1_status |= USB_PORT_STAT_SUSPEND; }else if (power & (1 << USBC_BP_POWER_H_SUSPEND)){ DMSG_INFO("[sw_hcd]: suspend portend, resume port.\n"); power &= ~(1 << USBC_BP_POWER_H_SUSPEND); power |= (1 << USBC_BP_POWER_H_RESUME); USBC_Writeb(power, USBC_REG_PCTL(usbc_base)); DMSG_DBG_HCD("DBG: Root port resuming, power %02x\n", power); /* later, GetPortStatus will stop RESUME signaling */ sw_hcd->port1_status |= SW_HCD_PORT_STAT_RESUME; sw_hcd->rh_timer = jiffies + msecs_to_jiffies(20); }else{ DMSG_PANIC("WRN: sw_hcd_port_suspend nothing to do\n"); } return ; } /* ******************************************************************************* * sw_hcd_port_reset * * Description: * reset USB port * * Parameters: * sw_hcd : input. USB控制器 * do_reset : input. flag. is reset USB port or not? * * Return value: * void * * note: * void * ******************************************************************************* */ static void sw_hcd_port_reset(struct sw_hcd *sw_hcd, bool do_reset) { u8 power = 0; void __iomem *usbc_base = sw_hcd->mregs; if (!is_host_active(sw_hcd)){ DMSG_PANIC("ERR: usb host is not active\n"); return; } /* NOTE: caller guarantees it will turn off the reset when * the appropriate amount of time has passed */ power = USBC_Readb(USBC_REG_PCTL(usbc_base)); if (do_reset) { DMSG_INFO("[sw_hcd]: reset port. \n"); /* * If RESUME is set, we must make sure it stays minimum 20 ms. * Then we must clear RESUME and wait a bit to let sw_hcd start * generating SOFs. If we don't do this, OPT HS A 6.8 tests * fail with "Error! Did not receive an SOF before suspend * detected". */ if (power & (1 << USBC_BP_POWER_H_RESUME)) { while (time_before(jiffies, sw_hcd->rh_timer)){ msleep(1); } power &= ~(1 << USBC_BP_POWER_H_RESUME); USBC_Writeb(power, USBC_REG_PCTL(usbc_base)); msleep(1); } sw_hcd->ignore_disconnect = true; power &= 0xf0; power |= (1 << USBC_BP_POWER_H_RESET); USBC_Writeb(power, USBC_REG_PCTL(usbc_base)); sw_hcd->port1_status |= USB_PORT_STAT_RESET; sw_hcd->port1_status &= ~USB_PORT_STAT_ENABLE; sw_hcd->rh_timer = jiffies + msecs_to_jiffies(50); USBC_Host_SetFunctionAddress_Deafult(sw_hcd->sw_hcd_io->usb_bsp_hdle, USBC_EP_TYPE_TX, 0); //set address ep0 { __u32 i = 1; __u8 old_ep_index = 0; old_ep_index = USBC_GetActiveEp(sw_hcd->sw_hcd_io->usb_bsp_hdle); USBC_SelectActiveEp(sw_hcd->sw_hcd_io->usb_bsp_hdle, 0); USBC_Host_SetFunctionAddress_Deafult(sw_hcd->sw_hcd_io->usb_bsp_hdle, USBC_EP_TYPE_TX, 0); for( i = 1 ; i <= 5; i++){ USBC_SelectActiveEp(sw_hcd->sw_hcd_io->usb_bsp_hdle, i); USBC_Host_SetFunctionAddress_Deafult(sw_hcd->sw_hcd_io->usb_bsp_hdle, USBC_EP_TYPE_TX, i); USBC_Host_SetFunctionAddress_Deafult(sw_hcd->sw_hcd_io->usb_bsp_hdle, USBC_EP_TYPE_RX, i); } USBC_SelectActiveEp(sw_hcd->sw_hcd_io->usb_bsp_hdle, old_ep_index); } }else{ DMSG_INFO("[sw_hcd]: reset port stopped.\n"); UsbPhyEndReset(0); power &= ~(1 << USBC_BP_POWER_H_RESET); USBC_Writeb(power, USBC_REG_PCTL(usbc_base)); sw_hcd->ignore_disconnect = false; power = USBC_Readb(USBC_REG_PCTL(usbc_base)); if(power & (1 << USBC_BP_POWER_H_HIGH_SPEED_FLAG)){ DMSG_DBG_HCD("high-speed device connected\n"); sw_hcd->port1_status |= USB_PORT_STAT_HIGH_SPEED; } sw_hcd->port1_status &= ~USB_PORT_STAT_RESET; sw_hcd->port1_status |= USB_PORT_STAT_ENABLE | (USB_PORT_STAT_C_RESET << 16) | (USB_PORT_STAT_C_ENABLE << 16); usb_hcd_poll_rh_status(sw_hcd_to_hcd(sw_hcd)); sw_hcd->vbuserr_retry = VBUSERR_RETRY_COUNT; } return ; } /* ******************************************************************************* * sw_hcd_root_disconnect * * Description: * 断开连接 * * Parameters: * sw_hcd : input. USB控制器 * * Return value: * void * * note: * void * ******************************************************************************* */ void sw_hcd_root_disconnect(struct sw_hcd *sw_hcd) { sw_hcd->port1_status = (1 << USB_PORT_FEAT_POWER) | (1 << USB_PORT_FEAT_C_CONNECTION); usb_hcd_poll_rh_status(sw_hcd_to_hcd(sw_hcd)); sw_hcd->is_active = 0; return; } EXPORT_SYMBOL(sw_hcd_root_disconnect); /* ******************************************************************************* * sw_hcd_hub_status_data * * Description: * Caller may or may not hold sw_hcd->lock * * Parameters: * void * * Return value: * void * * note: * void * ******************************************************************************* */ int sw_hcd_hub_status_data(struct usb_hcd *hcd, char *buf) { struct sw_hcd *sw_hcd = hcd_to_sw_hcd(hcd); int retval = 0; /* called in_irq() via usb_hcd_poll_rh_status() */ if (sw_hcd->port1_status & 0xffff0000) { *buf = 0x02; retval = 1; } return retval; } EXPORT_SYMBOL(sw_hcd_hub_status_data); /* ******************************************************************************* * sw_hcd_hub_control * * Description: * void * * Parameters: * void * * Return value: * void * * note: * void * ******************************************************************************* */ int sw_hcd_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, char *buf, u16 wLength) { struct sw_hcd *sw_hcd = hcd_to_sw_hcd(hcd); u32 temp = 0; int retval = 0; unsigned long flags = 0; void __iomem *usbc_base = sw_hcd->mregs; if(hcd == NULL){ DMSG_PANIC("ERR: invalid argment\n"); return -ESHUTDOWN; } spin_lock_irqsave(&sw_hcd->lock, flags); if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) { spin_unlock_irqrestore(&sw_hcd->lock, flags); return -ESHUTDOWN; } DMSG_DBG_HCD("sw_hcd_hub_control: typeReq = %x, wValue = 0x%x, wIndex = 0x%x\n", typeReq, wValue, wIndex); /* hub features: always zero, setting is a NOP * port features: reported, sometimes updated when host is active * no indicators */ switch (typeReq) { case ClearHubFeature: case SetHubFeature: switch (wValue) { case C_HUB_OVER_CURRENT: case C_HUB_LOCAL_POWER: break; default: goto error; } break; case ClearPortFeature: if ((wIndex & 0xff) != 1){ goto error; } switch (wValue) { case USB_PORT_FEAT_ENABLE: break; case USB_PORT_FEAT_SUSPEND: sw_hcd_port_suspend(sw_hcd, false); break; case USB_PORT_FEAT_POWER: /* fixme */ sw_hcd_set_vbus(sw_hcd, 0); break; case USB_PORT_FEAT_C_CONNECTION: case USB_PORT_FEAT_C_ENABLE: case USB_PORT_FEAT_C_OVER_CURRENT: case USB_PORT_FEAT_C_RESET: case USB_PORT_FEAT_C_SUSPEND: break; default: goto error; } DMSG_DBG_HCD("DBG: clear feature %d\n", wValue); sw_hcd->port1_status &= ~(1 << wValue); break; case GetHubDescriptor: { struct usb_hub_descriptor *desc = (void *)buf; desc->bDescLength = 9; desc->bDescriptorType = 0x29; desc->bNbrPorts = 1; desc->wHubCharacteristics = cpu_to_le16( 0x0001 /* per-port power switching */ | 0x0010 /* no overcurrent reporting */ ); desc->bPwrOn2PwrGood = 5; /* msec/2 */ desc->bHubContrCurrent = 0; /* workaround bogus struct definition */ desc->u.hs.DeviceRemovable[0] = 0x02; /* port 1 */ desc->u.hs.DeviceRemovable[1] = 0xff; } break; case GetHubStatus: temp = 0; *(__le32 *) buf = cpu_to_le32(temp); break; case GetPortStatus: { if (wIndex != 1){ DMSG_PANIC("ERR: GetPortStatus parameter wIndex is not 1.\n"); goto error; } /* finish RESET signaling? */ if ((sw_hcd->port1_status & USB_PORT_STAT_RESET) && time_after_eq(jiffies, sw_hcd->rh_timer)){ sw_hcd_port_reset(sw_hcd, false); } /* finish RESUME signaling? */ if ((sw_hcd->port1_status & SW_HCD_PORT_STAT_RESUME) && time_after_eq(jiffies, sw_hcd->rh_timer)) { u8 power = 0; power = USBC_Readb(USBC_REG_PCTL(usbc_base)); power &= ~(1 << USBC_BP_POWER_H_RESUME); USBC_Writeb(power, USBC_REG_PCTL(usbc_base)); DMSG_DBG_HCD("DBG: root port resume stopped, power %02x\n", power); /* ISSUE: DaVinci (RTL 1.300) disconnects after * resume of high speed peripherals (but not full * speed ones). */ sw_hcd->is_active = 1; sw_hcd->port1_status &= ~(USB_PORT_STAT_SUSPEND | SW_HCD_PORT_STAT_RESUME); sw_hcd->port1_status |= USB_PORT_STAT_C_SUSPEND << 16; usb_hcd_poll_rh_status(sw_hcd_to_hcd(sw_hcd)); } put_unaligned(cpu_to_le32(sw_hcd->port1_status & ~SW_HCD_PORT_STAT_RESUME), (__le32 *) buf); /* port change status is more interesting */ DMSG_DBG_HCD("DBG: port status %08x\n", sw_hcd->port1_status); } break; case SetPortFeature: { if ((wIndex & 0xff) != 1){ goto error; } switch (wValue) { case USB_PORT_FEAT_POWER: /* NOTE: this controller has a strange state machine * that involves "requesting sessions" according to * magic side effects from incompletely-described * rules about startup... * * This call is what really starts the host mode; be * very careful about side effects if you reorder any * initialization logic, e.g. for OTG, or change any * logic relating to VBUS power-up. */ sw_hcd_start(sw_hcd); break; case USB_PORT_FEAT_RESET: sw_hcd_port_reset(sw_hcd, true); break; case USB_PORT_FEAT_SUSPEND: sw_hcd_port_suspend(sw_hcd, true); break; case USB_PORT_FEAT_TEST: { if (unlikely(is_host_active(sw_hcd))){ DMSG_PANIC("ERR: usb host is not active\n"); goto error; } wIndex >>= 8; switch (wIndex) { case 1: DMSG_DBG_HCD("TEST_J\n"); temp = 1 << USBC_BP_TMCTL_TEST_J; break; case 2: DMSG_DBG_HCD("TEST_K\n"); temp = 1 << USBC_BP_TMCTL_TEST_K; break; case 3: DMSG_DBG_HCD("TEST_SE0_NAK\n"); temp = 1 << USBC_BP_TMCTL_TEST_SE0_NAK; break; case 4: DMSG_DBG_HCD("TEST_PACKET\n"); temp = 1 << USBC_BP_TMCTL_TEST_PACKET; sw_hcd_load_testpacket(sw_hcd); break; case 5: DMSG_DBG_HCD("TEST_FORCE_ENABLE\n"); temp = (1 << USBC_BP_TMCTL_FORCE_HOST) | (1 << USBC_BP_TMCTL_FORCE_HS); USBC_REG_set_bit_b(USBC_BP_DEVCTL_SESSION, USBC_REG_DEVCTL(usbc_base)); break; case 6: DMSG_DBG_HCD("TEST_FIFO_ACCESS\n"); temp = 1 << USBC_BP_TMCTL_FIFO_ACCESS; break; default: DMSG_PANIC("ERR: unkown SetPortFeature USB_PORT_FEAT_TEST wIndex(%d)\n", wIndex); goto error; } USBC_Writeb(temp, USBC_REG_TMCTL(usbc_base)); } break; default:{ DMSG_PANIC("ERR: unkown SetPortFeature wValue(%d)\n", wValue); goto error; } } DMSG_DBG_HCD("DBG: set feature %d\n", wValue); sw_hcd->port1_status |= 1 << wValue; } break; default: error: DMSG_PANIC("ERR: protocol stall on error\n"); /* "protocol stall" on error */ retval = -EPIPE; } spin_unlock_irqrestore(&sw_hcd->lock, flags); return retval; } EXPORT_SYMBOL(sw_hcd_hub_control);
Java
/* * This file contains work-arounds for many known PCI hardware * bugs. Devices present only on certain architectures (host * bridges et cetera) should be handled in arch-specific code. * * Note: any quirks for hotpluggable devices must _NOT_ be declared __init. * * Copyright (c) 1999 Martin Mares <mj@ucw.cz> * * Init/reset quirks for USB host controllers should be in the * USB quirks file, where their drivers can access reuse it. * * The bridge optimization stuff has been removed. If you really * have a silly BIOS which is unable to set your host bridge right, * use the PowerTweak utility (see http://powertweak.sourceforge.net). */ #include <linux/types.h> #include <linux/kernel.h> #include <linux/pci.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/acpi.h> #include <linux/kallsyms.h> #include <linux/dmi.h> #include <linux/pci-aspm.h> #include <linux/ioport.h> #include "pci.h" int isa_dma_bridge_buggy; EXPORT_SYMBOL(isa_dma_bridge_buggy); int pci_pci_problems; EXPORT_SYMBOL(pci_pci_problems); #ifdef CONFIG_PCI_QUIRKS /* * This quirk function disables memory decoding and releases memory resources * of the device specified by kernel's boot parameter 'pci=resource_alignment='. * It also rounds up size to specified alignment. * Later on, the kernel will assign page-aligned memory resource back * to the device. */ static void __devinit quirk_resource_alignment(struct pci_dev *dev) { int i; struct resource *r; resource_size_t align, size; u16 command; if (!pci_is_reassigndev(dev)) return; if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL && (dev->class >> 8) == PCI_CLASS_BRIDGE_HOST) { dev_warn(&dev->dev, "Can't reassign resources to host bridge.\n"); return; } dev_info(&dev->dev, "Disabling memory decoding and releasing memory resources.\n"); pci_read_config_word(dev, PCI_COMMAND, &command); command &= ~PCI_COMMAND_MEMORY; pci_write_config_word(dev, PCI_COMMAND, command); align = pci_specified_resource_alignment(dev); for (i=0; i < PCI_BRIDGE_RESOURCES; i++) { r = &dev->resource[i]; if (!(r->flags & IORESOURCE_MEM)) continue; size = resource_size(r); if (size < align) { size = align; dev_info(&dev->dev, "Rounding up size of resource #%d to %#llx.\n", i, (unsigned long long)size); } r->end = size - 1; r->start = 0; } /* Need to disable bridge's resource window, * to enable the kernel to reassign new resource * window later on. */ if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) { r = &dev->resource[i]; if (!(r->flags & IORESOURCE_MEM)) continue; r->end = resource_size(r) - 1; r->start = 0; } pci_disable_bridge_window(dev); } } DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_resource_alignment); #ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS /* The Mellanox Tavor device gives false positive parity errors * Mark this device with a broken_parity_status, to allow * PCI scanning code to "skip" this now blacklisted device. */ static void __devinit quirk_mellanox_tavor(struct pci_dev *dev) { dev->broken_parity_status = 1; /* This device gives false positives */ } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR,quirk_mellanox_tavor); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE,quirk_mellanox_tavor); /* Deal with broken BIOS'es that neglect to enable passive release, which can cause problems in combination with the 82441FX/PPro MTRRs */ static void quirk_passive_release(struct pci_dev *dev) { struct pci_dev *d = NULL; unsigned char dlc; /* We have to make sure a particular bit is set in the PIIX3 ISA bridge, so we have to go out and find it. */ while ((d = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, d))) { pci_read_config_byte(d, 0x82, &dlc); if (!(dlc & 1<<1)) { dev_info(&d->dev, "PIIX3: Enabling Passive Release\n"); dlc |= 1<<1; pci_write_config_byte(d, 0x82, dlc); } } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release); /* The VIA VP2/VP3/MVP3 seem to have some 'features'. There may be a workaround but VIA don't answer queries. If you happen to have good contacts at VIA ask them for me please -- Alan This appears to be BIOS not version dependent. So presumably there is a chipset level fix */ static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev) { if (!isa_dma_bridge_buggy) { isa_dma_bridge_buggy=1; dev_info(&dev->dev, "Activating ISA DMA hang workarounds\n"); } } /* * Its not totally clear which chipsets are the problematic ones * We know 82C586 and 82C596 variants are affected. */ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_isa_dma_hangs); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596, quirk_isa_dma_hangs); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, quirk_isa_dma_hangs); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, quirk_isa_dma_hangs); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_1, quirk_isa_dma_hangs); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs); /* * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear * for some HT machines to use C4 w/o hanging. */ static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev) { u32 pmbase; u16 pm1a; pci_read_config_dword(dev, 0x40, &pmbase); pmbase = pmbase & 0xff80; pm1a = inw(pmbase); if (pm1a & 0x10) { dev_info(&dev->dev, FW_BUG "TigerPoint LPC.BM_STS cleared\n"); outw(0x10, pmbase); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts); /* * Chipsets where PCI->PCI transfers vanish or hang */ static void __devinit quirk_nopcipci(struct pci_dev *dev) { if ((pci_pci_problems & PCIPCI_FAIL)==0) { dev_info(&dev->dev, "Disabling direct PCI/PCI transfers\n"); pci_pci_problems |= PCIPCI_FAIL; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, quirk_nopcipci); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, quirk_nopcipci); static void __devinit quirk_nopciamd(struct pci_dev *dev) { u8 rev; pci_read_config_byte(dev, 0x08, &rev); if (rev == 0x13) { /* Erratum 24 */ dev_info(&dev->dev, "Chipset erratum: Disabling direct PCI/AGP transfers\n"); pci_pci_problems |= PCIAGP_FAIL; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8151_0, quirk_nopciamd); /* * Triton requires workarounds to be used by the drivers */ static void __devinit quirk_triton(struct pci_dev *dev) { if ((pci_pci_problems&PCIPCI_TRITON)==0) { dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n"); pci_pci_problems |= PCIPCI_TRITON; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437, quirk_triton); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437VX, quirk_triton); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82439, quirk_triton); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82439TX, quirk_triton); /* * VIA Apollo KT133 needs PCI latency patch * Made according to a windows driver based patch by George E. Breese * see PCI Latency Adjust on http://www.viahardware.com/download/viatweak.shtm * Also see http://www.au-ja.org/review-kt133a-1-en.phtml for * the info on which Mr Breese based his work. * * Updated based on further information from the site and also on * information provided by VIA */ static void quirk_vialatency(struct pci_dev *dev) { struct pci_dev *p; u8 busarb; /* Ok we have a potential problem chipset here. Now see if we have a buggy southbridge */ p = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, NULL); if (p!=NULL) { /* 0x40 - 0x4f == 686B, 0x10 - 0x2f == 686A; thanks Dan Hollis */ /* Check for buggy part revisions */ if (p->revision < 0x40 || p->revision > 0x42) goto exit; } else { p = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL); if (p==NULL) /* No problem parts */ goto exit; /* Check for buggy part revisions */ if (p->revision < 0x10 || p->revision > 0x12) goto exit; } /* * Ok we have the problem. Now set the PCI master grant to * occur every master grant. The apparent bug is that under high * PCI load (quite common in Linux of course) you can get data * loss when the CPU is held off the bus for 3 bus master requests * This happens to include the IDE controllers.... * * VIA only apply this fix when an SB Live! is present but under * both Linux and Windows this isnt enough, and we have seen * corruption without SB Live! but with things like 3 UDMA IDE * controllers. So we ignore that bit of the VIA recommendation.. */ pci_read_config_byte(dev, 0x76, &busarb); /* Set bit 4 and bi 5 of byte 76 to 0x01 "Master priority rotation on every PCI master grant */ busarb &= ~(1<<5); busarb |= (1<<4); pci_write_config_byte(dev, 0x76, busarb); dev_info(&dev->dev, "Applying VIA southbridge workaround\n"); exit: pci_dev_put(p); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, quirk_vialatency); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8371_1, quirk_vialatency); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8361, quirk_vialatency); /* Must restore this on a resume from RAM */ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, quirk_vialatency); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8371_1, quirk_vialatency); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8361, quirk_vialatency); /* * VIA Apollo VP3 needs ETBF on BT848/878 */ static void __devinit quirk_viaetbf(struct pci_dev *dev) { if ((pci_pci_problems&PCIPCI_VIAETBF)==0) { dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n"); pci_pci_problems |= PCIPCI_VIAETBF; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_viaetbf); static void __devinit quirk_vsfx(struct pci_dev *dev) { if ((pci_pci_problems&PCIPCI_VSFX)==0) { dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n"); pci_pci_problems |= PCIPCI_VSFX; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576, quirk_vsfx); /* * Ali Magik requires workarounds to be used by the drivers * that DMA to AGP space. Latency must be set to 0xA and triton * workaround applied too * [Info kindly provided by ALi] */ static void __init quirk_alimagik(struct pci_dev *dev) { if ((pci_pci_problems&PCIPCI_ALIMAGIK)==0) { dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n"); pci_pci_problems |= PCIPCI_ALIMAGIK|PCIPCI_TRITON; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1647, quirk_alimagik); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1651, quirk_alimagik); /* * Natoma has some interesting boundary conditions with Zoran stuff * at least */ static void __devinit quirk_natoma(struct pci_dev *dev) { if ((pci_pci_problems&PCIPCI_NATOMA)==0) { dev_info(&dev->dev, "Limiting direct PCI/PCI transfers\n"); pci_pci_problems |= PCIPCI_NATOMA; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_natoma); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443LX_0, quirk_natoma); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443LX_1, quirk_natoma); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_0, quirk_natoma); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_1, quirk_natoma); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2, quirk_natoma); /* * This chip can cause PCI parity errors if config register 0xA0 is read * while DMAs are occurring. */ static void __devinit quirk_citrine(struct pci_dev *dev) { dev->cfg_size = 0xA0; } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, quirk_citrine); /* * S3 868 and 968 chips report region size equal to 32M, but they decode 64M. * If it's needed, re-allocate the region. */ static void __devinit quirk_s3_64M(struct pci_dev *dev) { struct resource *r = &dev->resource[0]; if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) { r->start = 0; r->end = 0x3ffffff; } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_868, quirk_s3_64M); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_968, quirk_s3_64M); static void __devinit quirk_io_region(struct pci_dev *dev, unsigned region, unsigned size, int nr, const char *name) { region &= ~(size-1); if (region) { struct pci_bus_region bus_region; struct resource *res = dev->resource + nr; res->name = pci_name(dev); res->start = region; res->end = region + size - 1; res->flags = IORESOURCE_IO; /* Convert from PCI bus to resource space. */ bus_region.start = res->start; bus_region.end = res->end; pcibios_bus_to_resource(dev, res, &bus_region); pci_claim_resource(dev, nr); dev_info(&dev->dev, "quirk: region %04x-%04x claimed by %s\n", region, region + size - 1, name); } } /* * ATI Northbridge setups MCE the processor if you even * read somewhere between 0x3b0->0x3bb or read 0x3d3 */ static void __devinit quirk_ati_exploding_mce(struct pci_dev *dev) { dev_info(&dev->dev, "ATI Northbridge, reserving I/O ports 0x3b0 to 0x3bb\n"); /* Mae rhaid i ni beidio ag edrych ar y lleoliadiau I/O hyn */ request_region(0x3b0, 0x0C, "RadeonIGP"); request_region(0x3d3, 0x01, "RadeonIGP"); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100, quirk_ati_exploding_mce); /* * Let's make the southbridge information explicit instead * of having to worry about people probing the ACPI areas, * for example.. (Yes, it happens, and if you read the wrong * ACPI register it will put the machine to sleep with no * way of waking it up again. Bummer). * * ALI M7101: Two IO regions pointed to by words at * 0xE0 (64 bytes of ACPI registers) * 0xE2 (32 bytes of SMB registers) */ static void __devinit quirk_ali7101_acpi(struct pci_dev *dev) { u16 region; pci_read_config_word(dev, 0xE0, &region); quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES, "ali7101 ACPI"); pci_read_config_word(dev, 0xE2, &region); quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1, "ali7101 SMB"); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, quirk_ali7101_acpi); static void piix4_io_quirk(struct pci_dev *dev, const char *name, unsigned int port, unsigned int enable) { u32 devres; u32 mask, size, base; pci_read_config_dword(dev, port, &devres); if ((devres & enable) != enable) return; mask = (devres >> 16) & 15; base = devres & 0xffff; size = 16; for (;;) { unsigned bit = size >> 1; if ((bit & mask) == bit) break; size = bit; } /* * For now we only print it out. Eventually we'll want to * reserve it (at least if it's in the 0x1000+ range), but * let's get enough confirmation reports first. */ base &= -size; dev_info(&dev->dev, "%s PIO at %04x-%04x\n", name, base, base + size - 1); } static void piix4_mem_quirk(struct pci_dev *dev, const char *name, unsigned int port, unsigned int enable) { u32 devres; u32 mask, size, base; pci_read_config_dword(dev, port, &devres); if ((devres & enable) != enable) return; base = devres & 0xffff0000; mask = (devres & 0x3f) << 16; size = 128 << 16; for (;;) { unsigned bit = size >> 1; if ((bit & mask) == bit) break; size = bit; } /* * For now we only print it out. Eventually we'll want to * reserve it, but let's get enough confirmation reports first. */ base &= -size; dev_info(&dev->dev, "%s MMIO at %04x-%04x\n", name, base, base + size - 1); } /* * PIIX4 ACPI: Two IO regions pointed to by longwords at * 0x40 (64 bytes of ACPI registers) * 0x90 (16 bytes of SMB registers) * and a few strange programmable PIIX4 device resources. */ static void __devinit quirk_piix4_acpi(struct pci_dev *dev) { u32 region, res_a; pci_read_config_dword(dev, 0x40, &region); quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES, "PIIX4 ACPI"); pci_read_config_dword(dev, 0x90, &region); quirk_io_region(dev, region, 16, PCI_BRIDGE_RESOURCES+1, "PIIX4 SMB"); /* Device resource A has enables for some of the other ones */ pci_read_config_dword(dev, 0x5c, &res_a); piix4_io_quirk(dev, "PIIX4 devres B", 0x60, 3 << 21); piix4_io_quirk(dev, "PIIX4 devres C", 0x64, 3 << 21); /* Device resource D is just bitfields for static resources */ /* Device 12 enabled? */ if (res_a & (1 << 29)) { piix4_io_quirk(dev, "PIIX4 devres E", 0x68, 1 << 20); piix4_mem_quirk(dev, "PIIX4 devres F", 0x6c, 1 << 7); } /* Device 13 enabled? */ if (res_a & (1 << 30)) { piix4_io_quirk(dev, "PIIX4 devres G", 0x70, 1 << 20); piix4_mem_quirk(dev, "PIIX4 devres H", 0x74, 1 << 7); } piix4_io_quirk(dev, "PIIX4 devres I", 0x78, 1 << 20); piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3, quirk_piix4_acpi); /* * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at * 0x40 (128 bytes of ACPI, GPIO & TCO registers) * 0x58 (64 bytes of GPIO I/O space) */ static void __devinit quirk_ich4_lpc_acpi(struct pci_dev *dev) { u32 region; pci_read_config_dword(dev, 0x40, &region); quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH4 ACPI/GPIO/TCO"); pci_read_config_dword(dev, 0x58, &region); quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH4 GPIO"); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, quirk_ich4_lpc_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, quirk_ich4_lpc_acpi); static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev) { u32 region; pci_read_config_dword(dev, 0x40, &region); quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH6 ACPI/GPIO/TCO"); pci_read_config_dword(dev, 0x48, &region); quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO"); } static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize) { u32 val; u32 size, base; pci_read_config_dword(dev, reg, &val); /* Enabled? */ if (!(val & 1)) return; base = val & 0xfffc; if (dynsize) { /* * This is not correct. It is 16, 32 or 64 bytes depending on * register D31:F0:ADh bits 5:4. * * But this gets us at least _part_ of it. */ size = 16; } else { size = 128; } base &= ~(size-1); /* Just print it out for now. We should reserve it after more debugging */ dev_info(&dev->dev, "%s PIO at %04x-%04x\n", name, base, base+size-1); } static void __devinit quirk_ich6_lpc(struct pci_dev *dev) { /* Shared ACPI/GPIO decode with all ICH6+ */ ich6_lpc_acpi_gpio(dev); /* ICH6-specific generic IO decode */ ich6_lpc_generic_decode(dev, 0x84, "LPC Generic IO decode 1", 0); ich6_lpc_generic_decode(dev, 0x88, "LPC Generic IO decode 2", 1); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc); static void __devinit ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name) { u32 val; u32 mask, base; pci_read_config_dword(dev, reg, &val); /* Enabled? */ if (!(val & 1)) return; /* * IO base in bits 15:2, mask in bits 23:18, both * are dword-based */ base = val & 0xfffc; mask = (val >> 16) & 0xfc; mask |= 3; /* Just print it out for now. We should reserve it after more debugging */ dev_info(&dev->dev, "%s PIO at %04x (mask %04x)\n", name, base, mask); } /* ICH7-10 has the same common LPC generic IO decode registers */ static void __devinit quirk_ich7_lpc(struct pci_dev *dev) { /* We share the common ACPI/DPIO decode with ICH6 */ ich6_lpc_acpi_gpio(dev); /* And have 4 ICH7+ generic decodes */ ich7_lpc_generic_decode(dev, 0x84, "ICH7 LPC Generic IO decode 1"); ich7_lpc_generic_decode(dev, 0x88, "ICH7 LPC Generic IO decode 2"); ich7_lpc_generic_decode(dev, 0x8c, "ICH7 LPC Generic IO decode 3"); ich7_lpc_generic_decode(dev, 0x90, "ICH7 LPC Generic IO decode 4"); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_4, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_8, quirk_ich7_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_1, quirk_ich7_lpc); /* * VIA ACPI: One IO region pointed to by longword at * 0x48 or 0x20 (256 bytes of ACPI registers) */ static void __devinit quirk_vt82c586_acpi(struct pci_dev *dev) { u32 region; if (dev->revision & 0x10) { pci_read_config_dword(dev, 0x48, &region); region &= PCI_BASE_ADDRESS_IO_MASK; quirk_io_region(dev, region, 256, PCI_BRIDGE_RESOURCES, "vt82c586 ACPI"); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_vt82c586_acpi); /* * VIA VT82C686 ACPI: Three IO region pointed to by (long)words at * 0x48 (256 bytes of ACPI registers) * 0x70 (128 bytes of hardware monitoring register) * 0x90 (16 bytes of SMB registers) */ static void __devinit quirk_vt82c686_acpi(struct pci_dev *dev) { u16 hm; u32 smb; quirk_vt82c586_acpi(dev); pci_read_config_word(dev, 0x70, &hm); hm &= PCI_BASE_ADDRESS_IO_MASK; quirk_io_region(dev, hm, 128, PCI_BRIDGE_RESOURCES + 1, "vt82c686 HW-mon"); pci_read_config_dword(dev, 0x90, &smb); smb &= PCI_BASE_ADDRESS_IO_MASK; quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 2, "vt82c686 SMB"); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi); /* * VIA VT8235 ISA Bridge: Two IO regions pointed to by words at * 0x88 (128 bytes of power management registers) * 0xd0 (16 bytes of SMB registers) */ static void __devinit quirk_vt8235_acpi(struct pci_dev *dev) { u16 pm, smb; pci_read_config_word(dev, 0x88, &pm); pm &= PCI_BASE_ADDRESS_IO_MASK; quirk_io_region(dev, pm, 128, PCI_BRIDGE_RESOURCES, "vt8235 PM"); pci_read_config_word(dev, 0xd0, &smb); smb &= PCI_BASE_ADDRESS_IO_MASK; quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 1, "vt8235 SMB"); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi); /* * TI XIO2000a PCIe-PCI Bridge erroneously reports it supports fast back-to-back: * Disable fast back-to-back on the secondary bus segment */ static void __devinit quirk_xio2000a(struct pci_dev *dev) { struct pci_dev *pdev; u16 command; dev_warn(&dev->dev, "TI XIO2000a quirk detected; " "secondary bus fast back-to-back transfers disabled\n"); list_for_each_entry(pdev, &dev->subordinate->devices, bus_list) { pci_read_config_word(pdev, PCI_COMMAND, &command); if (command & PCI_COMMAND_FAST_BACK) pci_write_config_word(pdev, PCI_COMMAND, command & ~PCI_COMMAND_FAST_BACK); } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XIO2000A, quirk_xio2000a); #ifdef CONFIG_X86_IO_APIC #include <asm/io_apic.h> /* * VIA 686A/B: If an IO-APIC is active, we need to route all on-chip * devices to the external APIC. * * TODO: When we have device-specific interrupt routers, * this code will go away from quirks. */ static void quirk_via_ioapic(struct pci_dev *dev) { u8 tmp; if (nr_ioapics < 1) tmp = 0; /* nothing routed to external APIC */ else tmp = 0x1f; /* all known bits (4-0) routed to external APIC */ dev_info(&dev->dev, "%sbling VIA external APIC routing\n", tmp == 0 ? "Disa" : "Ena"); /* Offset 0x58: External APIC IRQ output control */ pci_write_config_byte (dev, 0x58, tmp); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_ioapic); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_ioapic); /* * VIA 8237: Some BIOSs don't set the 'Bypass APIC De-Assert Message' Bit. * This leads to doubled level interrupt rates. * Set this bit to get rid of cycle wastage. * Otherwise uncritical. */ static void quirk_via_vt8237_bypass_apic_deassert(struct pci_dev *dev) { u8 misc_control2; #define BYPASS_APIC_DEASSERT 8 pci_read_config_byte(dev, 0x5B, &misc_control2); if (!(misc_control2 & BYPASS_APIC_DEASSERT)) { dev_info(&dev->dev, "Bypassing VIA 8237 APIC De-Assert Message\n"); pci_write_config_byte(dev, 0x5B, misc_control2|BYPASS_APIC_DEASSERT); } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_vt8237_bypass_apic_deassert); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_vt8237_bypass_apic_deassert); /* * The AMD io apic can hang the box when an apic irq is masked. * We check all revs >= B0 (yet not in the pre production!) as the bug * is currently marked NoFix * * We have multiple reports of hangs with this chipset that went away with * noapic specified. For the moment we assume it's the erratum. We may be wrong * of course. However the advice is demonstrably good even if so.. */ static void __devinit quirk_amd_ioapic(struct pci_dev *dev) { if (dev->revision >= 0x02) { dev_warn(&dev->dev, "I/O APIC: AMD Erratum #22 may be present. In the event of instability try\n"); dev_warn(&dev->dev, " : booting with the \"noapic\" option\n"); } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7410, quirk_amd_ioapic); static void __init quirk_ioapic_rmw(struct pci_dev *dev) { if (dev->devfn == 0 && dev->bus->number == 0) sis_apic_bug = 1; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_ANY_ID, quirk_ioapic_rmw); #endif /* CONFIG_X86_IO_APIC */ /* * Some settings of MMRBC can lead to data corruption so block changes. * See AMD 8131 HyperTransport PCI-X Tunnel Revision Guide */ static void __init quirk_amd_8131_mmrbc(struct pci_dev *dev) { if (dev->subordinate && dev->revision <= 0x12) { dev_info(&dev->dev, "AMD8131 rev %x detected; " "disabling PCI-X MMRBC\n", dev->revision); dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MMRBC; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_amd_8131_mmrbc); /* * FIXME: it is questionable that quirk_via_acpi * is needed. It shows up as an ISA bridge, and does not * support the PCI_INTERRUPT_LINE register at all. Therefore * it seems like setting the pci_dev's 'irq' to the * value of the ACPI SCI interrupt is only done for convenience. * -jgarzik */ static void __devinit quirk_via_acpi(struct pci_dev *d) { /* * VIA ACPI device: SCI IRQ line in PCI config byte 0x42 */ u8 irq; pci_read_config_byte(d, 0x42, &irq); irq &= 0xf; if (irq && (irq != 2)) d->irq = irq; } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi); /* * VIA bridges which have VLink */ static int via_vlink_dev_lo = -1, via_vlink_dev_hi = 18; static void quirk_via_bridge(struct pci_dev *dev) { /* See what bridge we have and find the device ranges */ switch (dev->device) { case PCI_DEVICE_ID_VIA_82C686: /* The VT82C686 is special, it attaches to PCI and can have any device number. All its subdevices are functions of that single device. */ via_vlink_dev_lo = PCI_SLOT(dev->devfn); via_vlink_dev_hi = PCI_SLOT(dev->devfn); break; case PCI_DEVICE_ID_VIA_8237: case PCI_DEVICE_ID_VIA_8237A: via_vlink_dev_lo = 15; break; case PCI_DEVICE_ID_VIA_8235: via_vlink_dev_lo = 16; break; case PCI_DEVICE_ID_VIA_8231: case PCI_DEVICE_ID_VIA_8233_0: case PCI_DEVICE_ID_VIA_8233A: case PCI_DEVICE_ID_VIA_8233C_0: via_vlink_dev_lo = 17; break; } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_bridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, quirk_via_bridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_0, quirk_via_bridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233A, quirk_via_bridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233C_0, quirk_via_bridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_bridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_bridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237A, quirk_via_bridge); /** * quirk_via_vlink - VIA VLink IRQ number update * @dev: PCI device * * If the device we are dealing with is on a PIC IRQ we need to * ensure that the IRQ line register which usually is not relevant * for PCI cards, is actually written so that interrupts get sent * to the right place. * We only do this on systems where a VIA south bridge was detected, * and only for VIA devices on the motherboard (see quirk_via_bridge * above). */ static void quirk_via_vlink(struct pci_dev *dev) { u8 irq, new_irq; /* Check if we have VLink at all */ if (via_vlink_dev_lo == -1) return; new_irq = dev->irq; /* Don't quirk interrupts outside the legacy IRQ range */ if (!new_irq || new_irq > 15) return; /* Internal device ? */ if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > via_vlink_dev_hi || PCI_SLOT(dev->devfn) < via_vlink_dev_lo) return; /* This is an internal VLink device on a PIC interrupt. The BIOS ought to have set this but may not have, so we redo it */ pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); if (new_irq != irq) { dev_info(&dev->dev, "VIA VLink IRQ fixup, from %d to %d\n", irq, new_irq); udelay(15); /* unknown if delay really needed */ pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq); } } DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_vlink); /* * VIA VT82C598 has its device ID settable and many BIOSes * set it to the ID of VT82C597 for backward compatibility. * We need to switch it off to be able to recognize the real * type of the chip. */ static void __devinit quirk_vt82c598_id(struct pci_dev *dev) { pci_write_config_byte(dev, 0xfc, 0); pci_read_config_word(dev, PCI_DEVICE_ID, &dev->device); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id); /* * CardBus controllers have a legacy base address that enables them * to respond as i82365 pcmcia controllers. We don't want them to * do this even if the Linux CardBus driver is not loaded, because * the Linux i82365 driver does not (and should not) handle CardBus. */ static void quirk_cardbus_legacy(struct pci_dev *dev) { if ((PCI_CLASS_BRIDGE_CARDBUS << 8) ^ dev->class) return; pci_write_config_dword(dev, PCI_CB_LEGACY_MODE_BASE, 0); } DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_cardbus_legacy); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_ANY_ID, PCI_ANY_ID, quirk_cardbus_legacy); /* * Following the PCI ordering rules is optional on the AMD762. I'm not * sure what the designers were smoking but let's not inhale... * * To be fair to AMD, it follows the spec by default, its BIOS people * who turn it off! */ static void quirk_amd_ordering(struct pci_dev *dev) { u32 pcic; pci_read_config_dword(dev, 0x4C, &pcic); if ((pcic&6)!=6) { pcic |= 6; dev_warn(&dev->dev, "BIOS failed to enable PCI standards compliance; fixing this error\n"); pci_write_config_dword(dev, 0x4C, pcic); pci_read_config_dword(dev, 0x84, &pcic); pcic |= (1<<23); /* Required in this mode */ pci_write_config_dword(dev, 0x84, pcic); } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_700C, quirk_amd_ordering); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_700C, quirk_amd_ordering); /* * DreamWorks provided workaround for Dunord I-3000 problem * * This card decodes and responds to addresses not apparently * assigned to it. We force a larger allocation to ensure that * nothing gets put too close to it. */ static void __devinit quirk_dunord ( struct pci_dev * dev ) { struct resource *r = &dev->resource [1]; r->start = 0; r->end = 0xffffff; } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_DUNORD, PCI_DEVICE_ID_DUNORD_I3000, quirk_dunord); /* * i82380FB mobile docking controller: its PCI-to-PCI bridge * is subtractive decoding (transparent), and does indicate this * in the ProgIf. Unfortunately, the ProgIf value is wrong - 0x80 * instead of 0x01. */ static void __devinit quirk_transparent_bridge(struct pci_dev *dev) { dev->transparent = 1; } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82380FB, quirk_transparent_bridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TOSHIBA, 0x605, quirk_transparent_bridge); /* * Common misconfiguration of the MediaGX/Geode PCI master that will * reduce PCI bandwidth from 70MB/s to 25MB/s. See the GXM/GXLV/GX1 * datasheets found at http://www.national.com/ds/GX for info on what * these bits do. <christer@weinigel.se> */ static void quirk_mediagx_master(struct pci_dev *dev) { u8 reg; pci_read_config_byte(dev, 0x41, &reg); if (reg & 2) { reg &= ~2; dev_info(&dev->dev, "Fixup for MediaGX/Geode Slave Disconnect Boundary (0x41=0x%02x)\n", reg); pci_write_config_byte(dev, 0x41, reg); } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_PCI_MASTER, quirk_mediagx_master); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_PCI_MASTER, quirk_mediagx_master); /* * Ensure C0 rev restreaming is off. This is normally done by * the BIOS but in the odd case it is not the results are corruption * hence the presence of a Linux check */ static void quirk_disable_pxb(struct pci_dev *pdev) { u16 config; if (pdev->revision != 0x04) /* Only C0 requires this */ return; pci_read_config_word(pdev, 0x40, &config); if (config & (1<<6)) { config &= ~(1<<6); pci_write_config_word(pdev, 0x40, config); dev_info(&pdev->dev, "C0 revision 450NX. Disabling PCI restreaming\n"); } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb); static void __devinit quirk_amd_ide_mode(struct pci_dev *pdev) { /* set SBX00/Hudson-2 SATA in IDE mode to AHCI mode */ u8 tmp; pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); if (tmp == 0x01) { pci_read_config_byte(pdev, 0x40, &tmp); pci_write_config_byte(pdev, 0x40, tmp|1); pci_write_config_byte(pdev, 0x9, 1); pci_write_config_byte(pdev, 0xa, 6); pci_write_config_byte(pdev, 0x40, tmp); pdev->class = PCI_CLASS_STORAGE_SATA_AHCI; dev_info(&pdev->dev, "set SATA to AHCI mode\n"); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); /* * Serverworks CSB5 IDE does not fully support native mode */ static void __devinit quirk_svwks_csb5ide(struct pci_dev *pdev) { u8 prog; pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog); if (prog & 5) { prog &= ~5; pdev->class &= ~5; pci_write_config_byte(pdev, PCI_CLASS_PROG, prog); /* PCI layer will sort out resources */ } } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, quirk_svwks_csb5ide); /* * Intel 82801CAM ICH3-M datasheet says IDE modes must be the same */ static void __init quirk_ide_samemode(struct pci_dev *pdev) { u8 prog; pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog); if (((prog & 1) && !(prog & 4)) || ((prog & 4) && !(prog & 1))) { dev_info(&pdev->dev, "IDE mode mismatch; forcing legacy mode\n"); prog &= ~5; pdev->class &= ~5; pci_write_config_byte(pdev, PCI_CLASS_PROG, prog); } } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10, quirk_ide_samemode); /* * Some ATA devices break if put into D3 */ static void __devinit quirk_no_ata_d3(struct pci_dev *pdev) { /* Quirk the legacy ATA devices only. The AHCI ones are ok */ if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3; } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_ANY_ID, quirk_no_ata_d3); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, PCI_ANY_ID, quirk_no_ata_d3); /* ALi loses some register settings that we cannot then restore */ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, PCI_ANY_ID, quirk_no_ata_d3); /* VIA comes back fine but we need to keep it alive or ACPI GTM failures occur when mode detecting */ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_no_ata_d3); /* This was originally an Alpha specific thing, but it really fits here. * The i82375 PCI/EISA bridge appears as non-classified. Fix that. */ static void __init quirk_eisa_bridge(struct pci_dev *dev) { dev->class = PCI_CLASS_BRIDGE_EISA << 8; } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375, quirk_eisa_bridge); /* * On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge * is not activated. The myth is that Asus said that they do not want the * users to be irritated by just another PCI Device in the Win98 device * manager. (see the file prog/hotplug/README.p4b in the lm_sensors * package 2.7.0 for details) * * The SMBus PCI Device can be activated by setting a bit in the ICH LPC * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it * becomes necessary to do this tweak in two steps -- the chosen trigger * is either the Host bridge (preferred) or on-board VGA controller. * * Note that we used to unhide the SMBus that way on Toshiba laptops * (Satellite A40 and Tecra M2) but then found that the thermal management * was done by SMM code, which could cause unsynchronized concurrent * accesses to the SMBus registers, with potentially bad effects. Thus you * should be very careful when adding new entries: if SMM is accessing the * Intel SMBus, this is a very good reason to leave it hidden. * * Likewise, many recent laptops use ACPI for thermal management. If the * ACPI DSDT code accesses the SMBus, then Linux should not access it * natively, and keeping the SMBus hidden is the right thing to do. If you * are about to add an entry in the table below, please first disassemble * the DSDT and double-check that there is no code accessing the SMBus. */ static int asus_hides_smbus; static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) { if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB) switch(dev->subsystem_device) { case 0x8025: /* P4B-LX */ case 0x8070: /* P4B */ case 0x8088: /* P4B533 */ case 0x1626: /* L3C notebook */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) switch(dev->subsystem_device) { case 0x80b1: /* P4GE-V */ case 0x80b2: /* P4PE */ case 0x8093: /* P4B533-V */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82850_HB) switch(dev->subsystem_device) { case 0x8030: /* P4T533 */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_7205_0) switch (dev->subsystem_device) { case 0x8070: /* P4G8X Deluxe */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH) switch (dev->subsystem_device) { case 0x80c9: /* PU-DLS */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) switch (dev->subsystem_device) { case 0x1751: /* M2N notebook */ case 0x1821: /* M5N notebook */ case 0x1897: /* A6L notebook */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) switch (dev->subsystem_device) { case 0x184b: /* W1N notebook */ case 0x186a: /* M6Ne notebook */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) switch (dev->subsystem_device) { case 0x80f2: /* P4P800-X */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) switch (dev->subsystem_device) { case 0x1882: /* M6V notebook */ case 0x1977: /* A6VA notebook */ asus_hides_smbus = 1; } } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_HP)) { if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) switch(dev->subsystem_device) { case 0x088C: /* HP Compaq nc8000 */ case 0x0890: /* HP Compaq nc6000 */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) switch (dev->subsystem_device) { case 0x12bc: /* HP D330L */ case 0x12bd: /* HP D530 */ case 0x006a: /* HP Compaq nx9500 */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82875_HB) switch (dev->subsystem_device) { case 0x12bf: /* HP xw4100 */ asus_hides_smbus = 1; } } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) { if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) switch(dev->subsystem_device) { case 0xC00C: /* Samsung P35 notebook */ asus_hides_smbus = 1; } } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ)) { if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) switch(dev->subsystem_device) { case 0x0058: /* Compaq Evo N620c */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82810_IG3) switch(dev->subsystem_device) { case 0xB16C: /* Compaq Deskpro EP 401963-001 (PCA# 010174) */ /* Motherboard doesn't have Host bridge * subvendor/subdevice IDs, therefore checking * its on-board VGA controller */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82801DB_2) switch(dev->subsystem_device) { case 0x00b8: /* Compaq Evo D510 CMT */ case 0x00b9: /* Compaq Evo D510 SFF */ case 0x00ba: /* Compaq Evo D510 USDT */ /* Motherboard doesn't have Host bridge * subvendor/subdevice IDs and on-board VGA * controller is disabled if an AGP card is * inserted, therefore checking USB UHCI * Controller #1 */ asus_hides_smbus = 1; } else if (dev->device == PCI_DEVICE_ID_INTEL_82815_CGC) switch (dev->subsystem_device) { case 0x001A: /* Compaq Deskpro EN SSF P667 815E */ /* Motherboard doesn't have host bridge * subvendor/subdevice IDs, therefore checking * its on-board VGA controller */ asus_hides_smbus = 1; } } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845_HB, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845G_HB, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82850_HB, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865_HB, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82875_HB, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_7205_0, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7501_MCH, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_2, asus_hides_smbus_hostbridge); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82815_CGC, asus_hides_smbus_hostbridge); static void asus_hides_smbus_lpc(struct pci_dev *dev) { u16 val; if (likely(!asus_hides_smbus)) return; pci_read_config_word(dev, 0xF2, &val); if (val & 0x8) { pci_write_config_word(dev, 0xF2, val & (~0x8)); pci_read_config_word(dev, 0xF2, &val); if (val & 0x8) dev_info(&dev->dev, "i801 SMBus device continues to play 'hide and seek'! 0x%x\n", val); else dev_info(&dev->dev, "Enabled i801 SMBus device\n"); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc); /* It appears we just have one such device. If not, we have a warning */ static void __iomem *asus_rcba_base; static void asus_hides_smbus_lpc_ich6_suspend(struct pci_dev *dev) { u32 rcba; if (likely(!asus_hides_smbus)) return; WARN_ON(asus_rcba_base); pci_read_config_dword(dev, 0xF0, &rcba); /* use bits 31:14, 16 kB aligned */ asus_rcba_base = ioremap_nocache(rcba & 0xFFFFC000, 0x4000); if (asus_rcba_base == NULL) return; } static void asus_hides_smbus_lpc_ich6_resume_early(struct pci_dev *dev) { u32 val; if (likely(!asus_hides_smbus || !asus_rcba_base)) return; /* read the Function Disable register, dword mode only */ val = readl(asus_rcba_base + 0x3418); writel(val & 0xFFFFFFF7, asus_rcba_base + 0x3418); /* enable the SMBus device */ } static void asus_hides_smbus_lpc_ich6_resume(struct pci_dev *dev) { if (likely(!asus_hides_smbus || !asus_rcba_base)) return; iounmap(asus_rcba_base); asus_rcba_base = NULL; dev_info(&dev->dev, "Enabled ICH6/i801 SMBus device\n"); } static void asus_hides_smbus_lpc_ich6(struct pci_dev *dev) { asus_hides_smbus_lpc_ich6_suspend(dev); asus_hides_smbus_lpc_ich6_resume_early(dev); asus_hides_smbus_lpc_ich6_resume(dev); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc_ich6); DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc_ich6_suspend); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc_ich6_resume); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc_ich6_resume_early); /* * SiS 96x south bridge: BIOS typically hides SMBus device... */ static void quirk_sis_96x_smbus(struct pci_dev *dev) { u8 val = 0; pci_read_config_byte(dev, 0x77, &val); if (val & 0x10) { dev_info(&dev->dev, "Enabling SiS 96x SMBus\n"); pci_write_config_byte(dev, 0x77, val & ~0x10); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_961, quirk_sis_96x_smbus); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_smbus); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_961, quirk_sis_96x_smbus); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_smbus); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus); /* * ... This is further complicated by the fact that some SiS96x south * bridges pretend to be 85C503/5513 instead. In that case see if we * spotted a compatible north bridge to make sure. * (pci_find_device doesn't work yet) * * We can also enable the sis96x bit in the discovery register.. */ #define SIS_DETECT_REGISTER 0x40 static void quirk_sis_503(struct pci_dev *dev) { u8 reg; u16 devid; pci_read_config_byte(dev, SIS_DETECT_REGISTER, &reg); pci_write_config_byte(dev, SIS_DETECT_REGISTER, reg | (1 << 6)); pci_read_config_word(dev, PCI_DEVICE_ID, &devid); if (((devid & 0xfff0) != 0x0960) && (devid != 0x0018)) { pci_write_config_byte(dev, SIS_DETECT_REGISTER, reg); return; } /* * Ok, it now shows up as a 96x.. run the 96x quirk by * hand in case it has already been processed. * (depends on link order, which is apparently not guaranteed) */ dev->device = devid; quirk_sis_96x_smbus(dev); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, quirk_sis_503); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, quirk_sis_503); /* * On ASUS A8V and A8V Deluxe boards, the onboard AC97 audio controller * and MC97 modem controller are disabled when a second PCI soundcard is * present. This patch, tweaking the VT8237 ISA bridge, enables them. * -- bjd */ static void asus_hides_ac97_lpc(struct pci_dev *dev) { u8 val; int asus_hides_ac97 = 0; if (likely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { if (dev->device == PCI_DEVICE_ID_VIA_8237) asus_hides_ac97 = 1; } if (!asus_hides_ac97) return; pci_read_config_byte(dev, 0x50, &val); if (val & 0xc0) { pci_write_config_byte(dev, 0x50, val & (~0xc0)); pci_read_config_byte(dev, 0x50, &val); if (val & 0xc0) dev_info(&dev->dev, "Onboard AC97/MC97 devices continue to play 'hide and seek'! 0x%x\n", val); else dev_info(&dev->dev, "Enabled onboard AC97/MC97 devices\n"); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, asus_hides_ac97_lpc); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, asus_hides_ac97_lpc); #if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE) /* * If we are using libata we can drive this chip properly but must * do this early on to make the additional device appear during * the PCI scanning. */ static void quirk_jmicron_ata(struct pci_dev *pdev) { u32 conf1, conf5, class; u8 hdr; /* Only poke fn 0 */ if (PCI_FUNC(pdev->devfn)) return; pci_read_config_dword(pdev, 0x40, &conf1); pci_read_config_dword(pdev, 0x80, &conf5); conf1 &= ~0x00CFF302; /* Clear bit 1, 8, 9, 12-19, 22, 23 */ conf5 &= ~(1 << 24); /* Clear bit 24 */ switch (pdev->device) { case PCI_DEVICE_ID_JMICRON_JMB360: /* SATA single port */ case PCI_DEVICE_ID_JMICRON_JMB362: /* SATA dual ports */ /* The controller should be in single function ahci mode */ conf1 |= 0x0002A100; /* Set 8, 13, 15, 17 */ break; case PCI_DEVICE_ID_JMICRON_JMB365: case PCI_DEVICE_ID_JMICRON_JMB366: /* Redirect IDE second PATA port to the right spot */ conf5 |= (1 << 24); /* Fall through */ case PCI_DEVICE_ID_JMICRON_JMB361: case PCI_DEVICE_ID_JMICRON_JMB363: /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ /* Set the class codes correctly and then direct IDE 0 */ conf1 |= 0x00C2A1B3; /* Set 0, 1, 4, 5, 7, 8, 13, 15, 17, 22, 23 */ break; case PCI_DEVICE_ID_JMICRON_JMB368: /* The controller should be in single function IDE mode */ conf1 |= 0x00C00000; /* Set 22, 23 */ break; } pci_write_config_dword(pdev, 0x40, conf1); pci_write_config_dword(pdev, 0x80, conf5); /* Update pdev accordingly */ pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr); pdev->hdr_type = hdr & 0x7f; pdev->multifunction = !!(hdr & 0x80); pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class); pdev->class = class >> 8; } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, quirk_jmicron_ata); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, quirk_jmicron_ata); #endif #ifdef CONFIG_X86_IO_APIC static void __init quirk_alder_ioapic(struct pci_dev *pdev) { int i; if ((pdev->class >> 8) != 0xff00) return; /* the first BAR is the location of the IO APIC...we must * not touch this (and it's already covered by the fixmap), so * forcibly insert it into the resource tree */ if (pci_resource_start(pdev, 0) && pci_resource_len(pdev, 0)) insert_resource(&iomem_resource, &pdev->resource[0]); /* The next five BARs all seem to be rubbish, so just clean * them out */ for (i=1; i < 6; i++) { memset(&pdev->resource[i], 0, sizeof(pdev->resource[i])); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic); #endif static void __devinit quirk_pcie_mch(struct pci_dev *pdev) { pci_msi_off(pdev); pdev->no_msi = 1; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, quirk_pcie_mch); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_pcie_mch); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_pcie_mch); /* * It's possible for the MSI to get corrupted if shpc and acpi * are used together on certain PXH-based systems. */ static void __devinit quirk_pcie_pxh(struct pci_dev *dev) { pci_msi_off(dev); dev->no_msi = 1; dev_warn(&dev->dev, "PXH quirk detected; SHPC device MSI disabled\n"); } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHD_0, quirk_pcie_pxh); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHD_1, quirk_pcie_pxh); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pcie_pxh); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); /* * Some Intel PCI Express chipsets have trouble with downstream * device power management. */ static void quirk_intel_pcie_pm(struct pci_dev * dev) { pci_pm_d3_delay = 120; dev->no_d1d2 = 1; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e2, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e3, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e4, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e5, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e6, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e7, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f7, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f8, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f9, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25fa, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2601, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2602, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2603, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2604, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2605, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2606, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2607, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2608, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); #ifdef CONFIG_X86_IO_APIC /* * Boot interrupts on some chipsets cannot be turned off. For these chipsets, * remap the original interrupt in the linux kernel to the boot interrupt, so * that a PCI device's interrupt handler is installed on the boot interrupt * line instead. */ static void quirk_reroute_to_boot_interrupts_intel(struct pci_dev *dev) { if (noioapicquirk || noioapicreroute) return; dev->irq_reroute_variant = INTEL_IRQ_REROUTE_VARIANT; dev_info(&dev->dev, "rerouting interrupts for [%04x:%04x]\n", dev->vendor, dev->device); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80333_0, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80333_1, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80332_0, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80332_1, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80333_0, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80333_1, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80332_0, quirk_reroute_to_boot_interrupts_intel); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80332_1, quirk_reroute_to_boot_interrupts_intel); /* * On some chipsets we can disable the generation of legacy INTx boot * interrupts. */ /* * IO-APIC1 on 6300ESB generates boot interrupts, see intel order no * 300641-004US, section 5.7.3. */ #define INTEL_6300_IOAPIC_ABAR 0x40 #define INTEL_6300_DISABLE_BOOT_IRQ (1<<14) static void quirk_disable_intel_boot_interrupt(struct pci_dev *dev) { u16 pci_config_word; if (noioapicquirk) return; pci_read_config_word(dev, INTEL_6300_IOAPIC_ABAR, &pci_config_word); pci_config_word |= INTEL_6300_DISABLE_BOOT_IRQ; pci_write_config_word(dev, INTEL_6300_IOAPIC_ABAR, pci_config_word); dev_info(&dev->dev, "disabled boot interrupts on device [%04x:%04x]\n", dev->vendor, dev->device); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_10, quirk_disable_intel_boot_interrupt); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_10, quirk_disable_intel_boot_interrupt); /* * disable boot interrupts on HT-1000 */ #define BC_HT1000_FEATURE_REG 0x64 #define BC_HT1000_PIC_REGS_ENABLE (1<<0) #define BC_HT1000_MAP_IDX 0xC00 #define BC_HT1000_MAP_DATA 0xC01 static void quirk_disable_broadcom_boot_interrupt(struct pci_dev *dev) { u32 pci_config_dword; u8 irq; if (noioapicquirk) return; pci_read_config_dword(dev, BC_HT1000_FEATURE_REG, &pci_config_dword); pci_write_config_dword(dev, BC_HT1000_FEATURE_REG, pci_config_dword | BC_HT1000_PIC_REGS_ENABLE); for (irq = 0x10; irq < 0x10 + 32; irq++) { outb(irq, BC_HT1000_MAP_IDX); outb(0x00, BC_HT1000_MAP_DATA); } pci_write_config_dword(dev, BC_HT1000_FEATURE_REG, pci_config_dword); dev_info(&dev->dev, "disabled boot interrupts on device [%04x:%04x]\n", dev->vendor, dev->device); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000SB, quirk_disable_broadcom_boot_interrupt); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000SB, quirk_disable_broadcom_boot_interrupt); /* * disable boot interrupts on AMD and ATI chipsets */ /* * NOIOAMODE needs to be disabled to disable "boot interrupts". For AMD 8131 * rev. A0 and B0, NOIOAMODE needs to be disabled anyway to fix IO-APIC mode * (due to an erratum). */ #define AMD_813X_MISC 0x40 #define AMD_813X_NOIOAMODE (1<<0) #define AMD_813X_REV_B2 0x13 static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev) { u32 pci_config_dword; if (noioapicquirk) return; if (dev->revision == AMD_813X_REV_B2) return; pci_read_config_dword(dev, AMD_813X_MISC, &pci_config_dword); pci_config_dword &= ~AMD_813X_NOIOAMODE; pci_write_config_dword(dev, AMD_813X_MISC, pci_config_dword); dev_info(&dev->dev, "disabled boot interrupts on device [%04x:%04x]\n", dev->vendor, dev->device); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_amd_813x_boot_interrupt); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE, quirk_disable_amd_813x_boot_interrupt); #define AMD_8111_PCI_IRQ_ROUTING 0x56 static void quirk_disable_amd_8111_boot_interrupt(struct pci_dev *dev) { u16 pci_config_word; if (noioapicquirk) return; pci_read_config_word(dev, AMD_8111_PCI_IRQ_ROUTING, &pci_config_word); if (!pci_config_word) { dev_info(&dev->dev, "boot interrupts on device [%04x:%04x] " "already disabled\n", dev->vendor, dev->device); return; } pci_write_config_word(dev, AMD_8111_PCI_IRQ_ROUTING, 0); dev_info(&dev->dev, "disabled boot interrupts on device [%04x:%04x]\n", dev->vendor, dev->device); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS, quirk_disable_amd_8111_boot_interrupt); DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS, quirk_disable_amd_8111_boot_interrupt); #endif /* CONFIG_X86_IO_APIC */ /* * Toshiba TC86C001 IDE controller reports the standard 8-byte BAR0 size * but the PIO transfers won't work if BAR0 falls at the odd 8 bytes. * Re-allocate the region if needed... */ static void __init quirk_tc86c001_ide(struct pci_dev *dev) { struct resource *r = &dev->resource[0]; if (r->start & 0x8) { r->start = 0; r->end = 0xf; } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE, quirk_tc86c001_ide); static void __devinit quirk_netmos(struct pci_dev *dev) { unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; unsigned int num_serial = dev->subsystem_device & 0xf; /* * These Netmos parts are multiport serial devices with optional * parallel ports. Even when parallel ports are present, they * are identified as class SERIAL, which means the serial driver * will claim them. To prevent this, mark them as class OTHER. * These combo devices should be claimed by parport_serial. * * The subdevice ID is of the form 0x00PS, where <P> is the number * of parallel ports and <S> is the number of serial ports. */ switch (dev->device) { case PCI_DEVICE_ID_NETMOS_9835: /* Well, this rule doesn't hold for the following 9835 device */ if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM && dev->subsystem_device == 0x0299) return; case PCI_DEVICE_ID_NETMOS_9735: case PCI_DEVICE_ID_NETMOS_9745: case PCI_DEVICE_ID_NETMOS_9845: case PCI_DEVICE_ID_NETMOS_9855: if ((dev->class >> 8) == PCI_CLASS_COMMUNICATION_SERIAL && num_parallel) { dev_info(&dev->dev, "Netmos %04x (%u parallel, " "%u serial); changing class SERIAL to OTHER " "(use parport_serial)\n", dev->device, num_parallel, num_serial); dev->class = (PCI_CLASS_COMMUNICATION_OTHER << 8) | (dev->class & 0xff); } } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos); static void __devinit quirk_e100_interrupt(struct pci_dev *dev) { u16 command, pmcsr; u8 __iomem *csr; u8 cmd_hi; int pm; switch (dev->device) { /* PCI IDs taken from drivers/net/e100.c */ case 0x1029: case 0x1030 ... 0x1034: case 0x1038 ... 0x103E: case 0x1050 ... 0x1057: case 0x1059: case 0x1064 ... 0x106B: case 0x1091 ... 0x1095: case 0x1209: case 0x1229: case 0x2449: case 0x2459: case 0x245D: case 0x27DC: break; default: return; } /* * Some firmware hands off the e100 with interrupts enabled, * which can cause a flood of interrupts if packets are * received before the driver attaches to the device. So * disable all e100 interrupts here. The driver will * re-enable them when it's ready. */ pci_read_config_word(dev, PCI_COMMAND, &command); if (!(command & PCI_COMMAND_MEMORY) || !pci_resource_start(dev, 0)) return; /* * Check that the device is in the D0 power state. If it's not, * there is no point to look any further. */ pm = pci_find_capability(dev, PCI_CAP_ID_PM); if (pm) { pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != PCI_D0) return; } /* Convert from PCI bus to resource space. */ csr = ioremap(pci_resource_start(dev, 0), 8); if (!csr) { dev_warn(&dev->dev, "Can't map e100 registers\n"); return; } cmd_hi = readb(csr + 3); if (cmd_hi == 0) { dev_warn(&dev->dev, "Firmware left e100 interrupts enabled; " "disabling\n"); writeb(1, csr + 3); } iounmap(csr); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt); /* * The 82575 and 82598 may experience data corruption issues when transitioning * out of L0S. To prevent this we need to disable L0S on the pci-e link */ static void __devinit quirk_disable_aspm_l0s(struct pci_dev *dev) { dev_info(&dev->dev, "Disabling L0s\n"); pci_disable_link_state(dev, PCIE_LINK_STATE_L0S); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10a7, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10a9, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10b6, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10c6, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10c7, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10c8, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10d6, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10db, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10dd, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10e1, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10ec, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f1, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f4, quirk_disable_aspm_l0s); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1508, quirk_disable_aspm_l0s); static void __devinit fixup_rev1_53c810(struct pci_dev* dev) { /* rev 1 ncr53c810 chips don't set the class at all which means * they don't get their resources remapped. Fix that here. */ if (dev->class == PCI_CLASS_NOT_DEFINED) { dev_info(&dev->dev, "NCR 53c810 rev 1 detected; setting PCI class\n"); dev->class = PCI_CLASS_STORAGE_SCSI; } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810); #endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */ #ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS /* Enable 1k I/O space granularity on the Intel P64H2 */ static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev) { u16 en1k; u8 io_base_lo, io_limit_lo; unsigned long base, limit; struct resource *res = dev->resource + PCI_BRIDGE_RESOURCES; pci_read_config_word(dev, 0x40, &en1k); if (en1k & 0x200) { dev_info(&dev->dev, "Enable I/O Space to 1KB granularity\n"); pci_read_config_byte(dev, PCI_IO_BASE, &io_base_lo); pci_read_config_byte(dev, PCI_IO_LIMIT, &io_limit_lo); base = (io_base_lo & (PCI_IO_RANGE_MASK | 0x0c)) << 8; limit = (io_limit_lo & (PCI_IO_RANGE_MASK | 0x0c)) << 8; if (base <= limit) { res->start = base; res->end = limit + 0x3ff; } } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io); /* Fix the IOBL_ADR for 1k I/O space granularity on the Intel P64H2 * The IOBL_ADR gets re-written to 4k boundaries in pci_setup_bridge() * in drivers/pci/setup-bus.c */ static void __devinit quirk_p64h2_1k_io_fix_iobl(struct pci_dev *dev) { u16 en1k, iobl_adr, iobl_adr_1k; struct resource *res = dev->resource + PCI_BRIDGE_RESOURCES; pci_read_config_word(dev, 0x40, &en1k); if (en1k & 0x200) { pci_read_config_word(dev, PCI_IO_BASE, &iobl_adr); iobl_adr_1k = iobl_adr | (res->start >> 8) | (res->end & 0xfc00); if (iobl_adr != iobl_adr_1k) { dev_info(&dev->dev, "Fixing P64H2 IOBL_ADR from 0x%x to 0x%x for 1KB granularity\n", iobl_adr,iobl_adr_1k); pci_write_config_word(dev, PCI_IO_BASE, iobl_adr_1k); } } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io_fix_iobl); /* Under some circumstances, AER is not linked with extended capabilities. * Force it to be linked by setting the corresponding control bit in the * config space. */ static void quirk_nvidia_ck804_pcie_aer_ext_cap(struct pci_dev *dev) { uint8_t b; if (pci_read_config_byte(dev, 0xf41, &b) == 0) { if (!(b & 0x20)) { pci_write_config_byte(dev, 0xf41, b | 0x20); dev_info(&dev->dev, "Linking AER extended capability\n"); } } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, quirk_nvidia_ck804_pcie_aer_ext_cap); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, quirk_nvidia_ck804_pcie_aer_ext_cap); static void __devinit quirk_via_cx700_pci_parking_caching(struct pci_dev *dev) { /* * Disable PCI Bus Parking and PCI Master read caching on CX700 * which causes unspecified timing errors with a VT6212L on the PCI * bus leading to USB2.0 packet loss. The defaults are that these * features are turned off but some BIOSes turn them on. */ uint8_t b; if (pci_read_config_byte(dev, 0x76, &b) == 0) { if (b & 0x40) { /* Turn off PCI Bus Parking */ pci_write_config_byte(dev, 0x76, b ^ 0x40); dev_info(&dev->dev, "Disabling VIA CX700 PCI parking\n"); } } if (pci_read_config_byte(dev, 0x72, &b) == 0) { if (b != 0) { /* Turn off PCI Master read caching */ pci_write_config_byte(dev, 0x72, 0x0); /* Set PCI Master Bus time-out to "1x16 PCLK" */ pci_write_config_byte(dev, 0x75, 0x1); /* Disable "Read FIFO Timer" */ pci_write_config_byte(dev, 0x77, 0x0); dev_info(&dev->dev, "Disabling VIA CX700 PCI caching\n"); } } } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_VIA, 0x324e, quirk_via_cx700_pci_parking_caching); /* * For Broadcom 5706, 5708, 5709 rev. A nics, any read beyond the * VPD end tag will hang the device. This problem was initially * observed when a vpd entry was created in sysfs * ('/sys/bus/pci/devices/<id>/vpd'). A read to this sysfs entry * will dump 32k of data. Reading a full 32k will cause an access * beyond the VPD end tag causing the device to hang. Once the device * is hung, the bnx2 driver will not be able to reset the device. * We believe that it is legal to read beyond the end tag and * therefore the solution is to limit the read/write length. */ static void __devinit quirk_brcm_570x_limit_vpd(struct pci_dev *dev) { /* * Only disable the VPD capability for 5706, 5706S, 5708, * 5708S and 5709 rev. A */ if ((dev->device == PCI_DEVICE_ID_NX2_5706) || (dev->device == PCI_DEVICE_ID_NX2_5706S) || (dev->device == PCI_DEVICE_ID_NX2_5708) || (dev->device == PCI_DEVICE_ID_NX2_5708S) || ((dev->device == PCI_DEVICE_ID_NX2_5709) && (dev->revision & 0xf0) == 0x0)) { if (dev->vpd) dev->vpd->len = 0x80; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5706, quirk_brcm_570x_limit_vpd); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5706S, quirk_brcm_570x_limit_vpd); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5708, quirk_brcm_570x_limit_vpd); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5708S, quirk_brcm_570x_limit_vpd); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5709, quirk_brcm_570x_limit_vpd); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5709S, quirk_brcm_570x_limit_vpd); /* Originally in EDAC sources for i82875P: * Intel tells BIOS developers to hide device 6 which * configures the overflow device access containing * the DRBs - this is where we expose device 6. * http://www.x86-secret.com/articles/tweak/pat/patsecrets-2.htm */ static void __devinit quirk_unhide_mch_dev6(struct pci_dev *dev) { u8 reg; if (pci_read_config_byte(dev, 0xF4, &reg) == 0 && !(reg & 0x02)) { dev_info(&dev->dev, "Enabling MCH 'Overflow' Device\n"); pci_write_config_byte(dev, 0xF4, reg | 0x02); } } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865_HB, quirk_unhide_mch_dev6); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82875_HB, quirk_unhide_mch_dev6); #ifdef CONFIG_PCI_MSI /* Some chipsets do not support MSI. We cannot easily rely on setting * PCI_BUS_FLAGS_NO_MSI in its bus flags because there are actually * some other busses controlled by the chipset even if Linux is not * aware of it. Instead of setting the flag on all busses in the * machine, simply disable MSI globally. */ static void __init quirk_disable_all_msi(struct pci_dev *dev) { pci_no_msi(); dev_warn(&dev->dev, "MSI quirk detected; MSI disabled\n"); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3336, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3364, quirk_disable_all_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8380_0, quirk_disable_all_msi); /* Disable MSI on chipsets that are known to not support it */ static void __devinit quirk_disable_msi(struct pci_dev *dev) { if (dev->subordinate) { dev_warn(&dev->dev, "MSI quirk detected; " "subordinate MSI disabled\n"); dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x5a3f, quirk_disable_msi); /* Go through the list of Hypertransport capabilities and * return 1 if a HT MSI capability is found and enabled */ static int __devinit msi_ht_cap_enabled(struct pci_dev *dev) { int pos, ttl = 48; pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); while (pos && ttl--) { u8 flags; if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, &flags) == 0) { dev_info(&dev->dev, "Found %s HT MSI Mapping\n", flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled"); return (flags & HT_MSI_FLAGS_ENABLE) != 0; } pos = pci_find_next_ht_capability(dev, pos, HT_CAPTYPE_MSI_MAPPING); } return 0; } /* Check the hypertransport MSI mapping to know whether MSI is enabled or not */ static void __devinit quirk_msi_ht_cap(struct pci_dev *dev) { if (dev->subordinate && !msi_ht_cap_enabled(dev)) { dev_warn(&dev->dev, "MSI quirk detected; " "subordinate MSI disabled\n"); dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; } } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE, quirk_msi_ht_cap); /* The nVidia CK804 chipset may have 2 HT MSI mappings. * MSI are supported if the MSI capability set in any of these mappings. */ static void __devinit quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev) { struct pci_dev *pdev; if (!dev->subordinate) return; /* check HT MSI cap on this chipset and the root one. * a single one having MSI is enough to be sure that MSI are supported. */ pdev = pci_get_slot(dev->bus, 0); if (!pdev) return; if (!msi_ht_cap_enabled(dev) && !msi_ht_cap_enabled(pdev)) { dev_warn(&dev->dev, "MSI quirk detected; " "subordinate MSI disabled\n"); dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; } pci_dev_put(pdev); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, quirk_nvidia_ck804_msi_ht_cap); /* Force enable MSI mapping capability on HT bridges */ static void __devinit ht_enable_msi_mapping(struct pci_dev *dev) { int pos, ttl = 48; pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); while (pos && ttl--) { u8 flags; if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, &flags) == 0) { dev_info(&dev->dev, "Enabling HT MSI Mapping\n"); pci_write_config_byte(dev, pos + HT_MSI_FLAGS, flags | HT_MSI_FLAGS_ENABLE); } pos = pci_find_next_ht_capability(dev, pos, HT_CAPTYPE_MSI_MAPPING); } } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, ht_enable_msi_mapping); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE, ht_enable_msi_mapping); /* The P5N32-SLI motherboards from Asus have a problem with msi * for the MCP55 NIC. It is not yet determined whether the msi problem * also affects other devices. As for now, turn off msi for this device. */ static void __devinit nvenet_msi_disable(struct pci_dev *dev) { if (dmi_name_in_vendors("P5N32-SLI PREMIUM") || dmi_name_in_vendors("P5N32-E SLI")) { dev_info(&dev->dev, "Disabling msi for MCP55 NIC on P5N32-SLI\n"); dev->no_msi = 1; } } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15, nvenet_msi_disable); static int __devinit ht_check_msi_mapping(struct pci_dev *dev) { int pos, ttl = 48; int found = 0; /* check if there is HT MSI cap or enabled on this device */ pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); while (pos && ttl--) { u8 flags; if (found < 1) found = 1; if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, &flags) == 0) { if (flags & HT_MSI_FLAGS_ENABLE) { if (found < 2) { found = 2; break; } } } pos = pci_find_next_ht_capability(dev, pos, HT_CAPTYPE_MSI_MAPPING); } return found; } static int __devinit host_bridge_with_leaf(struct pci_dev *host_bridge) { struct pci_dev *dev; int pos; int i, dev_no; int found = 0; dev_no = host_bridge->devfn >> 3; for (i = dev_no + 1; i < 0x20; i++) { dev = pci_get_slot(host_bridge->bus, PCI_DEVFN(i, 0)); if (!dev) continue; /* found next host bridge ?*/ pos = pci_find_ht_capability(dev, HT_CAPTYPE_SLAVE); if (pos != 0) { pci_dev_put(dev); break; } if (ht_check_msi_mapping(dev)) { found = 1; pci_dev_put(dev); break; } pci_dev_put(dev); } return found; } #define PCI_HT_CAP_SLAVE_CTRL0 4 /* link control */ #define PCI_HT_CAP_SLAVE_CTRL1 8 /* link control to */ static int __devinit is_end_of_ht_chain(struct pci_dev *dev) { int pos, ctrl_off; int end = 0; u16 flags, ctrl; pos = pci_find_ht_capability(dev, HT_CAPTYPE_SLAVE); if (!pos) goto out; pci_read_config_word(dev, pos + PCI_CAP_FLAGS, &flags); ctrl_off = ((flags >> 10) & 1) ? PCI_HT_CAP_SLAVE_CTRL0 : PCI_HT_CAP_SLAVE_CTRL1; pci_read_config_word(dev, pos + ctrl_off, &ctrl); if (ctrl & (1 << 6)) end = 1; out: return end; } static void __devinit nv_ht_enable_msi_mapping(struct pci_dev *dev) { struct pci_dev *host_bridge; int pos; int i, dev_no; int found = 0; dev_no = dev->devfn >> 3; for (i = dev_no; i >= 0; i--) { host_bridge = pci_get_slot(dev->bus, PCI_DEVFN(i, 0)); if (!host_bridge) continue; pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE); if (pos != 0) { found = 1; break; } pci_dev_put(host_bridge); } if (!found) return; /* don't enable end_device/host_bridge with leaf directly here */ if (host_bridge == dev && is_end_of_ht_chain(host_bridge) && host_bridge_with_leaf(host_bridge)) goto out; /* root did that ! */ if (msi_ht_cap_enabled(host_bridge)) goto out; ht_enable_msi_mapping(dev); out: pci_dev_put(host_bridge); } static void __devinit ht_disable_msi_mapping(struct pci_dev *dev) { int pos, ttl = 48; pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); while (pos && ttl--) { u8 flags; if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, &flags) == 0) { dev_info(&dev->dev, "Disabling HT MSI Mapping\n"); pci_write_config_byte(dev, pos + HT_MSI_FLAGS, flags & ~HT_MSI_FLAGS_ENABLE); } pos = pci_find_next_ht_capability(dev, pos, HT_CAPTYPE_MSI_MAPPING); } } static void __devinit __nv_msi_ht_cap_quirk(struct pci_dev *dev, int all) { struct pci_dev *host_bridge; int pos; int found; if (!pci_msi_enabled()) return; /* check if there is HT MSI cap or enabled on this device */ found = ht_check_msi_mapping(dev); /* no HT MSI CAP */ if (found == 0) return; /* * HT MSI mapping should be disabled on devices that are below * a non-Hypertransport host bridge. Locate the host bridge... */ host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); if (host_bridge == NULL) { dev_warn(&dev->dev, "nv_msi_ht_cap_quirk didn't locate host bridge\n"); return; } pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE); if (pos != 0) { /* Host bridge is to HT */ if (found == 1) { /* it is not enabled, try to enable it */ if (all) ht_enable_msi_mapping(dev); else nv_ht_enable_msi_mapping(dev); } return; } /* HT MSI is not enabled */ if (found == 1) return; /* Host bridge is not to HT, disable HT MSI mapping on this device */ ht_disable_msi_mapping(dev); } static void __devinit nv_msi_ht_cap_quirk_all(struct pci_dev *dev) { return __nv_msi_ht_cap_quirk(dev, 1); } static void __devinit nv_msi_ht_cap_quirk_leaf(struct pci_dev *dev) { return __nv_msi_ht_cap_quirk(dev, 0); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_quirk_leaf); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_quirk_leaf); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk_all); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk_all); static void __devinit quirk_msi_intx_disable_bug(struct pci_dev *dev) { dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; } static void __devinit quirk_msi_intx_disable_ati_bug(struct pci_dev *dev) { struct pci_dev *p; /* SB700 MSI issue will be fixed at HW level from revision A21, * we need check PCI REVISION ID of SMBus controller to get SB700 * revision. */ p = pci_get_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, NULL); if (!p) return; if ((p->revision < 0x3B) && (p->revision >= 0x30)) dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; pci_dev_put(p); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780, quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780S, quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5714, quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5714S, quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5715, quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5715S, quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4390, quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4391, quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4392, quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4393, quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4394, quirk_msi_intx_disable_ati_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4373, quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4374, quirk_msi_intx_disable_bug); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375, quirk_msi_intx_disable_bug); #endif /* CONFIG_PCI_MSI */ #ifdef CONFIG_PCI_IOV /* * For Intel 82576 SR-IOV NIC, if BIOS doesn't allocate resources for the * SR-IOV BARs, zero the Flash BAR and program the SR-IOV BARs to use the * old Flash Memory Space. */ static void __devinit quirk_i82576_sriov(struct pci_dev *dev) { int pos, flags; u32 bar, start, size; if (PAGE_SIZE > 0x10000) return; flags = pci_resource_flags(dev, 0); if ((flags & PCI_BASE_ADDRESS_SPACE) != PCI_BASE_ADDRESS_SPACE_MEMORY || (flags & PCI_BASE_ADDRESS_MEM_TYPE_MASK) != PCI_BASE_ADDRESS_MEM_TYPE_32) return; pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV); if (!pos) return; pci_read_config_dword(dev, pos + PCI_SRIOV_BAR, &bar); if (bar & PCI_BASE_ADDRESS_MEM_MASK) return; start = pci_resource_start(dev, 1); size = pci_resource_len(dev, 1); if (!start || size != 0x400000 || start & (size - 1)) return; pci_resource_flags(dev, 1) = 0; pci_write_config_dword(dev, PCI_BASE_ADDRESS_1, 0); pci_write_config_dword(dev, pos + PCI_SRIOV_BAR, start); pci_write_config_dword(dev, pos + PCI_SRIOV_BAR + 12, start + size / 2); dev_info(&dev->dev, "use Flash Memory Space for SR-IOV BARs\n"); } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x10c9, quirk_i82576_sriov); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x10e6, quirk_i82576_sriov); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x10e7, quirk_i82576_sriov); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x10e8, quirk_i82576_sriov); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x150a, quirk_i82576_sriov); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x150d, quirk_i82576_sriov); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1518, quirk_i82576_sriov); #endif /* CONFIG_PCI_IOV */ #endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */ static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end) { while (f < end) { if ((f->vendor == dev->vendor || f->vendor == (u16) PCI_ANY_ID) && (f->device == dev->device || f->device == (u16) PCI_ANY_ID)) { dev_dbg(&dev->dev, "calling %pF\n", f->hook); f->hook(dev); } f++; } } extern struct pci_fixup __start_pci_fixups_early[]; extern struct pci_fixup __end_pci_fixups_early[]; extern struct pci_fixup __start_pci_fixups_header[]; extern struct pci_fixup __end_pci_fixups_header[]; extern struct pci_fixup __start_pci_fixups_final[]; extern struct pci_fixup __end_pci_fixups_final[]; extern struct pci_fixup __start_pci_fixups_enable[]; extern struct pci_fixup __end_pci_fixups_enable[]; extern struct pci_fixup __start_pci_fixups_resume[]; extern struct pci_fixup __end_pci_fixups_resume[]; extern struct pci_fixup __start_pci_fixups_resume_early[]; extern struct pci_fixup __end_pci_fixups_resume_early[]; extern struct pci_fixup __start_pci_fixups_suspend[]; extern struct pci_fixup __end_pci_fixups_suspend[]; #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) #define VTUNCERRMSK_REG 0x1ac #define VTD_MSK_SPEC_ERRORS (1 << 31) /* * This is a quirk for masking vt-d spec defined errors to platform error * handling logic. With out this, platforms using Intel 7500, 5500 chipsets * (and the derivative chipsets like X58 etc) seem to generate NMI/SMI (based * on the RAS config settings of the platform) when a vt-d fault happens. * The resulting SMI caused the system to hang. * * VT-d spec related errors are already handled by the VT-d OS code, so no * need to report the same error through other channels. */ static void vtd_mask_spec_errors(struct pci_dev *dev) { u32 word; pci_read_config_dword(dev, VTUNCERRMSK_REG, &word); pci_write_config_dword(dev, VTUNCERRMSK_REG, word | VTD_MSK_SPEC_ERRORS); } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x342e, vtd_mask_spec_errors); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x3c28, vtd_mask_spec_errors); #endif void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) { struct pci_fixup *start, *end; switch(pass) { case pci_fixup_early: start = __start_pci_fixups_early; end = __end_pci_fixups_early; break; case pci_fixup_header: start = __start_pci_fixups_header; end = __end_pci_fixups_header; break; case pci_fixup_final: start = __start_pci_fixups_final; end = __end_pci_fixups_final; break; case pci_fixup_enable: start = __start_pci_fixups_enable; end = __end_pci_fixups_enable; break; case pci_fixup_resume: start = __start_pci_fixups_resume; end = __end_pci_fixups_resume; break; case pci_fixup_resume_early: start = __start_pci_fixups_resume_early; end = __end_pci_fixups_resume_early; break; case pci_fixup_suspend: start = __start_pci_fixups_suspend; end = __end_pci_fixups_suspend; break; default: /* stupid compiler warning, you would think with an enum... */ return; } pci_do_fixups(dev, start, end); } static int __init pci_apply_final_quirks(void) { struct pci_dev *dev = NULL; while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { pci_fixup_device(pci_fixup_final, dev); } return 0; } fs_initcall_sync(pci_apply_final_quirks); #else void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) {} #endif EXPORT_SYMBOL(pci_fixup_device);
Java
<?php include("./lib/template/mini_calendrier.php"); ?> <div id="lecorps"> <?php include("./lib/template/menu_edt.php"); ?> <div id="art-main"> <div class="art-sheet"> <div class="art-sheet-tl"></div> <div class="art-sheet-tr"></div> <div class="art-sheet-bl"></div> <div class="art-sheet-br"></div> <div class="art-sheet-tc"></div> <div class="art-sheet-bc"></div> <div class="art-sheet-cl"></div> <div class="art-sheet-cr"></div> <div class="art-sheet-cc"></div> <div class="art-sheet-body"> <div class="art-nav"> <div class="l"></div> <div class="r"></div> <?php include("menu_top.php"); ?> </div> <div class="art-content-layout"> <div class="art-content-layout-row"> <div class="art-layout-cell art-content"> <div class="art-post"> <div class="art-post-tl"></div> <div class="art-post-tr"></div> <div class="art-post-bl"></div> <div class="art-post-br"></div> <div class="art-post-tc"></div> <div class="art-post-bc"></div> <div class="art-post-cl"></div> <div class="art-post-cr"></div> <div class="art-post-cc"></div> <div class="art-post-body"> <div class="art-post-inner art-article"> <div class="art-postmetadataheader"> <h2 class="art-postheader"> Future interface of module EDT </h2> </div> <div class="art-postcontent"> <!-- article-content --> <p> This part of the software is under development. It is the new interface of module EDT, resulting of a complete refactorisation of the module. The objective is to pass all the module into object MVC.</p> <div class="cleared"></div> <!-- /article-content --> </div> <div class="cleared"></div> </div> </div> </div> </div> </div> </div> <?php include("footer.php"); ?> </div> </div>
Java
<?php /** * * @category modules * @package news * @author WebsiteBaker Project * @copyright 2004-2009, Ryan Djurovich * @copyright 2009-2011, Website Baker Org. e.V. * @link http://www.websitebaker2.org/ * @license http://www.gnu.org/licenses/gpl.html * @platform WebsiteBaker 2.8.x * @requirements PHP 5.2.2 and higher * @version $Id$ * @filesource $HeadURL$ * @lastmodified $Date$ * */ //Modul Description $module_description = 'Den h&auml;r sidtypen &auml;r designad f&ouml;r att skapa en nyhetssida.'; //Variables for the backend $MOD_NEWS['SETTINGS'] = 'Inst&auml;llningar'; //Variables for the frontend $MOD_NEWS['TEXT_READ_MORE'] = 'L&auml;s mer'; $MOD_NEWS['TEXT_POSTED_BY'] = 'Postat av'; $MOD_NEWS['TEXT_ON'] = 'den'; $MOD_NEWS['TEXT_LAST_CHANGED'] = 'Senaste &auml;ndring'; $MOD_NEWS['TEXT_AT'] = 'kl.'; $MOD_NEWS['TEXT_BACK'] = 'Tillbaka'; $MOD_NEWS['TEXT_COMMENTS'] = 'Kommentarer'; $MOD_NEWS['TEXT_COMMENT'] = 'kommentar'; $MOD_NEWS['TEXT_ADD_COMMENT'] = 'Kommentera'; $MOD_NEWS['TEXT_BY'] = 'Av'; $MOD_NEWS['PAGE_NOT_FOUND'] = 'Sidan kunde inte hittas'; $MOD_NEWS['NO_COMMENT_FOUND'] = 'No comment found'; $TEXT['UNKNOWN'] = 'Guest'; ?>
Java
/* * drivers/media/video/omap/gfx_tiler.c * * Copyright (C) 2010 Texas Instruments. * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied. * */ #include <linux/errno.h> #include <linux/kernel.h> #include <linux/types.h> #include "v4gfx.h" #include "gfx_bc.h" #ifdef CONFIG_TILER_OMAP #include <mach/tiler.h> #define TILER_ALLOCATE_V4L2 #endif void v4gfx_tiler_buffer_free(struct v4gfx_device *vout, unsigned int count, unsigned int startindex) { #ifdef CONFIG_TILER_OMAP int i; if (startindex < 0) startindex = 0; if (startindex + count > VIDEO_MAX_FRAME) count = VIDEO_MAX_FRAME - startindex; for (i = startindex; i < startindex + count; i++) { if (vout->buf_phy_addr_alloced[i]) tiler_free(vout->buf_phy_addr_alloced[i]); if (vout->buf_phy_uv_addr_alloced[i]) tiler_free(vout->buf_phy_uv_addr_alloced[i]); vout->buf_phy_addr[i] = 0; vout->buf_phy_addr_alloced[i] = 0; vout->buf_phy_uv_addr[i] = 0; vout->buf_phy_uv_addr_alloced[i] = 0; } #endif } /* Allocate the buffers for TILER space. Ideally, the buffers will be ONLY in tiler space, with different rotated views available by just a convert. */ int v4gfx_tiler_buffer_setup(struct v4gfx_device *vout, unsigned int *count, unsigned int startindex, struct v4l2_pix_format *pix) { #ifdef CONFIG_TILER_OMAP /* startindex is always passed as 0, possibly tidy up? */ int i, aligned = 1, bpp; enum tiler_fmt fmt; int rv = 0; /* normalize buffers to allocate so we stay within bounds */ int start = (startindex < 0) ? 0 : startindex; int n_alloc = (start + *count > VIDEO_MAX_FRAME) ? VIDEO_MAX_FRAME - start : *count; GFXLOG(1, V4L2DEV(vout), "+%s\n", __func__); bpp = v4gfx_try_format(pix); if (bpp <= 0) { rv = bpp; /* error condition */ goto end; } GFXLOG(1, V4L2DEV(vout), "tiler buffer alloc: " "count = %d, start = %d :\n", *count, startindex); /* special allocation scheme for NV12 format */ if (V4L2_PIX_FMT_NV12 == pix->pixelformat) { tiler_alloc_packed_nv12(&n_alloc, ALIGN(pix->width, 128), pix->height, (void **) vout->buf_phy_addr + start, (void **) vout->buf_phy_uv_addr + start, (void **) vout->buf_phy_addr_alloced + start, (void **) vout->buf_phy_uv_addr_alloced + start, aligned); } else { /* Only bpp of 1, 2, and 4 is supported by tiler */ fmt = (bpp == 1 ? TILFMT_8BIT : bpp == 2 ? TILFMT_16BIT : bpp == 4 ? TILFMT_32BIT : TILFMT_INVALID); if (fmt == TILFMT_INVALID) { rv = -ENOMEM; goto end; } tiler_alloc_packed(&n_alloc, fmt, ALIGN(pix->width, 128 / bpp), pix->height, (void **) vout->buf_phy_addr + start, (void **) vout->buf_phy_addr_alloced + start, aligned); } GFXLOG(1, V4L2DEV(vout), "allocated %d buffers\n", n_alloc); if (n_alloc < *count) { if (n_alloc && (startindex == -1 || V4L2_MEMORY_MMAP != vout->memory)) { /* TODO: check this condition's logic */ v4gfx_tiler_buffer_free(vout, n_alloc, start); *count = 0; rv = -ENOMEM; goto end; } } for (i = start; i < start + n_alloc; i++) { GFXLOG(1, V4L2DEV(vout), "y=%08lx (%d) uv=%08lx (%d)\n", vout->buf_phy_addr[i], vout->buf_phy_addr_alloced[i] ? 1 : 0, vout->buf_phy_uv_addr[i], vout->buf_phy_uv_addr_alloced[i] ? 1 : 0); } *count = n_alloc; end: GFXLOG(1, V4L2DEV(vout), "-%s [%d]\n", __func__, rv); return rv; #else return 0; #endif } void v4gfx_tiler_image_incr(struct v4gfx_device *vout, int *cpu_pgwidth, int *tiler_increment) { #ifdef CONFIG_TILER_OMAP /* for NV12, Y buffer is 1bpp*/ if (V4L2_PIX_FMT_NV12 == vout->pix.pixelformat) { *cpu_pgwidth = (vout->pix.width + TILER_PAGE - 1) & ~(TILER_PAGE - 1); *tiler_increment = 64 * TILER_WIDTH; } else { *cpu_pgwidth = (vout->pix.width * vout->bpp + TILER_PAGE - 1) & ~(TILER_PAGE - 1); if (vout->bpp > 1) *tiler_increment = 2 * 64 * TILER_WIDTH; else *tiler_increment = 64 * TILER_WIDTH; } #endif } void v4gfx_tiler_image_incr_uv(struct v4gfx_device *vout, int *tiler_increment) { #ifdef CONFIG_TILER_OMAP if (vout->pix.pixelformat == V4L2_PIX_FMT_NV12) *tiler_increment = 2 * 64 * TILER_WIDTH; /* Otherwise do nothing */ #endif }
Java
package STEDT::Table::Mesoroots; use base STEDT::Table; use strict; sub new { my ($self, $dbh, $privs, $uid) = @_; my $t = $self->SUPER::new($dbh, 'mesoroots', 'mesoroots.id', $privs); # dbh, table, key, privs $t->query_from(q|mesoroots LEFT JOIN `users` ON mesoroots.uid = users.uid LEFT JOIN languagegroups ON mesoroots.grpid=languagegroups.grpid|); $t->default_where(''); $t->order_by('mesoroots.tag'); $t->fields('mesoroots.id', 'mesoroots.tag', 'mesoroots.form', 'mesoroots.gloss', 'mesoroots.grpid', 'languagegroups.plg', 'languagegroups.grpno', 'mesoroots.old_tag', 'mesoroots.old_note', 'mesoroots.variant', 'users.username', ); $t->field_visible_privs( 'users.username' => 1, ); $t->searchable('mesoroots.id', 'mesoroots.tag', 'mesoroots.form', 'mesoroots.gloss', 'mesoroots.grpid', 'mesoroots.uid', ); $t->field_editable_privs( # none are editable: can edit them using the etymon view or (if admin) single-record view ); # Stuff for searching $t->search_form_items( 'mesoroots.grpid' => sub { my $cgi = shift; my $a = $dbh->selectall_arrayref("SELECT CONCAT(grpno, ' - ', plg), grpid FROM languagegroups WHERE plg != '' ORDER BY grp0,grp1,grp2,grp3,grp4"); unshift @$a, ['', '']; push @$a, ['(undefined)', 0]; my @ids = map {$_->[1]} @$a; my %labels; @labels{@ids} = map {$_->[0]} @$a; return $cgi->popup_menu(-name => 'mesoroots.grpid', -values=>[@ids], -default=>'', -labels=>\%labels); }, 'mesoroots.uid' => sub { my $cgi = shift; # get list of users who own mesoroots my $users = $dbh->selectall_arrayref("SELECT DISTINCT uid, username FROM mesoroots LEFT JOIN users USING (uid) ORDER BY uid"); my @uids = map {$_->[0]} @$users; my %usernames; @usernames{@uids} = map {$_->[1] . ' (id:' . $_->[0] . ')'} @$users; return $cgi->popup_menu(-name => 'mesoroots.uid', -values=>['', @uids], -labels=>\%usernames, -default=>''); }, ); $t->wheres( 'mesoroots.tag' => sub {my ($k,$v) = @_; return STEDT::Table::where_int($k,$v); }, 'mesoroots.grpid' => 'int', 'mesoroots.gloss' => 'word', 'mesoroots.uid' => 'int', ); $t->save_hooks( ); $t->reload_on_save( 'mesoroots.grpid' ); #$t->allow_delete(1); #$t->debug(1); $t->search_limit(200); return $t; } 1;
Java
/** * @file * Provides Ajax page updating via jQuery $.ajax. * * Ajax is a method of making a request via JavaScript while viewing an HTML * page. The request returns an array of commands encoded in JSON, which is * then executed to make any changes that are necessary to the page. * * Drupal uses this file to enhance form elements with `#ajax['url']` and * `#ajax['wrapper']` properties. If set, this file will automatically be * included to provide Ajax capabilities. */ (function ($, window, Drupal, drupalSettings) { 'use strict'; /** * Attaches the Ajax behavior to each Ajax form element. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Initialize all {@link Drupal.Ajax} objects declared in * `drupalSettings.ajax` or initialize {@link Drupal.Ajax} objects from * DOM elements having the `use-ajax-submit` or `use-ajax` css class. * @prop {Drupal~behaviorDetach} detach * During `unload` remove all {@link Drupal.Ajax} objects related to * the removed content. */ Drupal.behaviors.AJAX = { attach: function (context, settings) { function loadAjaxBehavior(base) { var element_settings = settings.ajax[base]; if (typeof element_settings.selector === 'undefined') { element_settings.selector = '#' + base; } $(element_settings.selector).once('drupal-ajax').each(function () { element_settings.element = this; element_settings.base = base; Drupal.ajax(element_settings); }); } // Load all Ajax behaviors specified in the settings. for (var base in settings.ajax) { if (settings.ajax.hasOwnProperty(base)) { loadAjaxBehavior(base); } } // Bind Ajax behaviors to all items showing the class. $('.use-ajax').once('ajax').each(function () { var element_settings = {}; // Clicked links look better with the throbber than the progress bar. element_settings.progress = {type: 'throbber'}; // For anchor tags, these will go to the target of the anchor rather // than the usual location. var href = $(this).attr('href'); if (href) { element_settings.url = href; element_settings.event = 'click'; } element_settings.dialogType = $(this).data('dialog-type'); element_settings.dialog = $(this).data('dialog-options'); element_settings.base = $(this).attr('id'); element_settings.element = this; Drupal.ajax(element_settings); }); // This class means to submit the form to the action using Ajax. $('.use-ajax-submit').once('ajax').each(function () { var element_settings = {}; // Ajax submits specified in this manner automatically submit to the // normal form action. element_settings.url = $(this.form).attr('action'); // Form submit button clicks need to tell the form what was clicked so // it gets passed in the POST request. element_settings.setClick = true; // Form buttons use the 'click' event rather than mousedown. element_settings.event = 'click'; // Clicked form buttons look better with the throbber than the progress // bar. element_settings.progress = {type: 'throbber'}; element_settings.base = $(this).attr('id'); element_settings.element = this; Drupal.ajax(element_settings); }); }, detach: function (context, settings, trigger) { if (trigger === 'unload') { Drupal.ajax.expired().forEach(function (instance) { // Set this to null and allow garbage collection to reclaim // the memory. Drupal.ajax.instances[instance.instanceIndex] = null; }); } } }; /** * Extends Error to provide handling for Errors in Ajax. * * @constructor * * @augments Error * * @param {XMLHttpRequest} xmlhttp * XMLHttpRequest object used for the failed request. * @param {string} uri * The URI where the error occurred. * @param {string} customMessage * The custom message. */ Drupal.AjaxError = function (xmlhttp, uri, customMessage) { var statusCode; var statusText; var pathText; var responseText; var readyStateText; if (xmlhttp.status) { statusCode = '\n' + Drupal.t('An AJAX HTTP error occurred.') + '\n' + Drupal.t('HTTP Result Code: !status', {'!status': xmlhttp.status}); } else { statusCode = '\n' + Drupal.t('An AJAX HTTP request terminated abnormally.'); } statusCode += '\n' + Drupal.t('Debugging information follows.'); pathText = '\n' + Drupal.t('Path: !uri', {'!uri': uri}); statusText = ''; // In some cases, when statusCode === 0, xmlhttp.statusText may not be // defined. Unfortunately, testing for it with typeof, etc, doesn't seem to // catch that and the test causes an exception. So we need to catch the // exception here. try { statusText = '\n' + Drupal.t('StatusText: !statusText', {'!statusText': $.trim(xmlhttp.statusText)}); } catch (e) { // Empty. } responseText = ''; // Again, we don't have a way to know for sure whether accessing // xmlhttp.responseText is going to throw an exception. So we'll catch it. try { responseText = '\n' + Drupal.t('ResponseText: !responseText', {'!responseText': $.trim(xmlhttp.responseText)}); } catch (e) { // Empty. } // Make the responseText more readable by stripping HTML tags and newlines. responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, ''); responseText = responseText.replace(/[\n]+\s+/g, '\n'); // We don't need readyState except for status == 0. readyStateText = xmlhttp.status === 0 ? ('\n' + Drupal.t('ReadyState: !readyState', {'!readyState': xmlhttp.readyState})) : ''; customMessage = customMessage ? ('\n' + Drupal.t('CustomMessage: !customMessage', {'!customMessage': customMessage})) : ''; /** * Formatted and translated error message. * * @type {string} */ this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText; /** * Used by some browsers to display a more accurate stack trace. * * @type {string} */ this.name = 'AjaxError'; }; Drupal.AjaxError.prototype = new Error(); Drupal.AjaxError.prototype.constructor = Drupal.AjaxError; /** * Provides Ajax page updating via jQuery $.ajax. * * This function is designed to improve developer experience by wrapping the * initialization of {@link Drupal.Ajax} objects and storing all created * objects in the {@link Drupal.ajax.instances} array. * * @example * Drupal.behaviors.myCustomAJAXStuff = { * attach: function (context, settings) { * * var ajaxSettings = { * url: 'my/url/path', * // If the old version of Drupal.ajax() needs to be used those * // properties can be added * base: 'myBase', * element: $(context).find('.someElement') * }; * * var myAjaxObject = Drupal.ajax(ajaxSettings); * * // Declare a new Ajax command specifically for this Ajax object. * myAjaxObject.commands.insert = function (ajax, response, status) { * $('#my-wrapper').append(response.data); * alert('New content was appended to #my-wrapper'); * }; * * // This command will remove this Ajax object from the page. * myAjaxObject.commands.destroyObject = function (ajax, response, status) { * Drupal.ajax.instances[this.instanceIndex] = null; * }; * * // Programmatically trigger the Ajax request. * myAjaxObject.execute(); * } * }; * * @param {object} settings * The settings object passed to {@link Drupal.Ajax} constructor. * @param {string} [settings.base] * Base is passed to {@link Drupal.Ajax} constructor as the 'base' * parameter. * @param {HTMLElement} [settings.element] * Element parameter of {@link Drupal.Ajax} constructor, element on which * event listeners will be bound. * * @return {Drupal.Ajax} * The created Ajax object. * * @see Drupal.AjaxCommands */ Drupal.ajax = function (settings) { if (arguments.length !== 1) { throw new Error('Drupal.ajax() function must be called with one configuration object only'); } // Map those config keys to variables for the old Drupal.ajax function. var base = settings.base || false; var element = settings.element || false; delete settings.base; delete settings.element; // By default do not display progress for ajax calls without an element. if (!settings.progress && !element) { settings.progress = false; } var ajax = new Drupal.Ajax(base, element, settings); ajax.instanceIndex = Drupal.ajax.instances.length; Drupal.ajax.instances.push(ajax); return ajax; }; /** * Contains all created Ajax objects. * * @type {Array.<Drupal.Ajax|null>} */ Drupal.ajax.instances = []; /** * List all objects where the associated element is not in the DOM * * This method ignores {@link Drupal.Ajax} objects not bound to DOM elements * when created with {@link Drupal.ajax}. * * @return {Array.<Drupal.Ajax>} * The list of expired {@link Drupal.Ajax} objects. */ Drupal.ajax.expired = function () { return Drupal.ajax.instances.filter(function (instance) { return instance && instance.element !== false && !document.body.contains(instance.element); }); }; /** * Settings for an Ajax object. * * @typedef {object} Drupal.Ajax~element_settings * * @prop {string} url * Target of the Ajax request. * @prop {?string} [event] * Event bound to settings.element which will trigger the Ajax request. * @prop {bool} [keypress=true] * Triggers a request on keypress events. * @prop {?string} selector * jQuery selector targeting the element to bind events to or used with * {@link Drupal.AjaxCommands}. * @prop {string} [effect='none'] * Name of the jQuery method to use for displaying new Ajax content. * @prop {string|number} [speed='none'] * Speed with which to apply the effect. * @prop {string} [method] * Name of the jQuery method used to insert new content in the targeted * element. * @prop {object} [progress] * Settings for the display of a user-friendly loader. * @prop {string} [progress.type='throbber'] * Type of progress element, core provides `'bar'`, `'throbber'` and * `'fullscreen'`. * @prop {string} [progress.message=Drupal.t('Please wait...')] * Custom message to be used with the bar indicator. * @prop {object} [submit] * Extra data to be sent with the Ajax request. * @prop {bool} [submit.js=true] * Allows the PHP side to know this comes from an Ajax request. * @prop {object} [dialog] * Options for {@link Drupal.dialog}. * @prop {string} [dialogType] * One of `'modal'` or `'dialog'`. * @prop {string} [prevent] * List of events on which to stop default action and stop propagation. */ /** * Ajax constructor. * * The Ajax request returns an array of commands encoded in JSON, which is * then executed to make any changes that are necessary to the page. * * Drupal uses this file to enhance form elements with `#ajax['url']` and * `#ajax['wrapper']` properties. If set, this file will automatically be * included to provide Ajax capabilities. * * @constructor * * @param {string} [base] * Base parameter of {@link Drupal.Ajax} constructor * @param {HTMLElement} [element] * Element parameter of {@link Drupal.Ajax} constructor, element on which * event listeners will be bound. * @param {Drupal.Ajax~element_settings} element_settings * Settings for this Ajax object. */ Drupal.Ajax = function (base, element, element_settings) { var defaults = { event: element ? 'mousedown' : null, keypress: true, selector: base ? '#' + base : null, effect: 'none', speed: 'none', method: 'replaceWith', progress: { type: 'throbber', message: Drupal.t('Please wait...') }, submit: { js: true } }; $.extend(this, defaults, element_settings); /** * @type {Drupal.AjaxCommands} */ this.commands = new Drupal.AjaxCommands(); /** * @type {bool|number} */ this.instanceIndex = false; // @todo Remove this after refactoring the PHP code to: // - Call this 'selector'. // - Include the '#' for ID-based selectors. // - Support non-ID-based selectors. if (this.wrapper) { /** * @type {string} */ this.wrapper = '#' + this.wrapper; } /** * @type {HTMLElement} */ this.element = element; /** * @type {Drupal.Ajax~element_settings} */ this.element_settings = element_settings; // If there isn't a form, jQuery.ajax() will be used instead, allowing us to // bind Ajax to links as well. if (this.element && this.element.form) { /** * @type {jQuery} */ this.$form = $(this.element.form); } // If no Ajax callback URL was given, use the link href or form action. if (!this.url) { var $element = $(this.element); if ($element.is('a')) { this.url = $element.attr('href'); } else if (this.element && element.form) { this.url = this.$form.attr('action'); } } // Replacing 'nojs' with 'ajax' in the URL allows for an easy method to let // the server detect when it needs to degrade gracefully. // There are four scenarios to check for: // 1. /nojs/ // 2. /nojs$ - The end of a URL string. // 3. /nojs? - Followed by a query (e.g. path/nojs?destination=foobar). // 4. /nojs# - Followed by a fragment (e.g.: path/nojs#myfragment). var originalUrl = this.url; /** * Processed Ajax URL. * * @type {string} */ this.url = this.url.replace(/\/nojs(\/|$|\?|#)/g, '/ajax$1'); // If the 'nojs' version of the URL is trusted, also trust the 'ajax' // version. if (drupalSettings.ajaxTrustedUrl[originalUrl]) { drupalSettings.ajaxTrustedUrl[this.url] = true; } // Set the options for the ajaxSubmit function. // The 'this' variable will not persist inside of the options object. var ajax = this; /** * Options for the jQuery.ajax function. * * @name Drupal.Ajax#options * * @type {object} * * @prop {string} url * Ajax URL to be called. * @prop {object} data * Ajax payload. * @prop {function} beforeSerialize * Implement jQuery beforeSerialize function to call * {@link Drupal.Ajax#beforeSerialize}. * @prop {function} beforeSubmit * Implement jQuery beforeSubmit function to call * {@link Drupal.Ajax#beforeSubmit}. * @prop {function} beforeSend * Implement jQuery beforeSend function to call * {@link Drupal.Ajax#beforeSend}. * @prop {function} success * Implement jQuery success function to call * {@link Drupal.Ajax#success}. * @prop {function} complete * Implement jQuery success function to clean up ajax state and trigger an * error if needed. * @prop {string} dataType='json' * Type of the response expected. * @prop {string} type='POST' * HTTP method to use for the Ajax request. */ ajax.options = { url: ajax.url, data: ajax.submit, beforeSerialize: function (element_settings, options) { return ajax.beforeSerialize(element_settings, options); }, beforeSubmit: function (form_values, element_settings, options) { ajax.ajaxing = true; return ajax.beforeSubmit(form_values, element_settings, options); }, beforeSend: function (xmlhttprequest, options) { ajax.ajaxing = true; return ajax.beforeSend(xmlhttprequest, options); }, success: function (response, status, xmlhttprequest) { // Sanity check for browser support (object expected). // When using iFrame uploads, responses must be returned as a string. if (typeof response === 'string') { response = $.parseJSON(response); } // Prior to invoking the response's commands, verify that they can be // trusted by checking for a response header. See // \Drupal\Core\EventSubscriber\AjaxResponseSubscriber for details. // - Empty responses are harmless so can bypass verification. This // avoids an alert message for server-generated no-op responses that // skip Ajax rendering. // - Ajax objects with trusted URLs (e.g., ones defined server-side via // #ajax) can bypass header verification. This is especially useful // for Ajax with multipart forms. Because IFRAME transport is used, // the response headers cannot be accessed for verification. if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) { if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') { var customMessage = Drupal.t('The response failed verification so will not be processed.'); return ajax.error(xmlhttprequest, ajax.url, customMessage); } } return ajax.success(response, status); }, complete: function (xmlhttprequest, status) { ajax.ajaxing = false; if (status === 'error' || status === 'parsererror') { return ajax.error(xmlhttprequest, ajax.url); } }, dataType: 'json', type: 'POST' }; if (element_settings.dialog) { ajax.options.data.dialogOptions = element_settings.dialog; } // Ensure that we have a valid URL by adding ? when no query parameter is // yet available, otherwise append using &. if (ajax.options.url.indexOf('?') === -1) { ajax.options.url += '?'; } else { ajax.options.url += '&'; } ajax.options.url += Drupal.ajax.WRAPPER_FORMAT + '=drupal_' + (element_settings.dialogType || 'ajax'); // Bind the ajaxSubmit function to the element event. $(ajax.element).on(element_settings.event, function (event) { if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) { throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', {'!url': ajax.url})); } return ajax.eventResponse(this, event); }); // If necessary, enable keyboard submission so that Ajax behaviors // can be triggered through keyboard input as well as e.g. a mousedown // action. if (element_settings.keypress) { $(ajax.element).on('keypress', function (event) { return ajax.keypressResponse(this, event); }); } // If necessary, prevent the browser default action of an additional event. // For example, prevent the browser default action of a click, even if the // Ajax behavior binds to mousedown. if (element_settings.prevent) { $(ajax.element).on(element_settings.prevent, false); } }; /** * URL query attribute to indicate the wrapper used to render a request. * * The wrapper format determines how the HTML is wrapped, for example in a * modal dialog. * * @const {string} * * @default */ Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format'; /** * Request parameter to indicate that a request is a Drupal Ajax request. * * @const {string} * * @default */ Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; /** * Execute the ajax request. * * Allows developers to execute an Ajax request manually without specifying * an event to respond to. * * @return {object} * Returns the jQuery.Deferred object underlying the Ajax request. If * pre-serialization fails, the Deferred will be returned in the rejected * state. */ Drupal.Ajax.prototype.execute = function () { // Do not perform another ajax command if one is already in progress. if (this.ajaxing) { return; } try { this.beforeSerialize(this.element, this.options); // Return the jqXHR so that external code can hook into the Deferred API. return $.ajax(this.options); } catch (e) { // Unset the ajax.ajaxing flag here because it won't be unset during // the complete response. this.ajaxing = false; window.alert('An error occurred while attempting to process ' + this.options.url + ': ' + e.message); // For consistency, return a rejected Deferred (i.e., jqXHR's superclass) // so that calling code can take appropriate action. return $.Deferred().reject(); } }; /** * Handle a key press. * * The Ajax object will, if instructed, bind to a key press response. This * will test to see if the key press is valid to trigger this event and * if it is, trigger it for us and prevent other keypresses from triggering. * In this case we're handling RETURN and SPACEBAR keypresses (event codes 13 * and 32. RETURN is often used to submit a form when in a textfield, and * SPACE is often used to activate an element without submitting. * * @param {HTMLElement} element * Element the event was triggered on. * @param {jQuery.Event} event * Triggered event. */ Drupal.Ajax.prototype.keypressResponse = function (element, event) { // Create a synonym for this to reduce code confusion. var ajax = this; // Detect enter key and space bar and allow the standard response for them, // except for form elements of type 'text', 'tel', 'number' and 'textarea', // where the spacebar activation causes inappropriate activation if // #ajax['keypress'] is TRUE. On a text-type widget a space should always // be a space. if (event.which === 13 || (event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number')) { event.preventDefault(); event.stopPropagation(); $(ajax.element_settings.element).trigger(ajax.element_settings.event); } }; /** * Handle an event that triggers an Ajax response. * * When an event that triggers an Ajax response happens, this method will * perform the actual Ajax call. It is bound to the event using * bind() in the constructor, and it uses the options specified on the * Ajax object. * * @param {HTMLElement} element * Element the event was triggered on. * @param {jQuery.Event} event * Triggered event. */ Drupal.Ajax.prototype.eventResponse = function (element, event) { event.preventDefault(); event.stopPropagation(); // Create a synonym for this to reduce code confusion. var ajax = this; // Do not perform another Ajax command if one is already in progress. if (ajax.ajaxing) { return; } try { if (ajax.$form) { // If setClick is set, we must set this to ensure that the button's // value is passed. if (ajax.setClick) { // Mark the clicked button. 'form.clk' is a special variable for // ajaxSubmit that tells the system which element got clicked to // trigger the submit. Without it there would be no 'op' or // equivalent. element.form.clk = element; } ajax.$form.ajaxSubmit(ajax.options); } else { ajax.beforeSerialize(ajax.element, ajax.options); $.ajax(ajax.options); } } catch (e) { // Unset the ajax.ajaxing flag here because it won't be unset during // the complete response. ajax.ajaxing = false; window.alert('An error occurred while attempting to process ' + ajax.options.url + ': ' + e.message); } }; /** * Handler for the form serialization. * * Runs before the beforeSend() handler (see below), and unlike that one, runs * before field data is collected. * * @param {object} [element] * Ajax object's `element_settings`. * @param {object} options * jQuery.ajax options. */ Drupal.Ajax.prototype.beforeSerialize = function (element, options) { // Allow detaching behaviors to update field values before collecting them. // This is only needed when field values are added to the POST data, so only // when there is a form such that this.$form.ajaxSubmit() is used instead of // $.ajax(). When there is no form and $.ajax() is used, beforeSerialize() // isn't called, but don't rely on that: explicitly check this.$form. if (this.$form) { var settings = this.settings || drupalSettings; Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize'); } // Inform Drupal that this is an AJAX request. options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1; // Allow Drupal to return new JavaScript and CSS files to load without // returning the ones already loaded. // @see \Drupal\Core\Theme\AjaxBasePageNegotiator // @see \Drupal\Core\Asset\LibraryDependencyResolverInterface::getMinimalRepresentativeSubset() // @see system_js_settings_alter() var pageState = drupalSettings.ajaxPageState; options.data['ajax_page_state[theme]'] = pageState.theme; options.data['ajax_page_state[theme_token]'] = pageState.theme_token; options.data['ajax_page_state[libraries]'] = pageState.libraries; }; /** * Modify form values prior to form submission. * * @param {Array.<object>} form_values * Processed form values. * @param {jQuery} element * The form node as a jQuery object. * @param {object} options * jQuery.ajax options. */ Drupal.Ajax.prototype.beforeSubmit = function (form_values, element, options) { // This function is left empty to make it simple to override for modules // that wish to add functionality here. }; /** * Prepare the Ajax request before it is sent. * * @param {XMLHttpRequest} xmlhttprequest * Native Ajax object. * @param {object} options * jQuery.ajax options. */ Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) { // For forms without file inputs, the jQuery Form plugin serializes the // form values, and then calls jQuery's $.ajax() function, which invokes // this handler. In this circumstance, options.extraData is never used. For // forms with file inputs, the jQuery Form plugin uses the browser's normal // form submission mechanism, but captures the response in a hidden IFRAME. // In this circumstance, it calls this handler first, and then appends // hidden fields to the form to submit the values in options.extraData. // There is no simple way to know which submission mechanism will be used, // so we add to extraData regardless, and allow it to be ignored in the // former case. if (this.$form) { options.extraData = options.extraData || {}; // Let the server know when the IFRAME submission mechanism is used. The // server can use this information to wrap the JSON response in a // TEXTAREA, as per http://jquery.malsup.com/form/#file-upload. options.extraData.ajax_iframe_upload = '1'; // The triggering element is about to be disabled (see below), but if it // contains a value (e.g., a checkbox, textfield, select, etc.), ensure // that value is included in the submission. As per above, submissions // that use $.ajax() are already serialized prior to the element being // disabled, so this is only needed for IFRAME submissions. var v = $.fieldValue(this.element); if (v !== null) { options.extraData[this.element.name] = v; } } // Disable the element that received the change to prevent user interface // interaction while the Ajax request is in progress. ajax.ajaxing prevents // the element from triggering a new request, but does not prevent the user // from changing its value. $(this.element).prop('disabled', true); if (!this.progress || !this.progress.type) { return; } // Insert progress indicator. var progressIndicatorMethod = 'setProgressIndicator' + this.progress.type.slice(0, 1).toUpperCase() + this.progress.type.slice(1).toLowerCase(); if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') { this[progressIndicatorMethod].call(this); } }; /** * Sets the progress bar progress indicator. */ Drupal.Ajax.prototype.setProgressIndicatorBar = function () { var progressBar = new Drupal.ProgressBar('ajax-progress-' + this.element.id, $.noop, this.progress.method, $.noop); if (this.progress.message) { progressBar.setProgress(-1, this.progress.message); } if (this.progress.url) { progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500); } this.progress.element = $(progressBar.element).addClass('ajax-progress ajax-progress-bar'); this.progress.object = progressBar; $(this.element).after(this.progress.element); }; /** * Sets the throbber progress indicator. */ Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () { this.progress.element = $('<div class="ajax-progress ajax-progress-throbber"><div class="throbber">&nbsp;</div></div>'); if (this.progress.message) { this.progress.element.find('.throbber').after('<div class="message">' + this.progress.message + '</div>'); } $(this.element).after(this.progress.element); }; /** * Sets the fullscreen progress indicator. */ Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () { this.progress.element = $('<div class="ajax-progress ajax-progress-fullscreen">&nbsp;</div>'); $('body').after(this.progress.element); }; /** * Handler for the form redirection completion. * * @param {Array.<Drupal.AjaxCommands~commandDefinition>} response * Drupal Ajax response. * @param {number} status * XMLHttpRequest status. */ Drupal.Ajax.prototype.success = function (response, status) { // Remove the progress element. if (this.progress.element) { $(this.progress.element).remove(); } if (this.progress.object) { this.progress.object.stopMonitoring(); } $(this.element).prop('disabled', false); // Save element's ancestors tree so if the element is removed from the dom // we can try to refocus one of its parents. Using addBack reverse the // result array, meaning that index 0 is the highest parent in the hierarchy // in this situation it is usually a <form> element. var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray(); // Track if any command is altering the focus so we can avoid changing the // focus set by the Ajax command. var focusChanged = false; for (var i in response) { if (response.hasOwnProperty(i) && response[i].command && this.commands[response[i].command]) { this.commands[response[i].command](this, response[i], status); if (response[i].command === 'invoke' && response[i].method === 'focus') { focusChanged = true; } } } // If the focus hasn't be changed by the ajax commands, try to refocus the // triggering element or one of its parents if that element does not exist // anymore. if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) { var target = false; for (var n = elementParents.length - 1; !target && n > 0; n--) { target = document.querySelector('[data-drupal-selector="' + elementParents[n].getAttribute('data-drupal-selector') + '"]'); } if (target) { $(target).trigger('focus'); } } // Reattach behaviors, if they were detached in beforeSerialize(). The // attachBehaviors() called on the new content from processing the response // commands is not sufficient, because behaviors from the entire form need // to be reattached. if (this.$form) { var settings = this.settings || drupalSettings; Drupal.attachBehaviors(this.$form.get(0), settings); } // Remove any response-specific settings so they don't get used on the next // call by mistake. this.settings = null; }; /** * Build an effect object to apply an effect when adding new HTML. * * @param {object} response * Drupal Ajax response. * @param {string} [response.effect] * Override the default value of {@link Drupal.Ajax#element_settings}. * @param {string|number} [response.speed] * Override the default value of {@link Drupal.Ajax#element_settings}. * * @return {object} * Returns an object with `showEffect`, `hideEffect` and `showSpeed` * properties. */ Drupal.Ajax.prototype.getEffect = function (response) { var type = response.effect || this.effect; var speed = response.speed || this.speed; var effect = {}; if (type === 'none') { effect.showEffect = 'show'; effect.hideEffect = 'hide'; effect.showSpeed = ''; } else if (type === 'fade') { effect.showEffect = 'fadeIn'; effect.hideEffect = 'fadeOut'; effect.showSpeed = speed; } else { effect.showEffect = type + 'Toggle'; effect.hideEffect = type + 'Toggle'; effect.showSpeed = speed; } return effect; }; /** * Handler for the form redirection error. * * @param {object} xmlhttprequest * Native XMLHttpRequest object. * @param {string} uri * Ajax Request URI. * @param {string} [customMessage] * Extra message to print with the Ajax error. */ Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { // Remove the progress element. if (this.progress.element) { $(this.progress.element).remove(); } if (this.progress.object) { this.progress.object.stopMonitoring(); } // Undo hide. $(this.wrapper).show(); // Re-enable the element. $(this.element).prop('disabled', false); // Reattach behaviors, if they were detached in beforeSerialize(). if (this.$form) { var settings = this.settings || drupalSettings; Drupal.attachBehaviors(this.$form.get(0), settings); } throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage); }; /** * @typedef {object} Drupal.AjaxCommands~commandDefinition * * @prop {string} command * @prop {string} [method] * @prop {string} [selector] * @prop {string} [data] * @prop {object} [settings] * @prop {bool} [asterisk] * @prop {string} [text] * @prop {string} [title] * @prop {string} [url] * @prop {object} [argument] * @prop {string} [name] * @prop {string} [value] * @prop {string} [old] * @prop {string} [new] * @prop {bool} [merge] * @prop {Array} [args] * * @see Drupal.AjaxCommands */ /** * Provide a series of commands that the client will perform. * * @constructor */ Drupal.AjaxCommands = function () {}; Drupal.AjaxCommands.prototype = { /** * Command to insert new content into the DOM. * * @param {Drupal.Ajax} ajax * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {string} response.data * The data to use with the jQuery method. * @param {string} [response.method] * The jQuery DOM manipulation method to be used. * @param {string} [response.selector] * A optional jQuery selector string. * @param {object} [response.settings] * An optional array of settings that will be used. * @param {number} [status] * The XMLHttpRequest status. */ insert: function (ajax, response, status) { // Get information from the response. If it is not there, default to // our presets. var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); var method = response.method || ajax.method; var effect = ajax.getEffect(response); var settings; // We don't know what response.data contains: it might be a string of text // without HTML, so don't rely on jQuery correctly interpreting // $(response.data) as new HTML rather than a CSS selector. Also, if // response.data contains top-level text nodes, they get lost with either // $(response.data) or $('<div></div>').replaceWith(response.data). var $new_content_wrapped = $('<div></div>').html(response.data); var $new_content = $new_content_wrapped.contents(); // For legacy reasons, the effects processing code assumes that // $new_content consists of a single top-level element. Also, it has not // been sufficiently tested whether attachBehaviors() can be successfully // called with a context object that includes top-level text nodes. // However, to give developers full control of the HTML appearing in the // page, and to enable Ajax content to be inserted in places where <div> // elements are not allowed (e.g., within <table>, <tr>, and <span> // parents), we check if the new content satisfies the requirement // of a single top-level element, and only use the container <div> created // above when it doesn't. For more information, please see // https://www.drupal.org/node/736066. if ($new_content.length !== 1 || $new_content.get(0).nodeType !== 1) { $new_content = $new_content_wrapped; } // If removing content from the wrapper, detach behaviors first. switch (method) { case 'html': case 'replaceWith': case 'replaceAll': case 'empty': case 'remove': settings = response.settings || ajax.settings || drupalSettings; Drupal.detachBehaviors($wrapper.get(0), settings); } // Add the new content to the page. $wrapper[method]($new_content); // Immediately hide the new content if we're using any effects. if (effect.showEffect !== 'show') { $new_content.hide(); } // Determine which effect to use and what content will receive the // effect, then show the new content. if ($new_content.find('.ajax-new-content').length > 0) { $new_content.find('.ajax-new-content').hide(); $new_content.show(); $new_content.find('.ajax-new-content')[effect.showEffect](effect.showSpeed); } else if (effect.showEffect !== 'show') { $new_content[effect.showEffect](effect.showSpeed); } // Attach all JavaScript behaviors to the new content, if it was // successfully added to the page, this if statement allows // `#ajax['wrapper']` to be optional. if ($new_content.parents('html').length > 0) { // Apply any settings from the returned JSON if available. settings = response.settings || ajax.settings || drupalSettings; Drupal.attachBehaviors($new_content.get(0), settings); } }, /** * Command to remove a chunk from the page. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {string} response.selector * A jQuery selector string. * @param {object} [response.settings] * An optional array of settings that will be used. * @param {number} [status] * The XMLHttpRequest status. */ remove: function (ajax, response, status) { var settings = response.settings || ajax.settings || drupalSettings; $(response.selector).each(function () { Drupal.detachBehaviors(this, settings); }) .remove(); }, /** * Command to mark a chunk changed. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The JSON response object from the Ajax request. * @param {string} response.selector * A jQuery selector string. * @param {bool} [response.asterisk] * An optional CSS selector. If specified, an asterisk will be * appended to the HTML inside the provided selector. * @param {number} [status] * The request status. */ changed: function (ajax, response, status) { var $element = $(response.selector); if (!$element.hasClass('ajax-changed')) { $element.addClass('ajax-changed'); if (response.asterisk) { $element.find(response.asterisk).append(' <abbr class="ajax-changed" title="' + Drupal.t('Changed') + '">*</abbr> '); } } }, /** * Command to provide an alert. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The JSON response from the Ajax request. * @param {string} response.text * The text that will be displayed in an alert dialog. * @param {number} [status] * The XMLHttpRequest status. */ alert: function (ajax, response, status) { window.alert(response.text, response.title); }, /** * Command to set the window.location, redirecting the browser. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {string} response.url * The URL to redirect to. * @param {number} [status] * The XMLHttpRequest status. */ redirect: function (ajax, response, status) { window.location = response.url; }, /** * Command to provide the jQuery css() function. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {string} response.selector * A jQuery selector string. * @param {object} response.argument * An array of key/value pairs to set in the CSS for the selector. * @param {number} [status] * The XMLHttpRequest status. */ css: function (ajax, response, status) { $(response.selector).css(response.argument); }, /** * Command to set the settings used for other commands in this response. * * This method will also remove expired `drupalSettings.ajax` settings. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {bool} response.merge * Determines whether the additional settings should be merged to the * global settings. * @param {object} response.settings * Contains additional settings to add to the global settings. * @param {number} [status] * The XMLHttpRequest status. */ settings: function (ajax, response, status) { var ajaxSettings = drupalSettings.ajax; // Clean up drupalSettings.ajax. if (ajaxSettings) { Drupal.ajax.expired().forEach(function (instance) { // If the Ajax object has been created through drupalSettings.ajax // it will have a selector. When there is no selector the object // has been initialized with a special class name picked up by the // Ajax behavior. if (instance.selector) { var selector = instance.selector.replace('#', ''); if (selector in ajaxSettings) { delete ajaxSettings[selector]; } } }); } if (response.merge) { $.extend(true, drupalSettings, response.settings); } else { ajax.settings = response.settings; } }, /** * Command to attach data using jQuery's data API. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {string} response.name * The name or key (in the key value pair) of the data attached to this * selector. * @param {string} response.selector * A jQuery selector string. * @param {string|object} response.value * The value of to be attached. * @param {number} [status] * The XMLHttpRequest status. */ data: function (ajax, response, status) { $(response.selector).data(response.name, response.value); }, /** * Command to apply a jQuery method. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {Array} response.args * An array of arguments to the jQuery method, if any. * @param {string} response.method * The jQuery method to invoke. * @param {string} response.selector * A jQuery selector string. * @param {number} [status] * The XMLHttpRequest status. */ invoke: function (ajax, response, status) { var $element = $(response.selector); $element[response.method].apply($element, response.args); }, /** * Command to restripe a table. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {string} response.selector * A jQuery selector string. * @param {number} [status] * The XMLHttpRequest status. */ restripe: function (ajax, response, status) { // :even and :odd are reversed because jQuery counts from 0 and // we count from 1, so we're out of sync. // Match immediate children of the parent element to allow nesting. $(response.selector).find('> tbody > tr:visible, > tr:visible') .removeClass('odd even') .filter(':even').addClass('odd').end() .filter(':odd').addClass('even'); }, /** * Command to update a form's build ID. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {string} response.old * The old form build ID. * @param {string} response.new * The new form build ID. * @param {number} [status] * The XMLHttpRequest status. */ update_build_id: function (ajax, response, status) { $('input[name="form_build_id"][value="' + response.old + '"]').val(response.new); }, /** * Command to add css. * * Uses the proprietary addImport method if available as browsers which * support that method ignore @import statements in dynamically added * stylesheets. * * @param {Drupal.Ajax} [ajax] * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * The response from the Ajax request. * @param {string} response.data * A string that contains the styles to be added. * @param {number} [status] * The XMLHttpRequest status. */ add_css: function (ajax, response, status) { // Add the styles in the normal way. $('head').prepend(response.data); // Add imports in the styles using the addImport method if available. var match; var importMatch = /^@import url\("(.*)"\);$/igm; if (document.styleSheets[0].addImport && importMatch.test(response.data)) { importMatch.lastIndex = 0; do { match = importMatch.exec(response.data); document.styleSheets[0].addImport(match[1]); } while (match); } } }; })(jQuery, window, Drupal, drupalSettings); ; /** * @file * Adds an HTML element and method to trigger audio UAs to read system messages. * * Use {@link Drupal.announce} to indicate to screen reader users that an * element on the page has changed state. For instance, if clicking a link * loads 10 more items into a list, one might announce the change like this. * * @example * $('#search-list') * .on('itemInsert', function (event, data) { * // Insert the new items. * $(data.container.el).append(data.items.el); * // Announce the change to the page contents. * Drupal.announce(Drupal.t('@count items added to @container', * {'@count': data.items.length, '@container': data.container.title} * )); * }); */ (function (Drupal, debounce) { 'use strict'; var liveElement; var announcements = []; /** * Builds a div element with the aria-live attribute and add it to the DOM. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches the behavior for drupalAnnouce. */ Drupal.behaviors.drupalAnnounce = { attach: function (context) { // Create only one aria-live element. if (!liveElement) { liveElement = document.createElement('div'); liveElement.id = 'drupal-live-announce'; liveElement.className = 'visually-hidden'; liveElement.setAttribute('aria-live', 'polite'); liveElement.setAttribute('aria-busy', 'false'); document.body.appendChild(liveElement); } } }; /** * Concatenates announcements to a single string; appends to the live region. */ function announce() { var text = []; var priority = 'polite'; var announcement; // Create an array of announcement strings to be joined and appended to the // aria live region. var il = announcements.length; for (var i = 0; i < il; i++) { announcement = announcements.pop(); text.unshift(announcement.text); // If any of the announcements has a priority of assertive then the group // of joined announcements will have this priority. if (announcement.priority === 'assertive') { priority = 'assertive'; } } if (text.length) { // Clear the liveElement so that repeated strings will be read. liveElement.innerHTML = ''; // Set the busy state to true until the node changes are complete. liveElement.setAttribute('aria-busy', 'true'); // Set the priority to assertive, or default to polite. liveElement.setAttribute('aria-live', priority); // Print the text to the live region. Text should be run through // Drupal.t() before being passed to Drupal.announce(). liveElement.innerHTML = text.join('\n'); // The live text area is updated. Allow the AT to announce the text. liveElement.setAttribute('aria-busy', 'false'); } } /** * Triggers audio UAs to read the supplied text. * * The aria-live region will only read the text that currently populates its * text node. Replacing text quickly in rapid calls to announce results in * only the text from the most recent call to {@link Drupal.announce} being * read. By wrapping the call to announce in a debounce function, we allow for * time for multiple calls to {@link Drupal.announce} to queue up their * messages. These messages are then joined and append to the aria-live region * as one text node. * * @param {string} text * A string to be read by the UA. * @param {string} [priority='polite'] * A string to indicate the priority of the message. Can be either * 'polite' or 'assertive'. * * @return {function} * The return of the call to debounce. * * @see http://www.w3.org/WAI/PF/aria-practices/#liveprops */ Drupal.announce = function (text, priority) { // Save the text and priority into a closure variable. Multiple simultaneous // announcements will be concatenated and read in sequence. announcements.push({ text: text, priority: priority }); // Immediately invoke the function that debounce returns. 200 ms is right at // the cusp where humans notice a pause, so we will wait // at most this much time before the set of queued announcements is read. return (debounce(announce, 200)()); }; }(Drupal, Drupal.debounce)); ; (function(){if(window.matchMedia&&window.matchMedia("all").addListener){return false}var e=window.matchMedia,i=e("only all").matches,n=false,t=0,a=[],r=function(i){clearTimeout(t);t=setTimeout(function(){for(var i=0,n=a.length;i<n;i++){var t=a[i].mql,r=a[i].listeners||[],o=e(t.media).matches;if(o!==t.matches){t.matches=o;for(var s=0,l=r.length;s<l;s++){r[s].call(window,t)}}}},30)};window.matchMedia=function(t){var o=e(t),s=[],l=0;o.addListener=function(e){if(!i){return}if(!n){n=true;window.addEventListener("resize",r,true)}if(l===0){l=a.push({mql:o,listeners:s})}s.push(e)};o.removeListener=function(e){for(var i=0,n=s.length;i<n;i++){if(s[i]===e){s.splice(i,1)}}};return o}})(); ; /** * @file * Manages elements that can offset the size of the viewport. * * Measures and reports viewport offset dimensions from elements like the * toolbar that can potentially displace the positioning of other elements. */ /** * @typedef {object} Drupal~displaceOffset * * @prop {number} top * @prop {number} left * @prop {number} right * @prop {number} bottom */ /** * Triggers when layout of the page changes. * * This is used to position fixed element on the page during page resize and * Toolbar toggling. * * @event drupalViewportOffsetChange */ (function ($, Drupal, debounce) { 'use strict'; /** * @name Drupal.displace.offsets * * @type {Drupal~displaceOffset} */ var offsets = { top: 0, right: 0, bottom: 0, left: 0 }; /** * Registers a resize handler on the window. * * @type {Drupal~behavior} */ Drupal.behaviors.drupalDisplace = { attach: function () { // Mark this behavior as processed on the first pass. if (this.displaceProcessed) { return; } this.displaceProcessed = true; $(window).on('resize.drupalDisplace', debounce(displace, 200)); } }; /** * Informs listeners of the current offset dimensions. * * @function Drupal.displace * * @prop {Drupal~displaceOffset} offsets * * @param {bool} [broadcast] * When true or undefined, causes the recalculated offsets values to be * broadcast to listeners. * * @return {Drupal~displaceOffset} * An object whose keys are the for sides an element -- top, right, bottom * and left. The value of each key is the viewport displacement distance for * that edge. * * @fires event:drupalViewportOffsetChange */ function displace(broadcast) { offsets = Drupal.displace.offsets = calculateOffsets(); if (typeof broadcast === 'undefined' || broadcast) { $(document).trigger('drupalViewportOffsetChange', offsets); } return offsets; } /** * Determines the viewport offsets. * * @return {Drupal~displaceOffset} * An object whose keys are the for sides an element -- top, right, bottom * and left. The value of each key is the viewport displacement distance for * that edge. */ function calculateOffsets() { return { top: calculateOffset('top'), right: calculateOffset('right'), bottom: calculateOffset('bottom'), left: calculateOffset('left') }; } /** * Gets a specific edge's offset. * * Any element with the attribute data-offset-{edge} e.g. data-offset-top will * be considered in the viewport offset calculations. If the attribute has a * numeric value, that value will be used. If no value is provided, one will * be calculated using the element's dimensions and placement. * * @function Drupal.displace.calculateOffset * * @param {string} edge * The name of the edge to calculate. Can be 'top', 'right', * 'bottom' or 'left'. * * @return {number} * The viewport displacement distance for the requested edge. */ function calculateOffset(edge) { var edgeOffset = 0; var displacingElements = document.querySelectorAll('[data-offset-' + edge + ']'); var n = displacingElements.length; for (var i = 0; i < n; i++) { var el = displacingElements[i]; // If the element is not visible, do consider its dimensions. if (el.style.display === 'none') { continue; } // If the offset data attribute contains a displacing value, use it. var displacement = parseInt(el.getAttribute('data-offset-' + edge), 10); // If the element's offset data attribute exits // but is not a valid number then get the displacement // dimensions directly from the element. if (isNaN(displacement)) { displacement = getRawOffset(el, edge); } // If the displacement value is larger than the current value for this // edge, use the displacement value. edgeOffset = Math.max(edgeOffset, displacement); } return edgeOffset; } /** * Calculates displacement for element based on its dimensions and placement. * * @param {HTMLElement} el * The jQuery element whose dimensions and placement will be measured. * * @param {string} edge * The name of the edge of the viewport that the element is associated * with. * * @return {number} * The viewport displacement distance for the requested edge. */ function getRawOffset(el, edge) { var $el = $(el); var documentElement = document.documentElement; var displacement = 0; var horizontal = (edge === 'left' || edge === 'right'); // Get the offset of the element itself. var placement = $el.offset()[horizontal ? 'left' : 'top']; // Subtract scroll distance from placement to get the distance // to the edge of the viewport. placement -= window['scroll' + (horizontal ? 'X' : 'Y')] || document.documentElement['scroll' + (horizontal ? 'Left' : 'Top')] || 0; // Find the displacement value according to the edge. switch (edge) { // Left and top elements displace as a sum of their own offset value // plus their size. case 'top': // Total displacement is the sum of the elements placement and size. displacement = placement + $el.outerHeight(); break; case 'left': // Total displacement is the sum of the elements placement and size. displacement = placement + $el.outerWidth(); break; // Right and bottom elements displace according to their left and // top offset. Their size isn't important. case 'bottom': displacement = documentElement.clientHeight - placement; break; case 'right': displacement = documentElement.clientWidth - placement; break; default: displacement = 0; } return displacement; } /** * Assign the displace function to a property of the Drupal global object. * * @ignore */ Drupal.displace = displace; $.extend(Drupal.displace, { /** * Expose offsets to other scripts to avoid having to recalculate offsets. * * @ignore */ offsets: offsets, /** * Expose method to compute a single edge offsets. * * @ignore */ calculateOffset: calculateOffset }); })(jQuery, Drupal, Drupal.debounce); ; /** * @file * Builds a nested accordion widget. * * Invoke on an HTML list element with the jQuery plugin pattern. * * @example * $('.toolbar-menu').drupalToolbarMenu(); */ (function ($, Drupal, drupalSettings) { 'use strict'; /** * Store the open menu tray. */ var activeItem = Drupal.url(drupalSettings.path.currentPath); $.fn.drupalToolbarMenu = function () { var ui = { handleOpen: Drupal.t('Extend'), handleClose: Drupal.t('Collapse') }; /** * Handle clicks from the disclosure button on an item with sub-items. * * @param {Object} event * A jQuery Event object. */ function toggleClickHandler(event) { var $toggle = $(event.target); var $item = $toggle.closest('li'); // Toggle the list item. toggleList($item); // Close open sibling menus. var $openItems = $item.siblings().filter('.open'); toggleList($openItems, false); } /** * Handle clicks from a menu item link. * * @param {Object} event * A jQuery Event object. */ function linkClickHandler(event) { // If the toolbar is positioned fixed (and therefore hiding content // underneath), then users expect clicks in the administration menu tray // to take them to that destination but for the menu tray to be closed // after clicking: otherwise the toolbar itself is obstructing the view // of the destination they chose. if (!Drupal.toolbar.models.toolbarModel.get('isFixed')) { Drupal.toolbar.models.toolbarModel.set('activeTab', null); } // Stopping propagation to make sure that once a toolbar-box is clicked // (the whitespace part), the page is not redirected anymore. event.stopPropagation(); } /** * Toggle the open/close state of a list is a menu. * * @param {jQuery} $item * The li item to be toggled. * * @param {Boolean} switcher * A flag that forces toggleClass to add or a remove a class, rather than * simply toggling its presence. */ function toggleList($item, switcher) { var $toggle = $item.children('.toolbar-box').children('.toolbar-handle'); switcher = (typeof switcher !== 'undefined') ? switcher : !$item.hasClass('open'); // Toggle the item open state. $item.toggleClass('open', switcher); // Twist the toggle. $toggle.toggleClass('open', switcher); // Adjust the toggle text. $toggle .find('.action') // Expand Structure, Collapse Structure. .text((switcher) ? ui.handleClose : ui.handleOpen); } /** * Add markup to the menu elements. * * Items with sub-elements have a list toggle attached to them. Menu item * links and the corresponding list toggle are wrapped with in a div * classed with .toolbar-box. The .toolbar-box div provides a positioning * context for the item list toggle. * * @param {jQuery} $menu * The root of the menu to be initialized. */ function initItems($menu) { var options = { class: 'toolbar-icon toolbar-handle', action: ui.handleOpen, text: '' }; // Initialize items and their links. $menu.find('li > a').wrap('<div class="toolbar-box">'); // Add a handle to each list item if it has a menu. $menu.find('li').each(function (index, element) { var $item = $(element); if ($item.children('ul.toolbar-menu').length) { var $box = $item.children('.toolbar-box'); options.text = Drupal.t('@label', {'@label': $box.find('a').text()}); $item.children('.toolbar-box') .append(Drupal.theme('toolbarMenuItemToggle', options)); } }); } /** * Adds a level class to each list based on its depth in the menu. * * This function is called recursively on each sub level of lists elements * until the depth of the menu is exhausted. * * @param {jQuery} $lists * A jQuery object of ul elements. * * @param {number} level * The current level number to be assigned to the list elements. */ function markListLevels($lists, level) { level = (!level) ? 1 : level; var $lis = $lists.children('li').addClass('level-' + level); $lists = $lis.children('ul'); if ($lists.length) { markListLevels($lists, level + 1); } } /** * On page load, open the active menu item. * * Marks the trail of the active link in the menu back to the root of the * menu with .menu-item--active-trail. * * @param {jQuery} $menu * The root of the menu. */ function openActiveItem($menu) { var pathItem = $menu.find('a[href="' + location.pathname + '"]'); if (pathItem.length && !activeItem) { activeItem = location.pathname; } if (activeItem) { var $activeItem = $menu.find('a[href="' + activeItem + '"]').addClass('menu-item--active'); var $activeTrail = $activeItem.parentsUntil('.root', 'li').addClass('menu-item--active-trail'); toggleList($activeTrail, true); } } // Return the jQuery object. return this.each(function (selector) { var $menu = $(this).once('toolbar-menu'); if ($menu.length) { // Bind event handlers. $menu .on('click.toolbar', '.toolbar-box', toggleClickHandler) .on('click.toolbar', '.toolbar-box a', linkClickHandler); $menu.addClass('root'); initItems($menu); markListLevels($menu); // Restore previous and active states. openActiveItem($menu); } }); }; /** * A toggle is an interactive element often bound to a click handler. * * @param {object} options * Options for the button. * @param {string} options.class * Class to set on the button. * @param {string} options.action * Action for the button. * @param {string} options.text * Used as label for the button. * * @return {string} * A string representing a DOM fragment. */ Drupal.theme.toolbarMenuItemToggle = function (options) { return '<button class="' + options['class'] + '"><span class="action">' + options.action + '</span><span class="label">' + options.text + '</span></button>'; }; }(jQuery, Drupal, drupalSettings)); ; /** * @file * Defines the behavior of the Drupal administration toolbar. */ (function ($, Drupal, drupalSettings) { 'use strict'; // Merge run-time settings with the defaults. var options = $.extend( { breakpoints: { 'toolbar.narrow': '', 'toolbar.standard': '', 'toolbar.wide': '' } }, drupalSettings.toolbar, // Merge strings on top of drupalSettings so that they are not mutable. { strings: { horizontal: Drupal.t('Horizontal orientation'), vertical: Drupal.t('Vertical orientation') } } ); /** * Registers tabs with the toolbar. * * The Drupal toolbar allows modules to register top-level tabs. These may * point directly to a resource or toggle the visibility of a tray. * * Modules register tabs with hook_toolbar(). * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches the toolbar rendering functionality to the toolbar element. */ Drupal.behaviors.toolbar = { attach: function (context) { // Verify that the user agent understands media queries. Complex admin // toolbar layouts require media query support. if (!window.matchMedia('only screen').matches) { return; } // Process the administrative toolbar. $(context).find('#toolbar-administration').once('toolbar').each(function () { // Establish the toolbar models and views. var model = Drupal.toolbar.models.toolbarModel = new Drupal.toolbar.ToolbarModel({ locked: JSON.parse(localStorage.getItem('Drupal.toolbar.trayVerticalLocked')) || false, activeTab: document.getElementById(JSON.parse(localStorage.getItem('Drupal.toolbar.activeTabID'))) }); Drupal.toolbar.views.toolbarVisualView = new Drupal.toolbar.ToolbarVisualView({ el: this, model: model, strings: options.strings }); Drupal.toolbar.views.toolbarAuralView = new Drupal.toolbar.ToolbarAuralView({ el: this, model: model, strings: options.strings }); Drupal.toolbar.views.bodyVisualView = new Drupal.toolbar.BodyVisualView({ el: this, model: model }); // Render collapsible menus. var menuModel = Drupal.toolbar.models.menuModel = new Drupal.toolbar.MenuModel(); Drupal.toolbar.views.menuVisualView = new Drupal.toolbar.MenuVisualView({ el: $(this).find('.toolbar-menu-administration').get(0), model: menuModel, strings: options.strings }); // Handle the resolution of Drupal.toolbar.setSubtrees. // This is handled with a deferred so that the function may be invoked // asynchronously. Drupal.toolbar.setSubtrees.done(function (subtrees) { menuModel.set('subtrees', subtrees); var theme = drupalSettings.ajaxPageState.theme; localStorage.setItem('Drupal.toolbar.subtrees.' + theme, JSON.stringify(subtrees)); // Indicate on the toolbarModel that subtrees are now loaded. model.set('areSubtreesLoaded', true); }); // Attach a listener to the configured media query breakpoints. for (var label in options.breakpoints) { if (options.breakpoints.hasOwnProperty(label)) { var mq = options.breakpoints[label]; var mql = Drupal.toolbar.mql[label] = window.matchMedia(mq); // Curry the model and the label of the media query breakpoint to // the mediaQueryChangeHandler function. mql.addListener(Drupal.toolbar.mediaQueryChangeHandler.bind(null, model, label)); // Fire the mediaQueryChangeHandler for each configured breakpoint // so that they process once. Drupal.toolbar.mediaQueryChangeHandler.call(null, model, label, mql); } } // Trigger an initial attempt to load menu subitems. This first attempt // is made after the media query handlers have had an opportunity to // process. The toolbar starts in the vertical orientation by default, // unless the viewport is wide enough to accommodate a horizontal // orientation. Thus we give the Toolbar a chance to determine if it // should be set to horizontal orientation before attempting to load // menu subtrees. Drupal.toolbar.views.toolbarVisualView.loadSubtrees(); $(document) // Update the model when the viewport offset changes. .on('drupalViewportOffsetChange.toolbar', function (event, offsets) { model.set('offsets', offsets); }); // Broadcast model changes to other modules. model .on('change:orientation', function (model, orientation) { $(document).trigger('drupalToolbarOrientationChange', orientation); }) .on('change:activeTab', function (model, tab) { $(document).trigger('drupalToolbarTabChange', tab); }) .on('change:activeTray', function (model, tray) { $(document).trigger('drupalToolbarTrayChange', tray); }); // If the toolbar's orientation is horizontal and no active tab is // defined then show the tray of the first toolbar tab by default (but // not the first 'Home' toolbar tab). if (Drupal.toolbar.models.toolbarModel.get('orientation') === 'horizontal' && Drupal.toolbar.models.toolbarModel.get('activeTab') === null) { Drupal.toolbar.models.toolbarModel.set({ activeTab: $('.toolbar-bar .toolbar-tab:not(.home-toolbar-tab) a').get(0) }); } }); } }; /** * Toolbar methods of Backbone objects. * * @namespace */ Drupal.toolbar = { /** * A hash of View instances. * * @type {object.<string, Backbone.View>} */ views: {}, /** * A hash of Model instances. * * @type {object.<string, Backbone.Model>} */ models: {}, /** * A hash of MediaQueryList objects tracked by the toolbar. * * @type {object.<string, object>} */ mql: {}, /** * Accepts a list of subtree menu elements. * * A deferred object that is resolved by an inlined JavaScript callback. * * @type {jQuery.Deferred} * * @see toolbar_subtrees_jsonp(). */ setSubtrees: new $.Deferred(), /** * Respond to configured narrow media query changes. * * @param {Drupal.toolbar.ToolbarModel} model * A toolbar model * @param {string} label * Media query label. * @param {object} mql * A MediaQueryList object. */ mediaQueryChangeHandler: function (model, label, mql) { switch (label) { case 'toolbar.narrow': model.set({ isOriented: mql.matches, isTrayToggleVisible: false }); // If the toolbar doesn't have an explicit orientation yet, or if the // narrow media query doesn't match then set the orientation to // vertical. if (!mql.matches || !model.get('orientation')) { model.set({orientation: 'vertical'}, {validate: true}); } break; case 'toolbar.standard': model.set({ isFixed: mql.matches }); break; case 'toolbar.wide': model.set({ orientation: ((mql.matches) ? 'horizontal' : 'vertical') }, {validate: true}); // The tray orientation toggle visibility does not need to be // validated. model.set({ isTrayToggleVisible: mql.matches }); break; default: break; } } }; /** * A toggle is an interactive element often bound to a click handler. * * @return {string} * A string representing a DOM fragment. */ Drupal.theme.toolbarOrientationToggle = function () { return '<div class="toolbar-toggle-orientation"><div class="toolbar-lining">' + '<button class="toolbar-icon" type="button"></button>' + '</div></div>'; }; /** * Ajax command to set the toolbar subtrees. * * @param {Drupal.Ajax} ajax * {@link Drupal.Ajax} object created by {@link Drupal.ajax}. * @param {object} response * JSON response from the Ajax request. * @param {number} [status] * XMLHttpRequest status. */ Drupal.AjaxCommands.prototype.setToolbarSubtrees = function (ajax, response, status) { Drupal.toolbar.setSubtrees.resolve(response.subtrees); }; }(jQuery, Drupal, drupalSettings)); ; /** * @file * A Backbone Model for collapsible menus. */ (function (Backbone, Drupal) { 'use strict'; /** * Backbone Model for collapsible menus. * * @constructor * * @augments Backbone.Model */ Drupal.toolbar.MenuModel = Backbone.Model.extend(/** @lends Drupal.toolbar.MenuModel# */{ /** * @type {object} * * @prop {object} subtrees */ defaults: /** @lends Drupal.toolbar.MenuModel# */{ /** * @type {object} */ subtrees: {} } }); }(Backbone, Drupal)); ; /** * @file * A Backbone Model for the toolbar. */ (function (Backbone, Drupal) { 'use strict'; /** * Backbone model for the toolbar. * * @constructor * * @augments Backbone.Model */ Drupal.toolbar.ToolbarModel = Backbone.Model.extend(/** @lends Drupal.toolbar.ToolbarModel# */{ /** * @type {object} * * @prop activeTab * @prop activeTray * @prop isOriented * @prop isFixed * @prop areSubtreesLoaded * @prop isViewportOverflowConstrained * @prop orientation * @prop locked * @prop isTrayToggleVisible * @prop height * @prop offsets */ defaults: /** @lends Drupal.toolbar.ToolbarModel# */{ /** * The active toolbar tab. All other tabs should be inactive under * normal circumstances. It will remain active across page loads. The * active item is stored as an ID selector e.g. '#toolbar-item--1'. * * @type {string} */ activeTab: null, /** * Represents whether a tray is open or not. Stored as an ID selector e.g. * '#toolbar-item--1-tray'. * * @type {string} */ activeTray: null, /** * Indicates whether the toolbar is displayed in an oriented fashion, * either horizontal or vertical. * * @type {bool} */ isOriented: false, /** * Indicates whether the toolbar is positioned absolute (false) or fixed * (true). * * @type {bool} */ isFixed: false, /** * Menu subtrees are loaded through an AJAX request only when the Toolbar * is set to a vertical orientation. * * @type {bool} */ areSubtreesLoaded: false, /** * If the viewport overflow becomes constrained, isFixed must be true so * that elements in the trays aren't lost off-screen and impossible to * get to. * * @type {bool} */ isViewportOverflowConstrained: false, /** * The orientation of the active tray. * * @type {string} */ orientation: 'vertical', /** * A tray is locked if a user toggled it to vertical. Otherwise a tray * will switch between vertical and horizontal orientation based on the * configured breakpoints. The locked state will be maintained across page * loads. * * @type {bool} */ locked: false, /** * Indicates whether the tray orientation toggle is visible. * * @type {bool} */ isTrayToggleVisible: false, /** * The height of the toolbar. * * @type {number} */ height: null, /** * The current viewport offsets determined by {@link Drupal.displace}. The * offsets suggest how a module might position is components relative to * the viewport. * * @type {object} * * @prop {number} top * @prop {number} right * @prop {number} bottom * @prop {number} left */ offsets: { top: 0, right: 0, bottom: 0, left: 0 } }, /** * @inheritdoc * * @param {object} attributes * Attributes for the toolbar. * @param {object} options * Options for the toolbar. * * @return {string|undefined} * Returns an error message if validation failed. */ validate: function (attributes, options) { // Prevent the orientation being set to horizontal if it is locked, unless // override has not been passed as an option. if (attributes.orientation === 'horizontal' && this.get('locked') && !options.override) { return Drupal.t('The toolbar cannot be set to a horizontal orientation when it is locked.'); } } }); }(Backbone, Drupal)); ; /** * @file * A Backbone view for the body element. */ (function ($, Drupal, Backbone) { 'use strict'; Drupal.toolbar.BodyVisualView = Backbone.View.extend(/** @lends Drupal.toolbar.BodyVisualView# */{ /** * Adjusts the body element with the toolbar position and dimension changes. * * @constructs * * @augments Backbone.View */ initialize: function () { this.listenTo(this.model, 'change:orientation change:offsets change:activeTray change:isOriented change:isFixed change:isViewportOverflowConstrained', this.render); }, /** * @inheritdoc */ render: function () { var $body = $('body'); var orientation = this.model.get('orientation'); var isOriented = this.model.get('isOriented'); var isViewportOverflowConstrained = this.model.get('isViewportOverflowConstrained'); $body // We are using JavaScript to control media-query handling for two // reasons: (1) Using JavaScript let's us leverage the breakpoint // configurations and (2) the CSS is really complex if we try to hide // some styling from browsers that don't understand CSS media queries. // If we drive the CSS from classes added through JavaScript, // then the CSS becomes simpler and more robust. .toggleClass('toolbar-vertical', (orientation === 'vertical')) .toggleClass('toolbar-horizontal', (isOriented && orientation === 'horizontal')) // When the toolbar is fixed, it will not scroll with page scrolling. .toggleClass('toolbar-fixed', (isViewportOverflowConstrained || this.model.get('isFixed'))) // Toggle the toolbar-tray-open class on the body element. The class is // applied when a toolbar tray is active. Padding might be applied to // the body element to prevent the tray from overlapping content. .toggleClass('toolbar-tray-open', !!this.model.get('activeTray')) // Apply padding to the top of the body to offset the placement of the // toolbar bar element. .css('padding-top', this.model.get('offsets').top); } }); }(jQuery, Drupal, Backbone)); ; /** * @file * A Backbone view for the collapsible menus. */ (function ($, Backbone, Drupal) { 'use strict'; Drupal.toolbar.MenuVisualView = Backbone.View.extend(/** @lends Drupal.toolbar.MenuVisualView# */{ /** * Backbone View for collapsible menus. * * @constructs * * @augments Backbone.View */ initialize: function () { this.listenTo(this.model, 'change:subtrees', this.render); }, /** * @inheritdoc */ render: function () { var subtrees = this.model.get('subtrees'); // Add subtrees. for (var id in subtrees) { if (subtrees.hasOwnProperty(id)) { this.$el .find('#toolbar-link-' + id) .once('toolbar-subtrees') .after(subtrees[id]); } } // Render the main menu as a nested, collapsible accordion. if ('drupalToolbarMenu' in $.fn) { this.$el .children('.toolbar-menu') .drupalToolbarMenu(); } } }); }(jQuery, Backbone, Drupal)); ; /** * @file * A Backbone view for the aural feedback of the toolbar. */ (function (Backbone, Drupal) { 'use strict'; Drupal.toolbar.ToolbarAuralView = Backbone.View.extend(/** @lends Drupal.toolbar.ToolbarAuralView# */{ /** * Backbone view for the aural feedback of the toolbar. * * @constructs * * @augments Backbone.View * * @param {object} options * Options for the view. * @param {object} options.strings * Various strings to use in the view. */ initialize: function (options) { this.strings = options.strings; this.listenTo(this.model, 'change:orientation', this.onOrientationChange); this.listenTo(this.model, 'change:activeTray', this.onActiveTrayChange); }, /** * Announces an orientation change. * * @param {Drupal.toolbar.ToolbarModel} model * The toolbar model in question. * @param {string} orientation * The new value of the orientation attribute in the model. */ onOrientationChange: function (model, orientation) { Drupal.announce(Drupal.t('Tray orientation changed to @orientation.', { '@orientation': orientation })); }, /** * Announces a changed active tray. * * @param {Drupal.toolbar.ToolbarModel} model * The toolbar model in question. * @param {HTMLElement} tray * The new value of the tray attribute in the model. */ onActiveTrayChange: function (model, tray) { var relevantTray = (tray === null) ? model.previous('activeTray') : tray; var action = (tray === null) ? Drupal.t('closed') : Drupal.t('opened'); var trayNameElement = relevantTray.querySelector('.toolbar-tray-name'); var text; if (trayNameElement !== null) { text = Drupal.t('Tray "@tray" @action.', { '@tray': trayNameElement.textContent, '@action': action }); } else { text = Drupal.t('Tray @action.', {'@action': action}); } Drupal.announce(text); } }); }(Backbone, Drupal)); ; /** * @file * A Backbone view for the toolbar element. Listens to mouse & touch. */ (function ($, Drupal, drupalSettings, Backbone) { 'use strict'; Drupal.toolbar.ToolbarVisualView = Backbone.View.extend(/** @lends Drupal.toolbar.ToolbarVisualView# */{ /** * Event map for the `ToolbarVisualView`. * * @return {object} * A map of events. */ events: function () { // Prevents delay and simulated mouse events. var touchEndToClick = function (event) { event.preventDefault(); event.target.click(); }; return { 'click .toolbar-bar .toolbar-tab .trigger': 'onTabClick', 'click .toolbar-toggle-orientation button': 'onOrientationToggleClick', 'touchend .toolbar-bar .toolbar-tab .trigger': touchEndToClick, 'touchend .toolbar-toggle-orientation button': touchEndToClick }; }, /** * Backbone view for the toolbar element. Listens to mouse & touch. * * @constructs * * @augments Backbone.View * * @param {object} options * Options for the view object. * @param {object} options.strings * Various strings to use in the view. */ initialize: function (options) { this.strings = options.strings; this.listenTo(this.model, 'change:activeTab change:orientation change:isOriented change:isTrayToggleVisible', this.render); this.listenTo(this.model, 'change:mqMatches', this.onMediaQueryChange); this.listenTo(this.model, 'change:offsets', this.adjustPlacement); // Add the tray orientation toggles. this.$el .find('.toolbar-tray .toolbar-lining') .append(Drupal.theme('toolbarOrientationToggle')); // Trigger an activeTab change so that listening scripts can respond on // page load. This will call render. this.model.trigger('change:activeTab'); }, /** * @inheritdoc * * @return {Drupal.toolbar.ToolbarVisualView} * The `ToolbarVisualView` instance. */ render: function () { this.updateTabs(); this.updateTrayOrientation(); this.updateBarAttributes(); // Load the subtrees if the orientation of the toolbar is changed to // vertical. This condition responds to the case that the toolbar switches // from horizontal to vertical orientation. The toolbar starts in a // vertical orientation by default and then switches to horizontal during // initialization if the media query conditions are met. Simply checking // that the orientation is vertical here would result in the subtrees // always being loaded, even when the toolbar initialization ultimately // results in a horizontal orientation. // // @see Drupal.behaviors.toolbar.attach() where admin menu subtrees // loading is invoked during initialization after media query conditions // have been processed. if (this.model.changed.orientation === 'vertical' || this.model.changed.activeTab) { this.loadSubtrees(); } // Trigger a recalculation of viewport displacing elements. Use setTimeout // to ensure this recalculation happens after changes to visual elements // have processed. window.setTimeout(function () { Drupal.displace(true); }, 0); return this; }, /** * Responds to a toolbar tab click. * * @param {jQuery.Event} event * The event triggered. */ onTabClick: function (event) { // If this tab has a tray associated with it, it is considered an // activatable tab. if (event.target.hasAttribute('data-toolbar-tray')) { var activeTab = this.model.get('activeTab'); var clickedTab = event.target; // Set the event target as the active item if it is not already. this.model.set('activeTab', (!activeTab || clickedTab !== activeTab) ? clickedTab : null); event.preventDefault(); event.stopPropagation(); } }, /** * Toggles the orientation of a toolbar tray. * * @param {jQuery.Event} event * The event triggered. */ onOrientationToggleClick: function (event) { var orientation = this.model.get('orientation'); // Determine the toggle-to orientation. var antiOrientation = (orientation === 'vertical') ? 'horizontal' : 'vertical'; var locked = antiOrientation === 'vertical'; // Remember the locked state. if (locked) { localStorage.setItem('Drupal.toolbar.trayVerticalLocked', 'true'); } else { localStorage.removeItem('Drupal.toolbar.trayVerticalLocked'); } // Update the model. this.model.set({ locked: locked, orientation: antiOrientation }, { validate: true, override: true }); event.preventDefault(); event.stopPropagation(); }, /** * Updates the display of the tabs: toggles a tab and the associated tray. */ updateTabs: function () { var $tab = $(this.model.get('activeTab')); // Deactivate the previous tab. $(this.model.previous('activeTab')) .removeClass('is-active') .prop('aria-pressed', false); // Deactivate the previous tray. $(this.model.previous('activeTray')) .removeClass('is-active'); // Activate the selected tab. if ($tab.length > 0) { $tab .addClass('is-active') // Mark the tab as pressed. .prop('aria-pressed', true); var name = $tab.attr('data-toolbar-tray'); // Store the active tab name or remove the setting. var id = $tab.get(0).id; if (id) { localStorage.setItem('Drupal.toolbar.activeTabID', JSON.stringify(id)); } // Activate the associated tray. var $tray = this.$el.find('[data-toolbar-tray="' + name + '"].toolbar-tray'); if ($tray.length) { $tray.addClass('is-active'); this.model.set('activeTray', $tray.get(0)); } else { // There is no active tray. this.model.set('activeTray', null); } } else { // There is no active tray. this.model.set('activeTray', null); localStorage.removeItem('Drupal.toolbar.activeTabID'); } }, /** * Update the attributes of the toolbar bar element. */ updateBarAttributes: function () { var isOriented = this.model.get('isOriented'); if (isOriented) { this.$el.find('.toolbar-bar').attr('data-offset-top', ''); } else { this.$el.find('.toolbar-bar').removeAttr('data-offset-top'); } // Toggle between a basic vertical view and a more sophisticated // horizontal and vertical display of the toolbar bar and trays. this.$el.toggleClass('toolbar-oriented', isOriented); }, /** * Updates the orientation of the active tray if necessary. */ updateTrayOrientation: function () { var orientation = this.model.get('orientation'); // The antiOrientation is used to render the view of action buttons like // the tray orientation toggle. var antiOrientation = (orientation === 'vertical') ? 'horizontal' : 'vertical'; // Update the orientation of the trays. var $trays = this.$el.find('.toolbar-tray') .removeClass('toolbar-tray-horizontal toolbar-tray-vertical') .addClass('toolbar-tray-' + orientation); // Update the tray orientation toggle button. var iconClass = 'toolbar-icon-toggle-' + orientation; var iconAntiClass = 'toolbar-icon-toggle-' + antiOrientation; var $orientationToggle = this.$el.find('.toolbar-toggle-orientation') .toggle(this.model.get('isTrayToggleVisible')); $orientationToggle.find('button') .val(antiOrientation) .attr('title', this.strings[antiOrientation]) .text(this.strings[antiOrientation]) .removeClass(iconClass) .addClass(iconAntiClass); // Update data offset attributes for the trays. var dir = document.documentElement.dir; var edge = (dir === 'rtl') ? 'right' : 'left'; // Remove data-offset attributes from the trays so they can be refreshed. $trays.removeAttr('data-offset-left data-offset-right data-offset-top'); // If an active vertical tray exists, mark it as an offset element. $trays.filter('.toolbar-tray-vertical.is-active').attr('data-offset-' + edge, ''); // If an active horizontal tray exists, mark it as an offset element. $trays.filter('.toolbar-tray-horizontal.is-active').attr('data-offset-top', ''); }, /** * Sets the tops of the trays so that they align with the bottom of the bar. */ adjustPlacement: function () { var $trays = this.$el.find('.toolbar-tray'); if (!this.model.get('isOriented')) { $trays.css('margin-top', 0); $trays.removeClass('toolbar-tray-horizontal').addClass('toolbar-tray-vertical'); } else { // The toolbar container is invisible. Its placement is used to // determine the container for the trays. $trays.css('margin-top', this.$el.find('.toolbar-bar').outerHeight()); } }, /** * Calls the endpoint URI that builds an AJAX command with the rendered * subtrees. * * The rendered admin menu subtrees HTML is cached on the client in * localStorage until the cache of the admin menu subtrees on the server- * side is invalidated. The subtreesHash is stored in localStorage as well * and compared to the subtreesHash in drupalSettings to determine when the * admin menu subtrees cache has been invalidated. */ loadSubtrees: function () { var $activeTab = $(this.model.get('activeTab')); var orientation = this.model.get('orientation'); // Only load and render the admin menu subtrees if: // (1) They have not been loaded yet. // (2) The active tab is the administration menu tab, indicated by the // presence of the data-drupal-subtrees attribute. // (3) The orientation of the tray is vertical. if (!this.model.get('areSubtreesLoaded') && typeof $activeTab.data('drupal-subtrees') !== 'undefined' && orientation === 'vertical') { var subtreesHash = drupalSettings.toolbar.subtreesHash; var theme = drupalSettings.ajaxPageState.theme; var endpoint = Drupal.url('toolbar/subtrees/' + subtreesHash); var cachedSubtreesHash = localStorage.getItem('Drupal.toolbar.subtreesHash.' + theme); var cachedSubtrees = JSON.parse(localStorage.getItem('Drupal.toolbar.subtrees.' + theme)); var isVertical = this.model.get('orientation') === 'vertical'; // If we have the subtrees in localStorage and the subtree hash has not // changed, then use the cached data. if (isVertical && subtreesHash === cachedSubtreesHash && cachedSubtrees) { Drupal.toolbar.setSubtrees.resolve(cachedSubtrees); } // Only make the call to get the subtrees if the orientation of the // toolbar is vertical. else if (isVertical) { // Remove the cached menu information. localStorage.removeItem('Drupal.toolbar.subtreesHash.' + theme); localStorage.removeItem('Drupal.toolbar.subtrees.' + theme); // The AJAX response's command will trigger the resolve method of the // Drupal.toolbar.setSubtrees Promise. Drupal.ajax({url: endpoint}).execute(); // Cache the hash for the subtrees locally. localStorage.setItem('Drupal.toolbar.subtreesHash.' + theme, subtreesHash); } } } }); }(jQuery, Drupal, drupalSettings, Backbone)); ;
Java
\subsection{Data Structures} Here are the data structures with brief descriptions:\begin{DoxyCompactList} \item\contentsline{section}{{\bf s\_\-finfo} (File info struct. This is directly written as a file header in the file system )}{\pageref{structs__finfo}}{} \item\contentsline{section}{{\bf s\_\-fpath} (File path specifier )}{\pageref{structs__fpath}}{} \item\contentsline{section}{{\bf s\_\-fstream} (Stream struct )}{\pageref{structs__fstream}}{} \end{DoxyCompactList}
Java
/* OtherwiseNode.java -- Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package gnu.xml.transform; import javax.xml.namespace.QName; import javax.xml.transform.TransformerException; import org.w3c.dom.Node; /** * A template node representing an XSL <code>otherwise</code> instruction. * * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a> */ final class OtherwiseNode extends TemplateNode { OtherwiseNode(TemplateNode children, TemplateNode next) { super(children, next); } TemplateNode clone(Stylesheet stylesheet) { return new OtherwiseNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet)); } void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { if (children != null) { children.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } } public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append(']'); return buf.toString(); } }
Java
# # Copyright (C) 2006-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk PKG_NAME:=findutils PKG_VERSION:=4.6.0 PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) PKG_HASH:=ded4c9f73731cd48fec3b6bdaccce896473b6d8e337e9612e16cf1431bb1169d PKG_MAINTAINER:=Daniel Dickinson <cshored@thecshore.com> PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk define Package/findutils/Default TITLE:=GNU Find Utilities SECTION:=utils CATEGORY:=Utilities URL:=https://www.gnu.org/software/findutils/ endef define Package/findutils/description/Default Replace busybox versions of findutils with full GNU versions. This is normally not needed as busybox is smaller and provides sufficient functionality, but some users may want or need the full functionality of the GNU tools. endef define Package/findutils $(call Package/findutils/Default) TITLE+= (all) DEPENDS:= \ +findutils-find \ +findutils-xargs \ +findutils-locate endef define Package/findutils-find $(call Package/findutils/Default) TITLE+= - find utility ALTERNATIVES:=300:/usr/bin/find:/usr/libexec/findutils-find endef define Package/findutils-xargs $(call Package/findutils/Default) TITLE+= - xargs utility ALTERNATIVES:=300:/usr/bin/xargs:/usr/libexec/findutils-xargs endef define Package/findutils-locate $(call Package/findutils/Default) TITLE+= - locate and updatedb utility endef CONFIGURE_ARGS += --localstatedir=/srv/var CONFIGURE_VARS += ac_cv_path_SORT=sort define Package/findutils/install true endef define Package/findutils-find/install $(INSTALL_DIR) $(1)/usr/libexec $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/find $(1)/usr/libexec/findutils-find endef define Package/findutils-xargs/install $(INSTALL_DIR) $(1)/usr/libexec $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xargs $(1)/usr/libexec/findutils-xargs endef define Package/findutils-locate/install $(INSTALL_DIR) $(1)/usr/bin $(1)/srv/var $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/locate $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/updatedb $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr/ endef $(eval $(call BuildPackage,findutils)) $(eval $(call BuildPackage,findutils-find)) $(eval $(call BuildPackage,findutils-locate)) $(eval $(call BuildPackage,findutils-xargs))
Java
// StanfordLexicalizedParser -- a probabilistic lexicalized NL CFG parser // Copyright (c) 2002, 2003, 2004, 2005 The Board of Trustees of // The Leland Stanford Junior University. All Rights Reserved. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // For more information, bug reports, fixes, contact: // Christopher Manning // Dept of Computer Science, Gates 1A // Stanford CA 94305-9010 // USA // parser-support@lists.stanford.edu // http://nlp.stanford.edu/downloads/lex-parser.shtml package edu.stanford.nlp.parser.lexparser; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import edu.stanford.nlp.io.NumberRangeFileFilter; import edu.stanford.nlp.ling.HasWord; import edu.stanford.nlp.ling.TaggedWord; import edu.stanford.nlp.ling.Word; import edu.stanford.nlp.parser.metrics.AbstractEval; import edu.stanford.nlp.parser.metrics.UnlabeledAttachmentEval; import edu.stanford.nlp.parser.metrics.Evalb; import edu.stanford.nlp.parser.metrics.TaggingEval; import edu.stanford.nlp.trees.LeftHeadFinder; import edu.stanford.nlp.trees.MemoryTreebank; import edu.stanford.nlp.trees.Tree; import edu.stanford.nlp.trees.TreeLengthComparator; import edu.stanford.nlp.trees.TreeTransformer; import edu.stanford.nlp.trees.Treebank; import edu.stanford.nlp.trees.TreebankLanguagePack; import java.util.function.Function; import edu.stanford.nlp.util.Generics; import edu.stanford.nlp.util.HashIndex; import edu.stanford.nlp.util.Index; import edu.stanford.nlp.util.Pair; import edu.stanford.nlp.util.Timing; import edu.stanford.nlp.util.StringUtils; /** * @author Dan Klein (original version) * @author Christopher Manning (better features, ParserParams, serialization) * @author Roger Levy (internationalization) * @author Teg Grenager (grammar compaction, etc., tokenization, etc.) * @author Galen Andrew (lattice parsing) * @author Philip Resnik and Dan Zeman (n good parses) */ public class FactoredParser { /* some documentation for Roger's convenience * {pcfg,dep,combo}{PE,DE,TE} are precision/dep/tagging evals for the models * parser is the PCFG parser * dparser is the dependency parser * bparser is the combining parser * during testing: * tree is the test tree (gold tree) * binaryTree is the gold tree binarized * tree2b is the best PCFG paser, binarized * tree2 is the best PCFG parse (debinarized) * tree3 is the dependency parse, binarized * tree3db is the dependency parser, debinarized * tree4 is the best combo parse, binarized and then debinarized * tree4b is the best combo parse, binarized */ public static void main(String[] args) { Options op = new Options(new EnglishTreebankParserParams()); // op.tlpParams may be changed to something else later, so don't use it till // after options are parsed. System.out.println(StringUtils.toInvocationString("FactoredParser", args)); String path = "/u/nlp/stuff/corpora/Treebank3/parsed/mrg/wsj"; int trainLow = 200, trainHigh = 2199, testLow = 2200, testHigh = 2219; String serializeFile = null; int i = 0; while (i < args.length && args[i].startsWith("-")) { if (args[i].equalsIgnoreCase("-path") && (i + 1 < args.length)) { path = args[i + 1]; i += 2; } else if (args[i].equalsIgnoreCase("-train") && (i + 2 < args.length)) { trainLow = Integer.parseInt(args[i + 1]); trainHigh = Integer.parseInt(args[i + 2]); i += 3; } else if (args[i].equalsIgnoreCase("-test") && (i + 2 < args.length)) { testLow = Integer.parseInt(args[i + 1]); testHigh = Integer.parseInt(args[i + 2]); i += 3; } else if (args[i].equalsIgnoreCase("-serialize") && (i + 1 < args.length)) { serializeFile = args[i + 1]; i += 2; } else if (args[i].equalsIgnoreCase("-tLPP") && (i + 1 < args.length)) { try { op.tlpParams = (TreebankLangParserParams) Class.forName(args[i + 1]).newInstance(); } catch (ClassNotFoundException e) { System.err.println("Class not found: " + args[i + 1]); throw new RuntimeException(e); } catch (InstantiationException e) { System.err.println("Couldn't instantiate: " + args[i + 1] + ": " + e.toString()); throw new RuntimeException(e); } catch (IllegalAccessException e) { System.err.println("illegal access" + e); throw new RuntimeException(e); } i += 2; } else if (args[i].equals("-encoding")) { // sets encoding for TreebankLangParserParams op.tlpParams.setInputEncoding(args[i + 1]); op.tlpParams.setOutputEncoding(args[i + 1]); i += 2; } else { i = op.setOptionOrWarn(args, i); } } // System.out.println(tlpParams.getClass()); TreebankLanguagePack tlp = op.tlpParams.treebankLanguagePack(); op.trainOptions.sisterSplitters = Generics.newHashSet(Arrays.asList(op.tlpParams.sisterSplitters())); // BinarizerFactory.TreeAnnotator.setTreebankLang(tlpParams); PrintWriter pw = op.tlpParams.pw(); op.testOptions.display(); op.trainOptions.display(); op.display(); op.tlpParams.display(); // setup tree transforms Treebank trainTreebank = op.tlpParams.memoryTreebank(); MemoryTreebank testTreebank = op.tlpParams.testMemoryTreebank(); // Treebank blippTreebank = ((EnglishTreebankParserParams) tlpParams).diskTreebank(); // String blippPath = "/afs/ir.stanford.edu/data/linguistic-data/BLLIP-WSJ/"; // blippTreebank.loadPath(blippPath, "", true); Timing.startTime(); System.err.print("Reading trees..."); testTreebank.loadPath(path, new NumberRangeFileFilter(testLow, testHigh, true)); if (op.testOptions.increasingLength) { Collections.sort(testTreebank, new TreeLengthComparator()); } trainTreebank.loadPath(path, new NumberRangeFileFilter(trainLow, trainHigh, true)); Timing.tick("done."); System.err.print("Binarizing trees..."); TreeAnnotatorAndBinarizer binarizer; if (!op.trainOptions.leftToRight) { binarizer = new TreeAnnotatorAndBinarizer(op.tlpParams, op.forceCNF, !op.trainOptions.outsideFactor(), true, op); } else { binarizer = new TreeAnnotatorAndBinarizer(op.tlpParams.headFinder(), new LeftHeadFinder(), op.tlpParams, op.forceCNF, !op.trainOptions.outsideFactor(), true, op); } CollinsPuncTransformer collinsPuncTransformer = null; if (op.trainOptions.collinsPunc) { collinsPuncTransformer = new CollinsPuncTransformer(tlp); } TreeTransformer debinarizer = new Debinarizer(op.forceCNF); List<Tree> binaryTrainTrees = new ArrayList<>(); if (op.trainOptions.selectiveSplit) { op.trainOptions.splitters = ParentAnnotationStats.getSplitCategories(trainTreebank, op.trainOptions.tagSelectiveSplit, 0, op.trainOptions.selectiveSplitCutOff, op.trainOptions.tagSelectiveSplitCutOff, op.tlpParams.treebankLanguagePack()); if (op.trainOptions.deleteSplitters != null) { List<String> deleted = new ArrayList<>(); for (String del : op.trainOptions.deleteSplitters) { String baseDel = tlp.basicCategory(del); boolean checkBasic = del.equals(baseDel); for (Iterator<String> it = op.trainOptions.splitters.iterator(); it.hasNext(); ) { String elem = it.next(); String baseElem = tlp.basicCategory(elem); boolean delStr = checkBasic && baseElem.equals(baseDel) || elem.equals(del); if (delStr) { it.remove(); deleted.add(elem); } } } System.err.println("Removed from vertical splitters: " + deleted); } } if (op.trainOptions.selectivePostSplit) { TreeTransformer myTransformer = new TreeAnnotator(op.tlpParams.headFinder(), op.tlpParams, op); Treebank annotatedTB = trainTreebank.transform(myTransformer); op.trainOptions.postSplitters = ParentAnnotationStats.getSplitCategories(annotatedTB, true, 0, op.trainOptions.selectivePostSplitCutOff, op.trainOptions.tagSelectivePostSplitCutOff, op.tlpParams.treebankLanguagePack()); } if (op.trainOptions.hSelSplit) { binarizer.setDoSelectiveSplit(false); for (Tree tree : trainTreebank) { if (op.trainOptions.collinsPunc) { tree = collinsPuncTransformer.transformTree(tree); } //tree.pennPrint(tlpParams.pw()); tree = binarizer.transformTree(tree); //binaryTrainTrees.add(tree); } binarizer.setDoSelectiveSplit(true); } for (Tree tree : trainTreebank) { if (op.trainOptions.collinsPunc) { tree = collinsPuncTransformer.transformTree(tree); } tree = binarizer.transformTree(tree); binaryTrainTrees.add(tree); } if (op.testOptions.verbose) { binarizer.dumpStats(); } List<Tree> binaryTestTrees = new ArrayList<>(); for (Tree tree : testTreebank) { if (op.trainOptions.collinsPunc) { tree = collinsPuncTransformer.transformTree(tree); } tree = binarizer.transformTree(tree); binaryTestTrees.add(tree); } Timing.tick("done."); // binarization BinaryGrammar bg = null; UnaryGrammar ug = null; DependencyGrammar dg = null; // DependencyGrammar dgBLIPP = null; Lexicon lex = null; Index<String> stateIndex = new HashIndex<>(); // extract grammars Extractor<Pair<UnaryGrammar,BinaryGrammar>> bgExtractor = new BinaryGrammarExtractor(op, stateIndex); //Extractor bgExtractor = new SmoothedBinaryGrammarExtractor();//new BinaryGrammarExtractor(); // Extractor lexExtractor = new LexiconExtractor(); //Extractor dgExtractor = new DependencyMemGrammarExtractor(); if (op.doPCFG) { System.err.print("Extracting PCFG..."); Pair<UnaryGrammar, BinaryGrammar> bgug = null; if (op.trainOptions.cheatPCFG) { List<Tree> allTrees = new ArrayList<>(binaryTrainTrees); allTrees.addAll(binaryTestTrees); bgug = bgExtractor.extract(allTrees); } else { bgug = bgExtractor.extract(binaryTrainTrees); } bg = bgug.second; bg.splitRules(); ug = bgug.first; ug.purgeRules(); Timing.tick("done."); } System.err.print("Extracting Lexicon..."); Index<String> wordIndex = new HashIndex<>(); Index<String> tagIndex = new HashIndex<>(); lex = op.tlpParams.lex(op, wordIndex, tagIndex); lex.initializeTraining(binaryTrainTrees.size()); lex.train(binaryTrainTrees); lex.finishTraining(); Timing.tick("done."); if (op.doDep) { System.err.print("Extracting Dependencies..."); binaryTrainTrees.clear(); Extractor<DependencyGrammar> dgExtractor = new MLEDependencyGrammarExtractor(op, wordIndex, tagIndex); // dgBLIPP = (DependencyGrammar) dgExtractor.extract(new ConcatenationIterator(trainTreebank.iterator(),blippTreebank.iterator()),new TransformTreeDependency(tlpParams,true)); // DependencyGrammar dg1 = dgExtractor.extract(trainTreebank.iterator(), new TransformTreeDependency(op.tlpParams, true)); //dgBLIPP=(DependencyGrammar)dgExtractor.extract(blippTreebank.iterator(),new TransformTreeDependency(tlpParams)); //dg = (DependencyGrammar) dgExtractor.extract(new ConcatenationIterator(trainTreebank.iterator(),blippTreebank.iterator()),new TransformTreeDependency(tlpParams)); // dg=new DependencyGrammarCombination(dg1,dgBLIPP,2); dg = dgExtractor.extract(binaryTrainTrees); //uses information whether the words are known or not, discards unknown words Timing.tick("done."); //System.out.print("Extracting Unknown Word Model..."); //UnknownWordModel uwm = (UnknownWordModel)uwmExtractor.extract(binaryTrainTrees); //Timing.tick("done."); System.out.print("Tuning Dependency Model..."); dg.tune(binaryTestTrees); //System.out.println("TUNE DEPS: "+tuneDeps); Timing.tick("done."); } BinaryGrammar boundBG = bg; UnaryGrammar boundUG = ug; GrammarProjection gp = new NullGrammarProjection(bg, ug); // serialization if (serializeFile != null) { System.err.print("Serializing parser..."); LexicalizedParser parser = new LexicalizedParser(lex, bg, ug, dg, stateIndex, wordIndex, tagIndex, op); parser.saveParserToSerialized(serializeFile); Timing.tick("done."); } // test: pcfg-parse and output ExhaustivePCFGParser parser = null; if (op.doPCFG) { parser = new ExhaustivePCFGParser(boundBG, boundUG, lex, op, stateIndex, wordIndex, tagIndex); } ExhaustiveDependencyParser dparser = ((op.doDep && ! op.testOptions.useFastFactored) ? new ExhaustiveDependencyParser(dg, lex, op, wordIndex, tagIndex) : null); Scorer scorer = (op.doPCFG ? new TwinScorer(new ProjectionScorer(parser, gp, op), dparser) : null); //Scorer scorer = parser; BiLexPCFGParser bparser = null; if (op.doPCFG && op.doDep) { bparser = (op.testOptions.useN5) ? new BiLexPCFGParser.N5BiLexPCFGParser(scorer, parser, dparser, bg, ug, dg, lex, op, gp, stateIndex, wordIndex, tagIndex) : new BiLexPCFGParser(scorer, parser, dparser, bg, ug, dg, lex, op, gp, stateIndex, wordIndex, tagIndex); } Evalb pcfgPE = new Evalb("pcfg PE", true); Evalb comboPE = new Evalb("combo PE", true); AbstractEval pcfgCB = new Evalb.CBEval("pcfg CB", true); AbstractEval pcfgTE = new TaggingEval("pcfg TE"); AbstractEval comboTE = new TaggingEval("combo TE"); AbstractEval pcfgTEnoPunct = new TaggingEval("pcfg nopunct TE"); AbstractEval comboTEnoPunct = new TaggingEval("combo nopunct TE"); AbstractEval depTE = new TaggingEval("depnd TE"); AbstractEval depDE = new UnlabeledAttachmentEval("depnd DE", true, null, tlp.punctuationWordRejectFilter()); AbstractEval comboDE = new UnlabeledAttachmentEval("combo DE", true, null, tlp.punctuationWordRejectFilter()); if (op.testOptions.evalb) { EvalbFormatWriter.initEVALBfiles(op.tlpParams); } // int[] countByLength = new int[op.testOptions.maxLength+1]; // Use a reflection ruse, so one can run this without needing the // tagger. Using a function rather than a MaxentTagger means we // can distribute a version of the parser that doesn't include the // entire tagger. Function<List<? extends HasWord>,ArrayList<TaggedWord>> tagger = null; if (op.testOptions.preTag) { try { Class[] argsClass = { String.class }; Object[] arguments = new Object[]{op.testOptions.taggerSerializedFile}; tagger = (Function<List<? extends HasWord>,ArrayList<TaggedWord>>) Class.forName("edu.stanford.nlp.tagger.maxent.MaxentTagger").getConstructor(argsClass).newInstance(arguments); } catch (Exception e) { System.err.println(e); System.err.println("Warning: No pretagging of sentences will be done."); } } for (int tNum = 0, ttSize = testTreebank.size(); tNum < ttSize; tNum++) { Tree tree = testTreebank.get(tNum); int testTreeLen = tree.yield().size(); if (testTreeLen > op.testOptions.maxLength) { continue; } Tree binaryTree = binaryTestTrees.get(tNum); // countByLength[testTreeLen]++; System.out.println("-------------------------------------"); System.out.println("Number: " + (tNum + 1)); System.out.println("Length: " + testTreeLen); //tree.pennPrint(pw); // System.out.println("XXXX The binary tree is"); // binaryTree.pennPrint(pw); //System.out.println("Here are the tags in the lexicon:"); //System.out.println(lex.showTags()); //System.out.println("Here's the tagnumberer:"); //System.out.println(Numberer.getGlobalNumberer("tags").toString()); long timeMil1 = System.currentTimeMillis(); Timing.tick("Starting parse."); if (op.doPCFG) { //System.err.println(op.testOptions.forceTags); if (op.testOptions.forceTags) { if (tagger != null) { //System.out.println("Using a tagger to set tags"); //System.out.println("Tagged sentence as: " + tagger.processSentence(cutLast(wordify(binaryTree.yield()))).toString(false)); parser.parse(addLast(tagger.apply(cutLast(wordify(binaryTree.yield()))))); } else { //System.out.println("Forcing tags to match input."); parser.parse(cleanTags(binaryTree.taggedYield(), tlp)); } } else { // System.out.println("XXXX Parsing " + binaryTree.yield()); parser.parse(binaryTree.yieldHasWord()); } //Timing.tick("Done with pcfg phase."); } if (op.doDep) { dparser.parse(binaryTree.yieldHasWord()); //Timing.tick("Done with dependency phase."); } boolean bothPassed = false; if (op.doPCFG && op.doDep) { bothPassed = bparser.parse(binaryTree.yieldHasWord()); //Timing.tick("Done with combination phase."); } long timeMil2 = System.currentTimeMillis(); long elapsed = timeMil2 - timeMil1; System.err.println("Time: " + ((int) (elapsed / 100)) / 10.00 + " sec."); //System.out.println("PCFG Best Parse:"); Tree tree2b = null; Tree tree2 = null; //System.out.println("Got full best parse..."); if (op.doPCFG) { tree2b = parser.getBestParse(); tree2 = debinarizer.transformTree(tree2b); } //System.out.println("Debinarized parse..."); //tree2.pennPrint(); //System.out.println("DepG Best Parse:"); Tree tree3 = null; Tree tree3db = null; if (op.doDep) { tree3 = dparser.getBestParse(); // was: but wrong Tree tree3db = debinarizer.transformTree(tree2); tree3db = debinarizer.transformTree(tree3); tree3.pennPrint(pw); } //tree.pennPrint(); //((Tree)binaryTrainTrees.get(tNum)).pennPrint(); //System.out.println("Combo Best Parse:"); Tree tree4 = null; if (op.doPCFG && op.doDep) { try { tree4 = bparser.getBestParse(); if (tree4 == null) { tree4 = tree2b; } } catch (NullPointerException e) { System.err.println("Blocked, using PCFG parse!"); tree4 = tree2b; } } if (op.doPCFG && !bothPassed) { tree4 = tree2b; } //tree4.pennPrint(); if (op.doDep) { depDE.evaluate(tree3, binaryTree, pw); depTE.evaluate(tree3db, tree, pw); } TreeTransformer tc = op.tlpParams.collinizer(); TreeTransformer tcEvalb = op.tlpParams.collinizerEvalb(); if (op.doPCFG) { // System.out.println("XXXX Best PCFG was: "); // tree2.pennPrint(); // System.out.println("XXXX Transformed best PCFG is: "); // tc.transformTree(tree2).pennPrint(); //System.out.println("True Best Parse:"); //tree.pennPrint(); //tc.transformTree(tree).pennPrint(); pcfgPE.evaluate(tc.transformTree(tree2), tc.transformTree(tree), pw); pcfgCB.evaluate(tc.transformTree(tree2), tc.transformTree(tree), pw); Tree tree4b = null; if (op.doDep) { comboDE.evaluate((bothPassed ? tree4 : tree3), binaryTree, pw); tree4b = tree4; tree4 = debinarizer.transformTree(tree4); if (op.nodePrune) { NodePruner np = new NodePruner(parser, debinarizer); tree4 = np.prune(tree4); } //tree4.pennPrint(); comboPE.evaluate(tc.transformTree(tree4), tc.transformTree(tree), pw); } //pcfgTE.evaluate(tree2, tree); pcfgTE.evaluate(tcEvalb.transformTree(tree2), tcEvalb.transformTree(tree), pw); pcfgTEnoPunct.evaluate(tc.transformTree(tree2), tc.transformTree(tree), pw); if (op.doDep) { comboTE.evaluate(tcEvalb.transformTree(tree4), tcEvalb.transformTree(tree), pw); comboTEnoPunct.evaluate(tc.transformTree(tree4), tc.transformTree(tree), pw); } System.out.println("PCFG only: " + parser.scoreBinarizedTree(tree2b, 0)); //tc.transformTree(tree2).pennPrint(); tree2.pennPrint(pw); if (op.doDep) { System.out.println("Combo: " + parser.scoreBinarizedTree(tree4b, 0)); // tc.transformTree(tree4).pennPrint(pw); tree4.pennPrint(pw); } System.out.println("Correct:" + parser.scoreBinarizedTree(binaryTree, 0)); /* if (parser.scoreBinarizedTree(tree2b,true) < parser.scoreBinarizedTree(binaryTree,true)) { System.out.println("SCORE INVERSION"); parser.validateBinarizedTree(binaryTree,0); } */ tree.pennPrint(pw); } // end if doPCFG if (op.testOptions.evalb) { if (op.doPCFG && op.doDep) { EvalbFormatWriter.writeEVALBline(tcEvalb.transformTree(tree), tcEvalb.transformTree(tree4)); } else if (op.doPCFG) { EvalbFormatWriter.writeEVALBline(tcEvalb.transformTree(tree), tcEvalb.transformTree(tree2)); } else if (op.doDep) { EvalbFormatWriter.writeEVALBline(tcEvalb.transformTree(tree), tcEvalb.transformTree(tree3db)); } } } // end for each tree in test treebank if (op.testOptions.evalb) { EvalbFormatWriter.closeEVALBfiles(); } // op.testOptions.display(); if (op.doPCFG) { pcfgPE.display(false, pw); System.out.println("Grammar size: " + stateIndex.size()); pcfgCB.display(false, pw); if (op.doDep) { comboPE.display(false, pw); } pcfgTE.display(false, pw); pcfgTEnoPunct.display(false, pw); if (op.doDep) { comboTE.display(false, pw); comboTEnoPunct.display(false, pw); } } if (op.doDep) { depTE.display(false, pw); depDE.display(false, pw); } if (op.doPCFG && op.doDep) { comboDE.display(false, pw); } // pcfgPE.printGoodBad(); } private static List<TaggedWord> cleanTags(List<TaggedWord> twList, TreebankLanguagePack tlp) { int sz = twList.size(); List<TaggedWord> l = new ArrayList<>(sz); for (TaggedWord tw : twList) { TaggedWord tw2 = new TaggedWord(tw.word(), tlp.basicCategory(tw.tag())); l.add(tw2); } return l; } private static ArrayList<Word> wordify(List wList) { ArrayList<Word> s = new ArrayList<>(); for (Object obj : wList) { s.add(new Word(obj.toString())); } return s; } private static ArrayList<Word> cutLast(ArrayList<Word> s) { return new ArrayList<>(s.subList(0, s.size() - 1)); } private static ArrayList<Word> addLast(ArrayList<? extends Word> s) { ArrayList<Word> s2 = new ArrayList<>(s); //s2.add(new StringLabel(Lexicon.BOUNDARY)); s2.add(new Word(Lexicon.BOUNDARY)); return s2; } /** * Not an instantiable class */ private FactoredParser() { } }
Java
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: #ident "$Id$" /* COPYING CONDITIONS NOTICE: This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation, and provided that the following conditions are met: * Redistributions of source code must retain this COPYING CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the PATENT MARKING NOTICE (below), and the PATENT RIGHTS GRANT (below). * Redistributions in binary form must reproduce this COPYING CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the PATENT MARKING NOTICE (below), and the PATENT RIGHTS GRANT (below) in the documentation and/or other materials provided with the distribution. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. COPYRIGHT NOTICE: TokuDB, Tokutek Fractal Tree Indexing Library. Copyright (C) 2007-2013 Tokutek, Inc. DISCLAIMER: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. UNIVERSITY PATENT NOTICE: The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it. PATENT MARKING NOTICE: This software is covered by US Patent No. 8,185,551. This software is covered by US Patent No. 8,489,638. PATENT RIGHTS GRANT: "THIS IMPLEMENTATION" means the copyrightable works distributed by Tokutek as part of the Fractal Tree project. "PATENT CLAIMS" means the claims of patents that are owned or licensable by Tokutek, both currently or in the future; and that in the absence of this license would be infringed by THIS IMPLEMENTATION or by using or running THIS IMPLEMENTATION. "PATENT CHALLENGE" shall mean a challenge to the validity, patentability, enforceability and/or non-infringement of any of the PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. Tokutek hereby grants to you, for the term and geographical scope of the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer, and otherwise run, modify, and propagate the contents of THIS IMPLEMENTATION, where such license applies only to the PATENT CLAIMS. This grant does not include claims that would be infringed only as a consequence of further modifications of THIS IMPLEMENTATION. If you or your agent or licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that THIS IMPLEMENTATION constitutes direct or contributory patent infringement, or inducement of patent infringement, then any rights granted to you under this License shall terminate as of the date such litigation is filed. If you or your agent or exclusive licensee institute or order or agree to the institution of a PATENT CHALLENGE, then Tokutek may terminate any rights granted to you under this License. */ #ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." /* -*- mode: C; c-basic-offset: 4 -*- */ #define MYSQL_SERVER 1 #include "hatoku_defines.h" #include <db.h> #include "stdint.h" #if defined(_WIN32) #include "misc.h" #endif #define __STDC_FORMAT_MACROS #include <inttypes.h> #include "toku_os.h" #include "toku_time.h" #include "partitioned_counter.h" /* We define DTRACE after mysql_priv.h in case it disabled dtrace in the main server */ #ifdef HAVE_DTRACE #define _DTRACE_VERSION 1 #else #endif #include <mysql/plugin.h> #include "hatoku_hton.h" #include "ha_tokudb.h" #undef PACKAGE #undef VERSION #undef HAVE_DTRACE #undef _DTRACE_VERSION #define TOKU_METADB_NAME "tokudb_meta" typedef struct savepoint_info { DB_TXN* txn; tokudb_trx_data* trx; bool in_sub_stmt; } *SP_INFO, SP_INFO_T; #if defined(MARIADB_BASE_VERSION) ha_create_table_option tokudb_index_options[] = { HA_IOPTION_BOOL("clustering", clustering, 0), HA_IOPTION_END }; #endif static uchar *tokudb_get_key(TOKUDB_SHARE * share, size_t * length, my_bool not_used __attribute__ ((unused))) { *length = share->table_name_length; return (uchar *) share->table_name; } static handler *tokudb_create_handler(handlerton * hton, TABLE_SHARE * table, MEM_ROOT * mem_root); static void tokudb_print_error(const DB_ENV * db_env, const char *db_errpfx, const char *buffer); static void tokudb_cleanup_log_files(void); static int tokudb_end(handlerton * hton, ha_panic_function type); static bool tokudb_flush_logs(handlerton * hton); static bool tokudb_show_status(handlerton * hton, THD * thd, stat_print_fn * print, enum ha_stat_type); #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL static void tokudb_handle_fatal_signal(handlerton *hton, THD *thd, int sig); #endif static int tokudb_close_connection(handlerton * hton, THD * thd); static int tokudb_commit(handlerton * hton, THD * thd, bool all); static int tokudb_rollback(handlerton * hton, THD * thd, bool all); #if TOKU_INCLUDE_XA static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all); static int tokudb_xa_recover(handlerton* hton, XID* xid_list, uint len); static int tokudb_commit_by_xid(handlerton* hton, XID* xid); static int tokudb_rollback_by_xid(handlerton* hton, XID* xid); #endif static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *savepoint); static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint); static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoint); static int tokudb_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *ts); static int tokudb_discover_table_existence(handlerton *hton, const char *db, const char *name); static int tokudb_discover(handlerton *hton, THD* thd, const char *db, const char *name, uchar **frmblob, size_t *frmlen); static int tokudb_discover2(handlerton *hton, THD* thd, const char *db, const char *name, bool translate_name,uchar **frmblob, size_t *frmlen); static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const char *name, char *path, uchar **frmblob, size_t *frmlen); handlerton *tokudb_hton; const char *ha_tokudb_ext = ".tokudb"; char *tokudb_data_dir; ulong tokudb_debug; DB_ENV *db_env; HASH tokudb_open_tables; pthread_mutex_t tokudb_mutex; #if TOKU_THDVAR_MEMALLOC_BUG static pthread_mutex_t tokudb_map_mutex; static TREE tokudb_map; struct tokudb_map_pair { THD *thd; char *last_lock_timeout; }; #if 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599 static int tokudb_map_pair_cmp(void *custom_arg, const void *a, const void *b) { #else static int tokudb_map_pair_cmp(const void *custom_arg, const void *a, const void *b) { #endif const struct tokudb_map_pair *a_key = (const struct tokudb_map_pair *) a; const struct tokudb_map_pair *b_key = (const struct tokudb_map_pair *) b; if (a_key->thd < b_key->thd) return -1; else if (a_key->thd > b_key->thd) return +1; else return 0; }; #endif #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL static my_bool tokudb_gdb_on_fatal; static char *tokudb_gdb_path; #endif static PARTITIONED_COUNTER tokudb_primary_key_bytes_inserted; void toku_hton_update_primary_key_bytes_inserted(uint64_t row_size) { increment_partitioned_counter(tokudb_primary_key_bytes_inserted, row_size); } static void tokudb_lock_timeout_callback(DB *db, uint64_t requesting_txnid, const DBT *left_key, const DBT *right_key, uint64_t blocking_txnid); static ulong tokudb_cleaner_period; static ulong tokudb_cleaner_iterations; #define ASSERT_MSGLEN 1024 void toku_hton_assert_fail(const char* expr_as_string, const char * fun, const char * file, int line, int caller_errno) { char msg[ASSERT_MSGLEN]; if (db_env) { snprintf(msg, ASSERT_MSGLEN, "Handlerton: %s ", expr_as_string); db_env->crash(db_env, msg, fun, file, line,caller_errno); } else { snprintf(msg, ASSERT_MSGLEN, "Handlerton assertion failed, no env, %s, %d, %s, %s (errno=%d)\n", file, line, fun, expr_as_string, caller_errno); perror(msg); fflush(stderr); } abort(); } //my_bool tokudb_shared_data = false; static uint32_t tokudb_init_flags = DB_CREATE | DB_THREAD | DB_PRIVATE | DB_INIT_LOCK | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOG | DB_RECOVER; static uint32_t tokudb_env_flags = 0; // static uint32_t tokudb_lock_type = DB_LOCK_DEFAULT; // static ulong tokudb_log_buffer_size = 0; // static ulong tokudb_log_file_size = 0; static my_bool tokudb_directio = FALSE; static my_bool tokudb_checkpoint_on_flush_logs = FALSE; static ulonglong tokudb_cache_size = 0; static ulonglong tokudb_max_lock_memory = 0; static char *tokudb_home; static char *tokudb_tmp_dir; static char *tokudb_log_dir; // static long tokudb_lock_scan_time = 0; // static ulong tokudb_region_size = 0; // static ulong tokudb_cache_parts = 1; const char *tokudb_hton_name = "TokuDB"; static uint32_t tokudb_checkpointing_period; static uint32_t tokudb_fsync_log_period; uint32_t tokudb_write_status_frequency; uint32_t tokudb_read_status_frequency; #ifdef TOKUDB_VERSION char *tokudb_version = (char*) TOKUDB_VERSION; #else char *tokudb_version; #endif static int tokudb_fs_reserve_percent; // file system reserve as a percentage of total disk space #if defined(_WIN32) extern "C" { #include "ydb.h" } #endif ha_create_table_option tokudb_table_options[]= { HA_TOPTION_SYSVAR("compression", row_format, row_format), HA_TOPTION_END }; // A flag set if the handlerton is in an initialized, usable state, // plus a reader-write lock to protect it without serializing reads. // Since we don't have static initializers for the opaque rwlock type, // use constructor and destructor functions to create and destroy // the lock before and after main(), respectively. static int tokudb_hton_initialized; static rw_lock_t tokudb_hton_initialized_lock; static void create_tokudb_hton_intialized_lock(void) __attribute__((constructor)); static void create_tokudb_hton_intialized_lock(void) { my_rwlock_init(&tokudb_hton_initialized_lock, 0); } static void destroy_tokudb_hton_initialized_lock(void) __attribute__((destructor)); static void destroy_tokudb_hton_initialized_lock(void) { rwlock_destroy(&tokudb_hton_initialized_lock); } static SHOW_VAR *toku_global_status_variables = NULL; static uint64_t toku_global_status_max_rows; static TOKU_ENGINE_STATUS_ROW_S* toku_global_status_rows = NULL; static void handle_ydb_error(int error) { switch (error) { case TOKUDB_HUGE_PAGES_ENABLED: fprintf(stderr, "************************************************************\n"); fprintf(stderr, " \n"); fprintf(stderr, " @@@@@@@@@@@ \n"); fprintf(stderr, " @@' '@@ \n"); fprintf(stderr, " @@ _ _ @@ \n"); fprintf(stderr, " | (.) (.) | \n"); fprintf(stderr, " | ` | \n"); fprintf(stderr, " | > ' | \n"); fprintf(stderr, " | .----. | \n"); fprintf(stderr, " .. |.----.| .. \n"); fprintf(stderr, " .. ' ' .. \n"); fprintf(stderr, " .._______,. \n"); fprintf(stderr, " \n"); fprintf(stderr, " %s will not run with transparent huge pages enabled. \n", tokudb_hton_name); fprintf(stderr, " Please disable them to continue. \n"); fprintf(stderr, " (echo never > /sys/kernel/mm/transparent_hugepage/enabled) \n"); fprintf(stderr, " \n"); fprintf(stderr, "************************************************************\n"); fflush(stderr); break; } } static int tokudb_init_func(void *p) { TOKUDB_DBUG_ENTER(""); int r; #if defined(_WIN64) r = toku_ydb_init(); if (r) { fprintf(stderr, "got error %d\n", r); goto error; } #endif // 3938: lock the handlerton's initialized status flag for writing r = rw_wrlock(&tokudb_hton_initialized_lock); assert(r == 0); db_env = NULL; tokudb_hton = (handlerton *) p; tokudb_pthread_mutex_init(&tokudb_mutex, MY_MUTEX_INIT_FAST); (void) my_hash_init(&tokudb_open_tables, table_alias_charset, 32, 0, 0, (my_hash_get_key) tokudb_get_key, 0, 0); tokudb_hton->state = SHOW_OPTION_YES; // tokudb_hton->flags= HTON_CAN_RECREATE; // QQQ this came from skeleton tokudb_hton->flags = HTON_CLOSE_CURSORS_AT_COMMIT | HTON_SUPPORTS_EXTENDED_KEYS; #if defined(TOKU_INCLUDE_EXTENDED_KEYS) && TOKU_INCLUDE_EXTENDED_KEYS #if defined(HTON_SUPPORTS_EXTENDED_KEYS) tokudb_hton->flags |= HTON_SUPPORTS_EXTENDED_KEYS; #endif #if defined(HTON_EXTENDED_KEYS) tokudb_hton->flags |= HTON_EXTENDED_KEYS; #endif #endif #if defined(HTON_SUPPORTS_CLUSTERED_KEYS) tokudb_hton->flags |= HTON_SUPPORTS_CLUSTERED_KEYS; #endif #if defined(TOKU_USE_DB_TYPE_TOKUDB) && TOKU_USE_DB_TYPE_TOKUDB tokudb_hton->db_type = DB_TYPE_TOKUDB; #elif defined(TOKU_USE_DB_TYPE_UNKNOWN) && TOKU_USE_DB_TYPE_UNKNOWN tokudb_hton->db_type = DB_TYPE_UNKNOWN; #else #error #endif tokudb_hton->create = tokudb_create_handler; tokudb_hton->close_connection = tokudb_close_connection; tokudb_hton->savepoint_offset = sizeof(SP_INFO_T); tokudb_hton->savepoint_set = tokudb_savepoint; tokudb_hton->savepoint_rollback = tokudb_rollback_to_savepoint; tokudb_hton->savepoint_release = tokudb_release_savepoint; tokudb_hton->discover_table = tokudb_discover_table; tokudb_hton->discover_table_existence = tokudb_discover_table_existence; #if defined(MYSQL_HANDLERTON_INCLUDE_DISCOVER2) tokudb_hton->discover2 = tokudb_discover2; #endif tokudb_hton->commit = tokudb_commit; tokudb_hton->rollback = tokudb_rollback; #if TOKU_INCLUDE_XA tokudb_hton->prepare=tokudb_xa_prepare; tokudb_hton->recover=tokudb_xa_recover; tokudb_hton->commit_by_xid=tokudb_commit_by_xid; tokudb_hton->rollback_by_xid=tokudb_rollback_by_xid; #endif tokudb_hton->table_options= tokudb_table_options; tokudb_hton->index_options= tokudb_index_options; tokudb_hton->panic = tokudb_end; tokudb_hton->flush_logs = tokudb_flush_logs; tokudb_hton->show_status = tokudb_show_status; #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL tokudb_hton->handle_fatal_signal = tokudb_handle_fatal_signal; #endif #if defined(MARIADB_BASE_VERSION) tokudb_hton->index_options = tokudb_index_options; #endif if (!tokudb_home) tokudb_home = mysql_real_data_home; DBUG_PRINT("info", ("tokudb_home: %s", tokudb_home)); if ((r = db_env_create(&db_env, 0))) { DBUG_PRINT("info", ("db_env_create %d\n", r)); handle_ydb_error(r); goto error; } DBUG_PRINT("info", ("tokudb_env_flags: 0x%x\n", tokudb_env_flags)); r = db_env->set_flags(db_env, tokudb_env_flags, 1); if (r) { // QQQ if (tokudb_debug & TOKUDB_DEBUG_INIT) TOKUDB_TRACE("WARNING: flags=%x r=%d", tokudb_env_flags, r); // goto error; } // config error handling db_env->set_errcall(db_env, tokudb_print_error); db_env->set_errpfx(db_env, tokudb_hton_name); // // set default comparison functions // r = db_env->set_default_bt_compare(db_env, tokudb_cmp_dbt_key); if (r) { DBUG_PRINT("info", ("set_default_bt_compare%d\n", r)); goto error; } { char *tmp_dir = tokudb_tmp_dir; char *data_dir = tokudb_data_dir; if (data_dir == 0) { data_dir = mysql_data_home; } if (tmp_dir == 0) { tmp_dir = data_dir; } DBUG_PRINT("info", ("tokudb_data_dir: %s\n", data_dir)); db_env->set_data_dir(db_env, data_dir); DBUG_PRINT("info", ("tokudb_tmp_dir: %s\n", tmp_dir)); db_env->set_tmp_dir(db_env, tmp_dir); } if (tokudb_log_dir) { DBUG_PRINT("info", ("tokudb_log_dir: %s\n", tokudb_log_dir)); db_env->set_lg_dir(db_env, tokudb_log_dir); } // config the cache table size to min(1/2 of physical memory, 1/8 of the process address space) if (tokudb_cache_size == 0) { uint64_t physmem, maxdata; physmem = toku_os_get_phys_memory_size(); tokudb_cache_size = physmem / 2; r = toku_os_get_max_process_data_size(&maxdata); if (r == 0) { if (tokudb_cache_size > maxdata / 8) tokudb_cache_size = maxdata / 8; } } if (tokudb_cache_size) { DBUG_PRINT("info", ("tokudb_cache_size: %lld\n", tokudb_cache_size)); r = db_env->set_cachesize(db_env, (uint32_t)(tokudb_cache_size >> 30), (uint32_t)(tokudb_cache_size % (1024L * 1024L * 1024L)), 1); if (r) { DBUG_PRINT("info", ("set_cachesize %d\n", r)); goto error; } } if (tokudb_max_lock_memory == 0) { tokudb_max_lock_memory = tokudb_cache_size/8; } if (tokudb_max_lock_memory) { DBUG_PRINT("info", ("tokudb_max_lock_memory: %lld\n", tokudb_max_lock_memory)); r = db_env->set_lk_max_memory(db_env, tokudb_max_lock_memory); if (r) { DBUG_PRINT("info", ("set_lk_max_memory %d\n", r)); goto error; } } uint32_t gbytes, bytes; int parts; r = db_env->get_cachesize(db_env, &gbytes, &bytes, &parts); if (tokudb_debug & TOKUDB_DEBUG_INIT) TOKUDB_TRACE("tokudb_cache_size=%lld r=%d", ((unsigned long long) gbytes << 30) + bytes, r); if (db_env->set_redzone) { r = db_env->set_redzone(db_env, tokudb_fs_reserve_percent); if (tokudb_debug & TOKUDB_DEBUG_INIT) TOKUDB_TRACE("set_redzone r=%d", r); } if (tokudb_debug & TOKUDB_DEBUG_INIT) TOKUDB_TRACE("env open:flags=%x", tokudb_init_flags); r = db_env->set_generate_row_callback_for_put(db_env,generate_row_for_put); assert(r == 0); r = db_env->set_generate_row_callback_for_del(db_env,generate_row_for_del); assert(r == 0); db_env->set_update(db_env, tokudb_update_fun); db_env_set_direct_io(tokudb_directio == TRUE); db_env->change_fsync_log_period(db_env, tokudb_fsync_log_period); db_env->set_lock_timeout_callback(db_env, tokudb_lock_timeout_callback); db_env->set_loader_memory_size(db_env, tokudb_get_loader_memory_size_callback); r = db_env->open(db_env, tokudb_home, tokudb_init_flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); if (tokudb_debug & TOKUDB_DEBUG_INIT) TOKUDB_TRACE("env opened:return=%d", r); if (r) { DBUG_PRINT("info", ("env->open %d", r)); goto error; } r = db_env->checkpointing_set_period(db_env, tokudb_checkpointing_period); assert(r == 0); r = db_env->cleaner_set_period(db_env, tokudb_cleaner_period); assert(r == 0); r = db_env->cleaner_set_iterations(db_env, tokudb_cleaner_iterations); assert(r == 0); r = db_env->set_lock_timeout(db_env, DEFAULT_TOKUDB_LOCK_TIMEOUT, tokudb_get_lock_wait_time_callback); assert(r == 0); db_env->set_killed_callback(db_env, DEFAULT_TOKUDB_KILLED_TIME, tokudb_get_killed_time_callback, tokudb_killed_callback); r = db_env->get_engine_status_num_rows (db_env, &toku_global_status_max_rows); assert(r == 0); { const myf mem_flags = MY_FAE|MY_WME|MY_ZEROFILL|MY_ALLOW_ZERO_PTR|MY_FREE_ON_ERROR; toku_global_status_variables = (SHOW_VAR*)tokudb_my_malloc(sizeof(*toku_global_status_variables)*toku_global_status_max_rows, mem_flags); toku_global_status_rows = (TOKU_ENGINE_STATUS_ROW_S*)tokudb_my_malloc(sizeof(*toku_global_status_rows)*toku_global_status_max_rows, mem_flags); } tokudb_primary_key_bytes_inserted = create_partitioned_counter(); #if TOKU_THDVAR_MEMALLOC_BUG tokudb_pthread_mutex_init(&tokudb_map_mutex, MY_MUTEX_INIT_FAST); init_tree(&tokudb_map, 0, 0, 0, tokudb_map_pair_cmp, true, NULL, NULL); #endif //3938: succeeded, set the init status flag and unlock tokudb_hton_initialized = 1; rw_unlock(&tokudb_hton_initialized_lock); DBUG_RETURN(false); error: if (db_env) { int rr= db_env->close(db_env, 0); assert(rr==0); db_env = 0; } // 3938: failed to initialized, drop the flag and lock tokudb_hton_initialized = 0; rw_unlock(&tokudb_hton_initialized_lock); DBUG_RETURN(true); } static int tokudb_done_func(void *p) { TOKUDB_DBUG_ENTER(""); tokudb_my_free(toku_global_status_variables); toku_global_status_variables = NULL; tokudb_my_free(toku_global_status_rows); toku_global_status_rows = NULL; my_hash_free(&tokudb_open_tables); tokudb_pthread_mutex_destroy(&tokudb_mutex); #if defined(_WIN64) toku_ydb_destroy(); #endif TOKUDB_DBUG_RETURN(0); } static handler *tokudb_create_handler(handlerton * hton, TABLE_SHARE * table, MEM_ROOT * mem_root) { return new(mem_root) ha_tokudb(hton, table); } int tokudb_end(handlerton * hton, ha_panic_function type) { TOKUDB_DBUG_ENTER(""); int error = 0; // 3938: if we finalize the storage engine plugin, it is no longer // initialized. grab a writer lock for the duration of the // call, so we can drop the flag and destroy the mutexes // in isolation. rw_wrlock(&tokudb_hton_initialized_lock); assert(tokudb_hton_initialized); if (db_env) { if (tokudb_init_flags & DB_INIT_LOG) tokudb_cleanup_log_files(); error = db_env->close(db_env, 0); // Error is logged assert(error==0); db_env = NULL; } if (tokudb_primary_key_bytes_inserted) { destroy_partitioned_counter(tokudb_primary_key_bytes_inserted); tokudb_primary_key_bytes_inserted = NULL; } #if TOKU_THDVAR_MEMALLOC_BUG tokudb_pthread_mutex_destroy(&tokudb_map_mutex); delete_tree(&tokudb_map); #endif // 3938: drop the initialized flag and unlock tokudb_hton_initialized = 0; rw_unlock(&tokudb_hton_initialized_lock); TOKUDB_DBUG_RETURN(error); } static int tokudb_close_connection(handlerton * hton, THD * thd) { int error = 0; tokudb_trx_data* trx = NULL; trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot); if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("trx %p", trx); } if (trx && trx->checkpoint_lock_taken) { error = db_env->checkpointing_resume(db_env); } tokudb_my_free(trx); #if TOKU_THDVAR_MEMALLOC_BUG tokudb_pthread_mutex_lock(&tokudb_map_mutex); struct tokudb_map_pair key = { thd, NULL }; struct tokudb_map_pair *found_key = (struct tokudb_map_pair *) tree_search(&tokudb_map, &key, NULL); if (found_key) { if (0) TOKUDB_TRACE("thd %p %p", thd, found_key->last_lock_timeout); tokudb_my_free(found_key->last_lock_timeout); tree_delete(&tokudb_map, found_key, sizeof *found_key, NULL); } tokudb_pthread_mutex_unlock(&tokudb_map_mutex); #endif return error; } bool tokudb_flush_logs(handlerton * hton) { TOKUDB_DBUG_ENTER(""); int error; bool result = 0; if (tokudb_checkpoint_on_flush_logs) { // // take the checkpoint // error = db_env->txn_checkpoint(db_env, 0, 0, 0); if (error) { my_error(ER_ERROR_DURING_CHECKPOINT, MYF(0), error); result = 1; goto exit; } } else { error = db_env->log_flush(db_env, NULL); assert(error == 0); } result = 0; exit: TOKUDB_DBUG_RETURN(result); } typedef struct txn_progress_info { char status[200]; THD* thd; } *TXN_PROGRESS_INFO; static void txn_progress_func(TOKU_TXN_PROGRESS progress, void* extra) { TXN_PROGRESS_INFO progress_info = (TXN_PROGRESS_INFO)extra; int r = sprintf(progress_info->status, "%sprocessing %s of transaction, %" PRId64 " out of %" PRId64, progress->stalled_on_checkpoint ? "Writing committed changes to disk, " : "", progress->is_commit ? "commit" : "abort", progress->entries_processed, progress->entries_total ); assert(r >= 0); thd_proc_info(progress_info->thd, progress_info->status); } static void commit_txn_with_progress(DB_TXN* txn, uint32_t flags, THD* thd) { int r; struct txn_progress_info info; info.thd = thd; r = txn->commit_with_progress(txn, flags, txn_progress_func, &info); if (r != 0) { sql_print_error("tried committing transaction %p and got error code %d", txn, r); } assert(r == 0); } static void abort_txn_with_progress(DB_TXN* txn, THD* thd) { int r; struct txn_progress_info info; info.thd = thd; r = txn->abort_with_progress(txn, txn_progress_func, &info); if (r != 0) { sql_print_error("tried aborting transaction %p and got error code %d", txn, r); } assert(r == 0); } static void tokudb_cleanup_handlers(tokudb_trx_data *trx, DB_TXN *txn) { LIST *e; while ((e = trx->handlers)) { trx->handlers = list_delete(trx->handlers, e); ha_tokudb *handler = (ha_tokudb *) e->data; handler->cleanup_txn(txn); } } static int tokudb_commit(handlerton * hton, THD * thd, bool all) { TOKUDB_DBUG_ENTER(""); DBUG_PRINT("trans", ("ending transaction %s", all ? "all" : "stmt")); uint32_t syncflag = THDVAR(thd, commit_sync) ? 0 : DB_TXN_NOSYNC; tokudb_trx_data *trx = (tokudb_trx_data *) thd_data_get(thd, hton->slot); DB_TXN **txn = all ? &trx->all : &trx->stmt; DB_TXN *this_txn = *txn; if (this_txn) { if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("commit trx %u trx %p txn %p", all, trx, this_txn); } // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_commit_before", DBUG_SUICIDE();); tokudb_cleanup_handlers(trx, this_txn); commit_txn_with_progress(this_txn, syncflag, thd); // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_commit_after", DBUG_SUICIDE();); if (this_txn == trx->sp_level) { trx->sp_level = 0; } *txn = 0; trx->sub_sp_level = NULL; } else if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("nothing to commit %d", all); } reset_stmt_progress(&trx->stmt_progress); TOKUDB_DBUG_RETURN(0); } static int tokudb_rollback(handlerton * hton, THD * thd, bool all) { TOKUDB_DBUG_ENTER(""); DBUG_PRINT("trans", ("aborting transaction %s", all ? "all" : "stmt")); tokudb_trx_data *trx = (tokudb_trx_data *) thd_data_get(thd, hton->slot); DB_TXN **txn = all ? &trx->all : &trx->stmt; DB_TXN *this_txn = *txn; if (this_txn) { if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("rollback %u trx %p txn %p", all, trx, this_txn); } tokudb_cleanup_handlers(trx, this_txn); abort_txn_with_progress(this_txn, thd); if (this_txn == trx->sp_level) { trx->sp_level = 0; } *txn = 0; trx->sub_sp_level = NULL; } else { if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("abort0"); } } reset_stmt_progress(&trx->stmt_progress); TOKUDB_DBUG_RETURN(0); } #if TOKU_INCLUDE_XA static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) { TOKUDB_DBUG_ENTER(""); int r = 0; DBUG_PRINT("trans", ("preparing transaction %s", all ? "all" : "stmt")); tokudb_trx_data *trx = (tokudb_trx_data *) thd_data_get(thd, hton->slot); DB_TXN* txn = all ? trx->all : trx->stmt; if (txn) { if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("doing txn prepare:%d:%p", all, txn); } // a TOKU_XA_XID is identical to a MYSQL_XID TOKU_XA_XID thd_xid; thd_get_xid(thd, (MYSQL_XID*) &thd_xid); // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_prepare_before", DBUG_SUICIDE();); r = txn->xa_prepare(txn, &thd_xid); // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_prepare_after", DBUG_SUICIDE();); } else if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("nothing to prepare %d", all); } TOKUDB_DBUG_RETURN(r); } static int tokudb_xa_recover(handlerton* hton, XID* xid_list, uint len) { TOKUDB_DBUG_ENTER(""); int r = 0; if (len == 0 || xid_list == NULL) { TOKUDB_DBUG_RETURN(0); } long num_returned = 0; r = db_env->txn_xa_recover( db_env, (TOKU_XA_XID*)xid_list, len, &num_returned, DB_NEXT ); assert(r == 0); TOKUDB_DBUG_RETURN((int)num_returned); } static int tokudb_commit_by_xid(handlerton* hton, XID* xid) { TOKUDB_DBUG_ENTER(""); int r = 0; DB_TXN* txn = NULL; TOKU_XA_XID* toku_xid = (TOKU_XA_XID*)xid; r = db_env->get_txn_from_xid(db_env, toku_xid, &txn); if (r) { goto cleanup; } r = txn->commit(txn, 0); if (r) { goto cleanup; } r = 0; cleanup: TOKUDB_DBUG_RETURN(r); } static int tokudb_rollback_by_xid(handlerton* hton, XID* xid) { TOKUDB_DBUG_ENTER(""); int r = 0; DB_TXN* txn = NULL; TOKU_XA_XID* toku_xid = (TOKU_XA_XID*)xid; r = db_env->get_txn_from_xid(db_env, toku_xid, &txn); if (r) { goto cleanup; } r = txn->abort(txn); if (r) { goto cleanup; } r = 0; cleanup: TOKUDB_DBUG_RETURN(r); } #endif static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint) { TOKUDB_DBUG_ENTER(""); int error; SP_INFO save_info = (SP_INFO)savepoint; tokudb_trx_data *trx = (tokudb_trx_data *) thd_data_get(thd, hton->slot); if (thd->in_sub_stmt) { assert(trx->stmt); error = txn_begin(db_env, trx->sub_sp_level, &(save_info->txn), DB_INHERIT_ISOLATION, thd); if (error) { goto cleanup; } trx->sub_sp_level = save_info->txn; save_info->in_sub_stmt = true; } else { error = txn_begin(db_env, trx->sp_level, &(save_info->txn), DB_INHERIT_ISOLATION, thd); if (error) { goto cleanup; } trx->sp_level = save_info->txn; save_info->in_sub_stmt = false; } save_info->trx = trx; error = 0; cleanup: TOKUDB_DBUG_RETURN(error); } static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *savepoint) { TOKUDB_DBUG_ENTER(""); int error; SP_INFO save_info = (SP_INFO)savepoint; DB_TXN* parent = NULL; DB_TXN* txn_to_rollback = save_info->txn; tokudb_trx_data *trx = (tokudb_trx_data *) thd_data_get(thd, hton->slot); parent = txn_to_rollback->parent; if (!(error = txn_to_rollback->abort(txn_to_rollback))) { if (save_info->in_sub_stmt) { trx->sub_sp_level = parent; } else { trx->sp_level = parent; } error = tokudb_savepoint(hton, thd, savepoint); } TOKUDB_DBUG_RETURN(error); } static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoint) { TOKUDB_DBUG_ENTER(""); int error; SP_INFO save_info = (SP_INFO)savepoint; DB_TXN* parent = NULL; DB_TXN* txn_to_commit = save_info->txn; tokudb_trx_data *trx = (tokudb_trx_data *) thd_data_get(thd, hton->slot); parent = txn_to_commit->parent; if (!(error = txn_to_commit->commit(txn_to_commit, 0))) { if (save_info->in_sub_stmt) { trx->sub_sp_level = parent; } else { trx->sp_level = parent; } save_info->txn = NULL; } TOKUDB_DBUG_RETURN(error); } static int tokudb_discover_table(handlerton *hton, THD* thd, TABLE_SHARE *ts) { uchar *frmblob = 0; size_t frmlen; int res= tokudb_discover3(hton, thd, ts->db.str, ts->table_name.str, ts->normalized_path.str, &frmblob, &frmlen); if (!res) res= ts->init_from_binary_frm_image(thd, true, frmblob, frmlen); my_free(frmblob); // discover_table should returns HA_ERR_NO_SUCH_TABLE for "not exists" return res == ENOENT ? HA_ERR_NO_SUCH_TABLE : res; } static int tokudb_discover_table_existence(handlerton *hton, const char *db, const char *name) { uchar *frmblob = 0; size_t frmlen; int res= tokudb_discover(hton, current_thd, db, name, &frmblob, &frmlen); my_free(frmblob); return res != ENOENT; } static int tokudb_discover(handlerton *hton, THD* thd, const char *db, const char *name, uchar **frmblob, size_t *frmlen) { return tokudb_discover2(hton, thd, db, name, true, frmblob, frmlen); } static int tokudb_discover2(handlerton *hton, THD* thd, const char *db, const char *name, bool translate_name, uchar **frmblob, size_t *frmlen) { char path[FN_REFLEN + 1]; build_table_filename(path, sizeof(path) - 1, db, name, "", translate_name ? 0 : FN_IS_TMP); return tokudb_discover3(hton, thd, db, name, path, frmblob, frmlen); } static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const char *name, char *path, uchar **frmblob, size_t *frmlen) { TOKUDB_DBUG_ENTER("%s %s", db, name); int error; DB* status_db = NULL; DB_TXN* txn = NULL; HA_METADATA_KEY curr_key = hatoku_frm_data; DBT key, value; tokudb_trx_data *trx = NULL; bool do_commit = false; memset(&key, 0, sizeof(key)); memset(&value, 0, sizeof(&value)); trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot); if (thd_sql_command(thd) == SQLCOM_CREATE_TABLE && trx && trx->sub_sp_level) { txn = trx->sub_sp_level; } else { do_commit = true; error = txn_begin(db_env, 0, &txn, 0, thd); if (error) { goto cleanup; } } error = open_status_dictionary(&status_db, path, txn); if (error) { goto cleanup; } key.data = &curr_key; key.size = sizeof(curr_key); error = status_db->getf_set( status_db, txn, 0, &key, smart_dbt_callback_verify_frm, &value ); if (error) { goto cleanup; } *frmblob = (uchar *)value.data; *frmlen = value.size; error = 0; cleanup: if (status_db) { status_db->close(status_db,0); } if (do_commit && txn) { commit_txn(txn,0); } TOKUDB_DBUG_RETURN(error); } #define STATPRINT(legend, val) if (legend != NULL && val != NULL) stat_print(thd, \ tokudb_hton_name, \ strlen(tokudb_hton_name), \ legend, \ strlen(legend), \ val, \ strlen(val)) extern sys_var *intern_find_sys_var(const char *str, uint length, bool no_error); static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { TOKUDB_DBUG_ENTER(""); int error; uint64_t panic; const int panic_string_len = 1024; char panic_string[panic_string_len] = {'\0'}; uint64_t num_rows; uint64_t max_rows; fs_redzone_state redzone_state; const int bufsiz = 1024; char buf[bufsiz]; #if MYSQL_VERSION_ID < 50500 { sys_var * version = intern_find_sys_var("version", 0, false); snprintf(buf, bufsiz, "%s", version->value_ptr(thd, (enum_var_type)0, (LEX_STRING*)NULL)); STATPRINT("Version", buf); } #endif error = db_env->get_engine_status_num_rows (db_env, &max_rows); TOKU_ENGINE_STATUS_ROW_S mystat[max_rows]; error = db_env->get_engine_status (db_env, mystat, max_rows, &num_rows, &redzone_state, &panic, panic_string, panic_string_len, TOKU_ENGINE_STATUS); if (strlen(panic_string)) { STATPRINT("Environment panic string", panic_string); } if (error == 0) { if (panic) { snprintf(buf, bufsiz, "%" PRIu64, panic); STATPRINT("Environment panic", buf); } if(redzone_state == FS_BLOCKED) { STATPRINT("*** URGENT WARNING ***", "FILE SYSTEM IS COMPLETELY FULL"); snprintf(buf, bufsiz, "FILE SYSTEM IS COMPLETELY FULL"); } else if (redzone_state == FS_GREEN) { snprintf(buf, bufsiz, "more than %d percent of total file system space", 2*tokudb_fs_reserve_percent); } else if (redzone_state == FS_YELLOW) { snprintf(buf, bufsiz, "*** WARNING *** FILE SYSTEM IS GETTING FULL (less than %d percent free)", 2*tokudb_fs_reserve_percent); } else if (redzone_state == FS_RED){ snprintf(buf, bufsiz, "*** WARNING *** FILE SYSTEM IS GETTING VERY FULL (less than %d percent free): INSERTS ARE PROHIBITED", tokudb_fs_reserve_percent); } else { snprintf(buf, bufsiz, "information unavailable, unknown redzone state %d", redzone_state); } STATPRINT ("disk free space", buf); for (uint64_t row = 0; row < num_rows; row++) { switch (mystat[row].type) { case FS_STATE: snprintf(buf, bufsiz, "%" PRIu64 "", mystat[row].value.num); break; case UINT64: snprintf(buf, bufsiz, "%" PRIu64 "", mystat[row].value.num); break; case CHARSTR: snprintf(buf, bufsiz, "%s", mystat[row].value.str); break; case UNIXTIME: { time_t t = mystat[row].value.num; char tbuf[26]; snprintf(buf, bufsiz, "%.24s", ctime_r(&t, tbuf)); } break; case TOKUTIME: { double t = tokutime_to_seconds(mystat[row].value.num); snprintf(buf, bufsiz, "%.6f", t); } break; case PARCOUNT: { uint64_t v = read_partitioned_counter(mystat[row].value.parcount); snprintf(buf, bufsiz, "%" PRIu64, v); } break; default: snprintf(buf, bufsiz, "UNKNOWN STATUS TYPE: %d", mystat[row].type); break; } STATPRINT(mystat[row].legend, buf); } uint64_t bytes_inserted = read_partitioned_counter(tokudb_primary_key_bytes_inserted); snprintf(buf, bufsiz, "%" PRIu64, bytes_inserted); STATPRINT("handlerton: primary key bytes inserted", buf); } if (error) { my_errno = error; } TOKUDB_DBUG_RETURN(error); } static void tokudb_checkpoint_lock(THD * thd) { int error; const char *old_proc_info; tokudb_trx_data* trx = NULL; trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot); if (!trx) { error = create_tokudb_trx_data_instance(&trx); // // can only fail due to memory allocation, so ok to assert // assert(!error); thd_data_set(thd, tokudb_hton->slot, trx); } if (trx->checkpoint_lock_taken) { goto cleanup; } // // This can only fail if environment is not created, which is not possible // in handlerton // old_proc_info = tokudb_thd_get_proc_info(thd); thd_proc_info(thd, "Trying to grab checkpointing lock."); error = db_env->checkpointing_postpone(db_env); assert(!error); thd_proc_info(thd, old_proc_info); trx->checkpoint_lock_taken = true; cleanup: return; } static void tokudb_checkpoint_unlock(THD * thd) { int error; const char *old_proc_info; tokudb_trx_data* trx = NULL; trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot); if (!trx) { error = 0; goto cleanup; } if (!trx->checkpoint_lock_taken) { error = 0; goto cleanup; } // // at this point, we know the checkpoint lock has been taken // old_proc_info = tokudb_thd_get_proc_info(thd); thd_proc_info(thd, "Trying to release checkpointing lock."); error = db_env->checkpointing_resume(db_env); assert(!error); thd_proc_info(thd, old_proc_info); trx->checkpoint_lock_taken = false; cleanup: return; } static bool tokudb_show_status(handlerton * hton, THD * thd, stat_print_fn * stat_print, enum ha_stat_type stat_type) { switch (stat_type) { case HA_ENGINE_STATUS: return tokudb_show_engine_status(thd, stat_print); break; default: break; } return false; } #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL static void tokudb_handle_fatal_signal(handlerton *hton __attribute__ ((__unused__)), THD *thd __attribute__ ((__unused__)), int sig) { if (tokudb_gdb_on_fatal) { db_env_try_gdb_stack_trace(tokudb_gdb_path); } } #endif static void tokudb_print_error(const DB_ENV * db_env, const char *db_errpfx, const char *buffer) { sql_print_error("%s: %s", db_errpfx, buffer); } static void tokudb_cleanup_log_files(void) { TOKUDB_DBUG_ENTER(""); char **names; int error; if ((error = db_env->txn_checkpoint(db_env, 0, 0, 0))) my_error(ER_ERROR_DURING_CHECKPOINT, MYF(0), error); if ((error = db_env->log_archive(db_env, &names, 0)) != 0) { DBUG_PRINT("error", ("log_archive failed (error %d)", error)); db_env->err(db_env, error, "log_archive"); DBUG_VOID_RETURN; } if (names) { char **np; for (np = names; *np; ++np) { #if 1 if (tokudb_debug) TOKUDB_TRACE("cleanup:%s", *np); #else my_delete(*np, MYF(MY_WME)); #endif } free(names); } DBUG_VOID_RETURN; } // options flags // PLUGIN_VAR_THDLOCAL Variable is per-connection // PLUGIN_VAR_READONLY Server variable is read only // PLUGIN_VAR_NOSYSVAR Not a server variable // PLUGIN_VAR_NOCMDOPT Not a command line option // PLUGIN_VAR_NOCMDARG No argument for cmd line // PLUGIN_VAR_RQCMDARG Argument required for cmd line // PLUGIN_VAR_OPCMDARG Argument optional for cmd line // PLUGIN_VAR_MEMALLOC String needs memory allocated // system variables static void tokudb_cleaner_period_update(THD * thd, struct st_mysql_sys_var * sys_var, void * var, const void * save) { ulong * cleaner_period = (ulong *) var; *cleaner_period = *(const ulonglong *) save; int r = db_env->cleaner_set_period(db_env, *cleaner_period); assert(r == 0); } #define DEFAULT_CLEANER_PERIOD 1 static MYSQL_SYSVAR_ULONG(cleaner_period, tokudb_cleaner_period, 0, "TokuDB cleaner_period", NULL, tokudb_cleaner_period_update, DEFAULT_CLEANER_PERIOD, 0, ~0UL, 0); static void tokudb_cleaner_iterations_update(THD * thd, struct st_mysql_sys_var * sys_var, void * var, const void * save) { ulong * cleaner_iterations = (ulong *) var; *cleaner_iterations = *(const ulonglong *) save; int r = db_env->cleaner_set_iterations(db_env, *cleaner_iterations); assert(r == 0); } #define DEFAULT_CLEANER_ITERATIONS 5 static MYSQL_SYSVAR_ULONG(cleaner_iterations, tokudb_cleaner_iterations, 0, "TokuDB cleaner_iterations", NULL, tokudb_cleaner_iterations_update, DEFAULT_CLEANER_ITERATIONS, 0, ~0UL, 0); static void tokudb_checkpointing_period_update(THD * thd, struct st_mysql_sys_var * sys_var, void * var, const void * save) { uint * checkpointing_period = (uint *) var; *checkpointing_period = *(const ulonglong *) save; int r = db_env->checkpointing_set_period(db_env, *checkpointing_period); assert(r == 0); } static MYSQL_SYSVAR_UINT(checkpointing_period, tokudb_checkpointing_period, 0, "TokuDB Checkpointing period", NULL, tokudb_checkpointing_period_update, 60, 0, ~0U, 0); static MYSQL_SYSVAR_BOOL(directio, tokudb_directio, PLUGIN_VAR_READONLY, "TokuDB Enable Direct I/O ", NULL, NULL, FALSE); static MYSQL_SYSVAR_BOOL(checkpoint_on_flush_logs, tokudb_checkpoint_on_flush_logs, 0, "TokuDB Checkpoint on Flush Logs ", NULL, NULL, FALSE); static MYSQL_SYSVAR_ULONGLONG(cache_size, tokudb_cache_size, PLUGIN_VAR_READONLY, "TokuDB cache table size", NULL, NULL, 0, 0, ~0ULL, 0); static MYSQL_SYSVAR_ULONGLONG(max_lock_memory, tokudb_max_lock_memory, PLUGIN_VAR_READONLY, "TokuDB max memory for locks", NULL, NULL, 0, 0, ~0ULL, 0); static MYSQL_SYSVAR_ULONG(debug, tokudb_debug, 0, "TokuDB Debug", NULL, NULL, 0, 0, ~0UL, 0); static MYSQL_SYSVAR_STR(log_dir, tokudb_log_dir, PLUGIN_VAR_READONLY, "TokuDB Log Directory", NULL, NULL, NULL); static MYSQL_SYSVAR_STR(data_dir, tokudb_data_dir, PLUGIN_VAR_READONLY, "TokuDB Data Directory", NULL, NULL, NULL); static MYSQL_SYSVAR_STR(version, tokudb_version, PLUGIN_VAR_READONLY, "TokuDB Version", NULL, NULL, NULL); static MYSQL_SYSVAR_UINT(init_flags, tokudb_init_flags, PLUGIN_VAR_READONLY, "Sets TokuDB DB_ENV->open flags", NULL, NULL, tokudb_init_flags, 0, ~0U, 0); static MYSQL_SYSVAR_UINT(write_status_frequency, tokudb_write_status_frequency, 0, "TokuDB frequency that show processlist updates status of writes", NULL, NULL, 1000, 0, ~0U, 0); static MYSQL_SYSVAR_UINT(read_status_frequency, tokudb_read_status_frequency, 0, "TokuDB frequency that show processlist updates status of reads", NULL, NULL, 10000, 0, ~0U, 0); static MYSQL_SYSVAR_INT(fs_reserve_percent, tokudb_fs_reserve_percent, PLUGIN_VAR_READONLY, "TokuDB file system space reserve (percent free required)", NULL, NULL, 5, 0, 100, 0); static MYSQL_SYSVAR_STR(tmp_dir, tokudb_tmp_dir, PLUGIN_VAR_READONLY, "Tokudb Tmp Dir", NULL, NULL, NULL); #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL static MYSQL_SYSVAR_STR(gdb_path, tokudb_gdb_path, PLUGIN_VAR_READONLY|PLUGIN_VAR_RQCMDARG, "TokuDB path to gdb for extra debug info on fatal signal", NULL, NULL, "/usr/bin/gdb"); static MYSQL_SYSVAR_BOOL(gdb_on_fatal, tokudb_gdb_on_fatal, 0, "TokuDB enable gdb debug info on fatal signal", NULL, NULL, true); #endif static void tokudb_fsync_log_period_update(THD *thd, struct st_mysql_sys_var *sys_var, void *var, const void *save) { uint32 *period = (uint32 *) var; *period = *(const ulonglong *) save; db_env->change_fsync_log_period(db_env, *period); } static MYSQL_SYSVAR_UINT(fsync_log_period, tokudb_fsync_log_period, 0, "TokuDB fsync log period", NULL, tokudb_fsync_log_period_update, 0, 0, ~0U, 0); static struct st_mysql_sys_var *tokudb_system_variables[] = { MYSQL_SYSVAR(cache_size), MYSQL_SYSVAR(max_lock_memory), MYSQL_SYSVAR(data_dir), MYSQL_SYSVAR(log_dir), MYSQL_SYSVAR(debug), MYSQL_SYSVAR(commit_sync), MYSQL_SYSVAR(lock_timeout), MYSQL_SYSVAR(cleaner_period), MYSQL_SYSVAR(cleaner_iterations), MYSQL_SYSVAR(pk_insert_mode), MYSQL_SYSVAR(load_save_space), MYSQL_SYSVAR(disable_slow_alter), MYSQL_SYSVAR(disable_hot_alter), MYSQL_SYSVAR(alter_print_error), MYSQL_SYSVAR(create_index_online), MYSQL_SYSVAR(disable_prefetching), MYSQL_SYSVAR(version), MYSQL_SYSVAR(init_flags), MYSQL_SYSVAR(checkpointing_period), MYSQL_SYSVAR(prelock_empty), MYSQL_SYSVAR(checkpoint_lock), MYSQL_SYSVAR(write_status_frequency), MYSQL_SYSVAR(read_status_frequency), MYSQL_SYSVAR(fs_reserve_percent), MYSQL_SYSVAR(tmp_dir), MYSQL_SYSVAR(block_size), MYSQL_SYSVAR(read_block_size), MYSQL_SYSVAR(read_buf_size), MYSQL_SYSVAR(row_format), MYSQL_SYSVAR(directio), MYSQL_SYSVAR(checkpoint_on_flush_logs), #if TOKU_INCLUDE_UPSERT MYSQL_SYSVAR(disable_slow_update), MYSQL_SYSVAR(disable_slow_upsert), #endif MYSQL_SYSVAR(analyze_time), MYSQL_SYSVAR(fsync_log_period), #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL MYSQL_SYSVAR(gdb_path), MYSQL_SYSVAR(gdb_on_fatal), #endif MYSQL_SYSVAR(last_lock_timeout), MYSQL_SYSVAR(lock_timeout_debug), MYSQL_SYSVAR(loader_memory_size), MYSQL_SYSVAR(hide_default_row_format), MYSQL_SYSVAR(killed_time), NULL }; struct st_mysql_storage_engine tokudb_storage_engine = { MYSQL_HANDLERTON_INTERFACE_VERSION }; static struct st_mysql_information_schema tokudb_file_map_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; static ST_FIELD_INFO tokudb_file_map_field_info[] = { {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} }; static int tokudb_file_map(TABLE *table, THD *thd) { int error; DB_TXN* txn = NULL; DBC* tmp_cursor = NULL; DBT curr_key; DBT curr_val; memset(&curr_key, 0, sizeof curr_key); memset(&curr_val, 0, sizeof curr_val); error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); if (error) { goto cleanup; } error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); if (error) { goto cleanup; } while (error == 0) { error = tmp_cursor->c_get(tmp_cursor, &curr_key, &curr_val, DB_NEXT); if (!error) { // We store the NULL terminator in the directory so it's included in the size. // See #5789 // Recalculate and check just to be safe. const char *dname = (const char *) curr_key.data; size_t dname_len = strlen(dname); assert(dname_len == curr_key.size - 1); table->field[0]->store(dname, dname_len, system_charset_info); const char *iname = (const char *) curr_val.data; size_t iname_len = strlen(iname); assert(iname_len == curr_val.size - 1); table->field[1]->store(iname, iname_len, system_charset_info); // denormalize the dname const char *database_name = NULL; size_t database_len = 0; const char *table_name = NULL; size_t table_len = 0; const char *dictionary_name = NULL; size_t dictionary_len = 0; database_name = strchr(dname, '/'); if (database_name) { database_name += 1; table_name = strchr(database_name, '/'); if (table_name) { database_len = table_name - database_name; table_name += 1; dictionary_name = strchr(table_name, '-'); if (dictionary_name) { table_len = dictionary_name - table_name; dictionary_name += 1; dictionary_len = strlen(dictionary_name); } } } table->field[2]->store(database_name, database_len, system_charset_info); table->field[3]->store(table_name, table_len, system_charset_info); table->field[4]->store(dictionary_name, dictionary_len, system_charset_info); error = schema_table_store_record(thd, table); } } if (error == DB_NOTFOUND) { error = 0; } cleanup: if (tmp_cursor) { int r = tmp_cursor->c_close(tmp_cursor); assert(r == 0); } if (txn) { commit_txn(txn, 0); } return error; } #if MYSQL_VERSION_ID >= 50600 static int tokudb_file_map_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { #else static int tokudb_file_map_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { #endif TOKUDB_DBUG_ENTER(""); int error; TABLE *table = tables->table; rw_rdlock(&tokudb_hton_initialized_lock); if (!tokudb_hton_initialized) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "TokuDB"); error = -1; } else { error = tokudb_file_map(table, thd); } rw_unlock(&tokudb_hton_initialized_lock); TOKUDB_DBUG_RETURN(error); } static int tokudb_file_map_init(void *p) { ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; schema->fields_info = tokudb_file_map_field_info; schema->fill_table = tokudb_file_map_fill_table; return 0; } static int tokudb_file_map_done(void *p) { return 0; } static struct st_mysql_information_schema tokudb_fractal_tree_info_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; static ST_FIELD_INFO tokudb_fractal_tree_info_field_info[] = { {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"bt_num_blocks_allocated", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"bt_num_blocks_in_use", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"bt_size_allocated", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"bt_size_in_use", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} }; static int tokudb_report_fractal_tree_info_for_db(const DBT *dname, const DBT *iname, TABLE *table, THD *thd) { int error; DB *db; uint64_t bt_num_blocks_allocated; uint64_t bt_num_blocks_in_use; uint64_t bt_size_allocated; uint64_t bt_size_in_use; error = db_create(&db, db_env, 0); if (error) { goto exit; } error = db->open(db, NULL, (char *)dname->data, NULL, DB_BTREE, 0, 0666); if (error) { goto exit; } error = db->get_fractal_tree_info64(db, &bt_num_blocks_allocated, &bt_num_blocks_in_use, &bt_size_allocated, &bt_size_in_use); { int close_error = db->close(db, 0); if (!error) { error = close_error; } } if (error) { goto exit; } // We store the NULL terminator in the directory so it's included in the size. // See #5789 // Recalculate and check just to be safe. { size_t dname_len = strlen((const char *)dname->data); size_t iname_len = strlen((const char *)iname->data); assert(dname_len == dname->size - 1); assert(iname_len == iname->size - 1); table->field[0]->store( (char *)dname->data, dname_len, system_charset_info ); table->field[1]->store( (char *)iname->data, iname_len, system_charset_info ); } table->field[2]->store(bt_num_blocks_allocated, false); table->field[3]->store(bt_num_blocks_in_use, false); table->field[4]->store(bt_size_allocated, false); table->field[5]->store(bt_size_in_use, false); error = schema_table_store_record(thd, table); exit: return error; } static int tokudb_fractal_tree_info(TABLE *table, THD *thd) { int error; DB_TXN* txn = NULL; DBC* tmp_cursor = NULL; DBT curr_key; DBT curr_val; memset(&curr_key, 0, sizeof curr_key); memset(&curr_val, 0, sizeof curr_val); error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); if (error) { goto cleanup; } error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); if (error) { goto cleanup; } while (error == 0) { error = tmp_cursor->c_get( tmp_cursor, &curr_key, &curr_val, DB_NEXT ); if (!error) { error = tokudb_report_fractal_tree_info_for_db(&curr_key, &curr_val, table, thd); } } if (error == DB_NOTFOUND) { error = 0; } cleanup: if (tmp_cursor) { int r = tmp_cursor->c_close(tmp_cursor); assert(r == 0); } if (txn) { commit_txn(txn, 0); } return error; } #if MYSQL_VERSION_ID >= 50600 static int tokudb_fractal_tree_info_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { #else static int tokudb_fractal_tree_info_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { #endif TOKUDB_DBUG_ENTER(""); int error; TABLE *table = tables->table; // 3938: Get a read lock on the status flag, since we must // read it before safely proceeding rw_rdlock(&tokudb_hton_initialized_lock); if (!tokudb_hton_initialized) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "TokuDB"); error = -1; } else { error = tokudb_fractal_tree_info(table, thd); } //3938: unlock the status flag lock rw_unlock(&tokudb_hton_initialized_lock); TOKUDB_DBUG_RETURN(error); } static int tokudb_fractal_tree_info_init(void *p) { ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; schema->fields_info = tokudb_fractal_tree_info_field_info; schema->fill_table = tokudb_fractal_tree_info_fill_table; return 0; } static int tokudb_fractal_tree_info_done(void *p) { return 0; } static struct st_mysql_information_schema tokudb_fractal_tree_block_map_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; static ST_FIELD_INFO tokudb_fractal_tree_block_map_field_info[] = { {"dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"internal_file_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"checkpoint_count", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"blocknum", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"offset", 0, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE }, {"size", 0, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, NULL, SKIP_OPEN_TABLE }, {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} }; struct tokudb_report_fractal_tree_block_map_iterator_extra { int64_t num_rows; int64_t i; uint64_t *checkpoint_counts; int64_t *blocknums; int64_t *diskoffs; int64_t *sizes; }; // This iterator is called while holding the blocktable lock. We should be as quick as possible. // We don't want to do one call to get the number of rows, release the blocktable lock, and then do another call to get all the rows because the number of rows may change if we don't hold the lock. // As a compromise, we'll do some mallocs inside the lock on the first call, but everything else should be fast. static int tokudb_report_fractal_tree_block_map_iterator(uint64_t checkpoint_count, int64_t num_rows, int64_t blocknum, int64_t diskoff, int64_t size, void *iter_extra) { struct tokudb_report_fractal_tree_block_map_iterator_extra *e = static_cast<struct tokudb_report_fractal_tree_block_map_iterator_extra *>(iter_extra); assert(num_rows > 0); if (e->num_rows == 0) { e->checkpoint_counts = (uint64_t *) tokudb_my_malloc(num_rows * (sizeof *e->checkpoint_counts), MYF(MY_WME|MY_ZEROFILL|MY_FAE)); e->blocknums = (int64_t *) tokudb_my_malloc(num_rows * (sizeof *e->blocknums), MYF(MY_WME|MY_ZEROFILL|MY_FAE)); e->diskoffs = (int64_t *) tokudb_my_malloc(num_rows * (sizeof *e->diskoffs), MYF(MY_WME|MY_ZEROFILL|MY_FAE)); e->sizes = (int64_t *) tokudb_my_malloc(num_rows * (sizeof *e->sizes), MYF(MY_WME|MY_ZEROFILL|MY_FAE)); e->num_rows = num_rows; } e->checkpoint_counts[e->i] = checkpoint_count; e->blocknums[e->i] = blocknum; e->diskoffs[e->i] = diskoff; e->sizes[e->i] = size; ++(e->i); return 0; } static int tokudb_report_fractal_tree_block_map_for_db(const DBT *dname, const DBT *iname, TABLE *table, THD *thd) { int error; DB *db; struct tokudb_report_fractal_tree_block_map_iterator_extra e = {}; // avoid struct initializers so that we can compile with older gcc versions error = db_create(&db, db_env, 0); if (error) { goto exit; } error = db->open(db, NULL, (char *)dname->data, NULL, DB_BTREE, 0, 0666); if (error) { goto exit; } error = db->iterate_fractal_tree_block_map(db, tokudb_report_fractal_tree_block_map_iterator, &e); { int close_error = db->close(db, 0); if (!error) { error = close_error; } } if (error) { goto exit; } // If not, we should have gotten an error and skipped this section of code assert(e.i == e.num_rows); for (int64_t i = 0; error == 0 && i < e.num_rows; ++i) { // We store the NULL terminator in the directory so it's included in the size. // See #5789 // Recalculate and check just to be safe. size_t dname_len = strlen((const char *)dname->data); size_t iname_len = strlen((const char *)iname->data); assert(dname_len == dname->size - 1); assert(iname_len == iname->size - 1); table->field[0]->store( (char *)dname->data, dname_len, system_charset_info ); table->field[1]->store( (char *)iname->data, iname_len, system_charset_info ); table->field[2]->store(e.checkpoint_counts[i], false); table->field[3]->store(e.blocknums[i], false); static const int64_t freelist_null = -1; static const int64_t diskoff_unused = -2; if (e.diskoffs[i] == diskoff_unused || e.diskoffs[i] == freelist_null) { table->field[4]->set_null(); } else { table->field[4]->set_notnull(); table->field[4]->store(e.diskoffs[i], false); } static const int64_t size_is_free = -1; if (e.sizes[i] == size_is_free) { table->field[5]->set_null(); } else { table->field[5]->set_notnull(); table->field[5]->store(e.sizes[i], false); } error = schema_table_store_record(thd, table); } exit: if (e.checkpoint_counts != NULL) { tokudb_my_free(e.checkpoint_counts); e.checkpoint_counts = NULL; } if (e.blocknums != NULL) { tokudb_my_free(e.blocknums); e.blocknums = NULL; } if (e.diskoffs != NULL) { tokudb_my_free(e.diskoffs); e.diskoffs = NULL; } if (e.sizes != NULL) { tokudb_my_free(e.sizes); e.sizes = NULL; } return error; } static int tokudb_fractal_tree_block_map(TABLE *table, THD *thd) { int error; DB_TXN* txn = NULL; DBC* tmp_cursor = NULL; DBT curr_key; DBT curr_val; memset(&curr_key, 0, sizeof curr_key); memset(&curr_val, 0, sizeof curr_val); error = txn_begin(db_env, 0, &txn, DB_READ_UNCOMMITTED, thd); if (error) { goto cleanup; } error = db_env->get_cursor_for_directory(db_env, txn, &tmp_cursor); if (error) { goto cleanup; } while (error == 0) { error = tmp_cursor->c_get( tmp_cursor, &curr_key, &curr_val, DB_NEXT ); if (!error) { error = tokudb_report_fractal_tree_block_map_for_db(&curr_key, &curr_val, table, thd); } } if (error == DB_NOTFOUND) { error = 0; } cleanup: if (tmp_cursor) { int r = tmp_cursor->c_close(tmp_cursor); assert(r == 0); } if (txn) { commit_txn(txn, 0); } return error; } #if MYSQL_VERSION_ID >= 50600 static int tokudb_fractal_tree_block_map_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { #else static int tokudb_fractal_tree_block_map_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { #endif TOKUDB_DBUG_ENTER(""); int error; TABLE *table = tables->table; // 3938: Get a read lock on the status flag, since we must // read it before safely proceeding rw_rdlock(&tokudb_hton_initialized_lock); if (!tokudb_hton_initialized) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "TokuDB"); error = -1; } else { error = tokudb_fractal_tree_block_map(table, thd); } //3938: unlock the status flag lock rw_unlock(&tokudb_hton_initialized_lock); TOKUDB_DBUG_RETURN(error); } static int tokudb_fractal_tree_block_map_init(void *p) { ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; schema->fields_info = tokudb_fractal_tree_block_map_field_info; schema->fill_table = tokudb_fractal_tree_block_map_fill_table; return 0; } static int tokudb_fractal_tree_block_map_done(void *p) { return 0; } static void tokudb_pretty_key(const DB *db, const DBT *key, const char *default_key, String *out) { if (key->data == NULL) { out->append(default_key); } else { bool do_hexdump = true; if (do_hexdump) { // hexdump the key const unsigned char *data = reinterpret_cast<const unsigned char *>(key->data); for (size_t i = 0; i < key->size; i++) { char str[3]; snprintf(str, sizeof str, "%2.2x", data[i]); out->append(str); } } } } static void tokudb_pretty_left_key(const DB *db, const DBT *key, String *out) { tokudb_pretty_key(db, key, "-infinity", out); } static void tokudb_pretty_right_key(const DB *db, const DBT *key, String *out) { tokudb_pretty_key(db, key, "+infinity", out); } static const char *tokudb_get_index_name(DB *db) { if (db != NULL) { return db->get_dname(db); } else { return "$ydb_internal"; } } static int tokudb_equal_key(const DBT *left_key, const DBT *right_key) { if (left_key->data == NULL || right_key->data == NULL || left_key->size != right_key->size) return 0; else return memcmp(left_key->data, right_key->data, left_key->size) == 0; } static void tokudb_lock_timeout_callback(DB *db, uint64_t requesting_txnid, const DBT *left_key, const DBT *right_key, uint64_t blocking_txnid) { THD *thd = current_thd; if (!thd) return; ulong lock_timeout_debug = THDVAR(thd, lock_timeout_debug); if (lock_timeout_debug != 0) { // generate a JSON document with the lock timeout info String log_str; log_str.append("{"); log_str.append("\"mysql_thread_id\":"); log_str.append_ulonglong(thd->thread_id); log_str.append(", \"dbname\":"); log_str.append("\""); log_str.append(tokudb_get_index_name(db)); log_str.append("\""); log_str.append(", \"requesting_txnid\":"); log_str.append_ulonglong(requesting_txnid); log_str.append(", \"blocking_txnid\":"); log_str.append_ulonglong(blocking_txnid); if (tokudb_equal_key(left_key, right_key)) { String key_str; tokudb_pretty_key(db, left_key, "?", &key_str); log_str.append(", \"key\":"); log_str.append("\""); log_str.append(key_str); log_str.append("\""); } else { String left_str; tokudb_pretty_left_key(db, left_key, &left_str); log_str.append(", \"key_left\":"); log_str.append("\""); log_str.append(left_str); log_str.append("\""); String right_str; tokudb_pretty_right_key(db, right_key, &right_str); log_str.append(", \"key_right\":"); log_str.append("\""); log_str.append(right_str); log_str.append("\""); } log_str.append("}"); // set last_lock_timeout if (lock_timeout_debug & 1) { char *old_lock_timeout = THDVAR(thd, last_lock_timeout); char *new_lock_timeout = tokudb_my_strdup(log_str.c_ptr(), MY_FAE); THDVAR(thd, last_lock_timeout) = new_lock_timeout; tokudb_my_free(old_lock_timeout); #if TOKU_THDVAR_MEMALLOC_BUG if (0) TOKUDB_TRACE("thd %p %p %p", thd, old_lock_timeout, new_lock_timeout); tokudb_pthread_mutex_lock(&tokudb_map_mutex); struct tokudb_map_pair old_key = { thd, old_lock_timeout }; tree_delete(&tokudb_map, &old_key, sizeof old_key, NULL); struct tokudb_map_pair new_key = { thd, new_lock_timeout }; tree_insert(&tokudb_map, &new_key, sizeof new_key, NULL); tokudb_pthread_mutex_unlock(&tokudb_map_mutex); #endif } // dump to stderr if (lock_timeout_debug & 2) { TOKUDB_TRACE("%s", log_str.c_ptr()); } } } static struct st_mysql_information_schema tokudb_trx_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; static ST_FIELD_INFO tokudb_trx_field_info[] = { {"trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"trx_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} }; struct tokudb_trx_extra { THD *thd; TABLE *table; }; static int tokudb_trx_callback(uint64_t txn_id, uint64_t client_id, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { struct tokudb_trx_extra *e = reinterpret_cast<struct tokudb_trx_extra *>(extra); THD *thd = e->thd; TABLE *table = e->table; table->field[0]->store(txn_id, false); table->field[1]->store(client_id, false); int error = schema_table_store_record(thd, table); return error; } #if MYSQL_VERSION_ID >= 50600 static int tokudb_trx_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { #else static int tokudb_trx_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { #endif TOKUDB_DBUG_ENTER(""); int error; rw_rdlock(&tokudb_hton_initialized_lock); if (!tokudb_hton_initialized) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "TokuDB"); error = -1; } else { struct tokudb_trx_extra e = { thd, tables->table }; error = db_env->iterate_live_transactions(db_env, tokudb_trx_callback, &e); } rw_unlock(&tokudb_hton_initialized_lock); TOKUDB_DBUG_RETURN(error); } static int tokudb_trx_init(void *p) { ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; schema->fields_info = tokudb_trx_field_info; schema->fill_table = tokudb_trx_fill_table; return 0; } static int tokudb_trx_done(void *p) { return 0; } static struct st_mysql_information_schema tokudb_lock_waits_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; static ST_FIELD_INFO tokudb_lock_waits_field_info[] = { {"requesting_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"blocking_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"lock_waits_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"lock_waits_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"lock_waits_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"lock_waits_start_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} }; struct tokudb_lock_waits_extra { THD *thd; TABLE *table; }; static int tokudb_lock_waits_callback(DB *db, uint64_t requesting_txnid, const DBT *left_key, const DBT *right_key, uint64_t blocking_txnid, uint64_t start_time, void *extra) { struct tokudb_lock_waits_extra *e = reinterpret_cast<struct tokudb_lock_waits_extra *>(extra); THD *thd = e->thd; TABLE *table = e->table; table->field[0]->store(requesting_txnid, false); table->field[1]->store(blocking_txnid, false); const char *dname = tokudb_get_index_name(db); size_t dname_length = strlen(dname); table->field[2]->store(dname, dname_length, system_charset_info); String left_str; tokudb_pretty_left_key(db, left_key, &left_str); table->field[3]->store(left_str.ptr(), left_str.length(), system_charset_info); String right_str; tokudb_pretty_right_key(db, right_key, &right_str); table->field[4]->store(right_str.ptr(), right_str.length(), system_charset_info); table->field[5]->store(start_time, false); int error = schema_table_store_record(thd, table); return error; } #if MYSQL_VERSION_ID >= 50600 static int tokudb_lock_waits_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { #else static int tokudb_lock_waits_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { #endif TOKUDB_DBUG_ENTER(""); int error; rw_rdlock(&tokudb_hton_initialized_lock); if (!tokudb_hton_initialized) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "TokuDB"); error = -1; } else { struct tokudb_lock_waits_extra e = { thd, tables->table }; error = db_env->iterate_pending_lock_requests(db_env, tokudb_lock_waits_callback, &e); } rw_unlock(&tokudb_hton_initialized_lock); TOKUDB_DBUG_RETURN(error); } static int tokudb_lock_waits_init(void *p) { ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; schema->fields_info = tokudb_lock_waits_field_info; schema->fill_table = tokudb_lock_waits_fill_table; return 0; } static int tokudb_lock_waits_done(void *p) { return 0; } static struct st_mysql_information_schema tokudb_locks_information_schema = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; static ST_FIELD_INFO tokudb_locks_field_info[] = { {"locks_trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"locks_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE }, {"locks_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"locks_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {"locks_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE }, {NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE} }; struct tokudb_locks_extra { THD *thd; TABLE *table; }; static int tokudb_locks_callback(uint64_t txn_id, uint64_t client_id, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) { struct tokudb_locks_extra *e = reinterpret_cast<struct tokudb_locks_extra *>(extra); THD *thd = e->thd; TABLE *table = e->table; int error = 0; DB *db; DBT left_key, right_key; while (error == 0 && iterate_locks(&db, &left_key, &right_key, locks_extra) == 0) { table->field[0]->store(txn_id, false); table->field[1]->store(client_id, false); const char *dname = tokudb_get_index_name(db); size_t dname_length = strlen(dname); table->field[2]->store(dname, dname_length, system_charset_info); String left_str; tokudb_pretty_left_key(db, &left_key, &left_str); table->field[3]->store(left_str.ptr(), left_str.length(), system_charset_info); String right_str; tokudb_pretty_right_key(db, &right_key, &right_str); table->field[4]->store(right_str.ptr(), right_str.length(), system_charset_info); error = schema_table_store_record(thd, table); } return error; } #if MYSQL_VERSION_ID >= 50600 static int tokudb_locks_fill_table(THD *thd, TABLE_LIST *tables, Item *cond) { #else static int tokudb_locks_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) { #endif TOKUDB_DBUG_ENTER(""); int error; rw_rdlock(&tokudb_hton_initialized_lock); if (!tokudb_hton_initialized) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), "TokuDB"); error = -1; } else { struct tokudb_locks_extra e = { thd, tables->table }; error = db_env->iterate_live_transactions(db_env, tokudb_locks_callback, &e); } rw_unlock(&tokudb_hton_initialized_lock); TOKUDB_DBUG_RETURN(error); } static int tokudb_locks_init(void *p) { ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; schema->fields_info = tokudb_locks_field_info; schema->fill_table = tokudb_locks_fill_table; return 0; } static int tokudb_locks_done(void *p) { return 0; } enum { TOKUDB_PLUGIN_VERSION = 0x0400 }; #define TOKUDB_PLUGIN_VERSION_STR "1024" // Retrieves variables for information_schema.global_status. // Names (columnname) are automatically converted to upper case, and prefixed with "TOKUDB_" static int show_tokudb_vars(THD *thd, SHOW_VAR *var, char *buff) { TOKUDB_DBUG_ENTER(""); int error; uint64_t panic; const int panic_string_len = 1024; char panic_string[panic_string_len] = {'\0'}; fs_redzone_state redzone_state; uint64_t num_rows; error = db_env->get_engine_status (db_env, toku_global_status_rows, toku_global_status_max_rows, &num_rows, &redzone_state, &panic, panic_string, panic_string_len, TOKU_GLOBAL_STATUS); //TODO: Maybe do something with the panic output? if (error == 0) { assert(num_rows <= toku_global_status_max_rows); //TODO: Maybe enable some of the items here: (copied from engine status //TODO: (optionally) add redzone state, panic, panic string, etc. Right now it's being ignored. for (uint64_t row = 0; row < num_rows; row++) { SHOW_VAR &status_var = toku_global_status_variables[row]; TOKU_ENGINE_STATUS_ROW_S &status_row = toku_global_status_rows[row]; status_var.name = status_row.columnname; switch (status_row.type) { case FS_STATE: case UINT64: status_var.type = SHOW_LONGLONG; status_var.value = (char*)&status_row.value.num; break; case CHARSTR: status_var.type = SHOW_CHAR; status_var.value = (char*)status_row.value.str; break; case UNIXTIME: { status_var.type = SHOW_CHAR; time_t t = status_row.value.num; char tbuf[26]; // Reuse the memory in status_row. (It belongs to us). snprintf(status_row.value.datebuf, sizeof(status_row.value.datebuf), "%.24s", ctime_r(&t, tbuf)); status_var.value = (char*)&status_row.value.datebuf[0]; } break; case TOKUTIME: { status_var.type = SHOW_DOUBLE; double t = tokutime_to_seconds(status_row.value.num); // Reuse the memory in status_row. (It belongs to us). status_row.value.dnum = t; status_var.value = (char*)&status_row.value.dnum; } break; case PARCOUNT: { status_var.type = SHOW_LONGLONG; uint64_t v = read_partitioned_counter(status_row.value.parcount); // Reuse the memory in status_row. (It belongs to us). status_row.value.num = v; status_var.value = (char*)&status_row.value.num; } break; default: { status_var.type = SHOW_CHAR; // Reuse the memory in status_row.datebuf. (It belongs to us). // UNKNOWN TYPE: %d fits in 26 bytes (sizeof datebuf) for any integer. snprintf(status_row.value.datebuf, sizeof(status_row.value.datebuf), "UNKNOWN TYPE: %d", status_row.type); status_var.value = (char*)&status_row.value.datebuf[0]; } break; } } // Sentinel value at end. toku_global_status_variables[num_rows].type = SHOW_LONG; toku_global_status_variables[num_rows].value = (char*)NullS; toku_global_status_variables[num_rows].name = (char*)NullS; var->type= SHOW_ARRAY; var->value= (char *) toku_global_status_variables; } if (error) { my_errno = error; } TOKUDB_DBUG_RETURN(error); } static SHOW_VAR toku_global_status_variables_export[]= { {"Tokudb", (char*)&show_tokudb_vars, SHOW_FUNC}, {NullS, NullS, SHOW_LONG} }; mysql_declare_plugin(tokudb) { MYSQL_STORAGE_ENGINE_PLUGIN, &tokudb_storage_engine, tokudb_hton_name, "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_init_func, /* plugin init */ tokudb_done_func, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ toku_global_status_variables_export, /* status variables */ tokudb_system_variables, /* system variables */ NULL, /* config options */ #if MYSQL_VERSION_ID >= 50521 0, /* flags */ #endif }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_trx_information_schema, "TokuDB_trx", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_trx_init, /* plugin init */ tokudb_trx_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ NULL, /* config options */ #if MYSQL_VERSION_ID >= 50521 0, /* flags */ #endif }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_lock_waits_information_schema, "TokuDB_lock_waits", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_lock_waits_init, /* plugin init */ tokudb_lock_waits_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ NULL, /* config options */ #if MYSQL_VERSION_ID >= 50521 0, /* flags */ #endif }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_locks_information_schema, "TokuDB_locks", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_locks_init, /* plugin init */ tokudb_locks_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ NULL, /* config options */ #if MYSQL_VERSION_ID >= 50521 0, /* flags */ #endif }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_file_map_information_schema, "TokuDB_file_map", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_file_map_init, /* plugin init */ tokudb_file_map_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ NULL, /* config options */ #if MYSQL_VERSION_ID >= 50521 0, /* flags */ #endif }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_fractal_tree_info_information_schema, "TokuDB_fractal_tree_info", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_fractal_tree_info_init, /* plugin init */ tokudb_fractal_tree_info_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ NULL, /* config options */ #if MYSQL_VERSION_ID >= 50521 0, /* flags */ #endif }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_fractal_tree_block_map_information_schema, "TokuDB_fractal_tree_block_map", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_fractal_tree_block_map_init, /* plugin init */ tokudb_fractal_tree_block_map_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ NULL, /* config options */ #if MYSQL_VERSION_ID >= 50521 0, /* flags */ #endif } mysql_declare_plugin_end; #ifdef MARIA_PLUGIN_INTERFACE_VERSION maria_declare_plugin(tokudb) { MYSQL_STORAGE_ENGINE_PLUGIN, &tokudb_storage_engine, tokudb_hton_name, "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_init_func, /* plugin init */ tokudb_done_func, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ toku_global_status_variables_export, /* status variables */ tokudb_system_variables, /* system variables */ TOKUDB_PLUGIN_VERSION_STR, /* string version */ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */ }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_trx_information_schema, "TokuDB_trx", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_trx_init, /* plugin init */ tokudb_trx_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ TOKUDB_PLUGIN_VERSION_STR, /* string version */ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */ }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_lock_waits_information_schema, "TokuDB_lock_waits", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_lock_waits_init, /* plugin init */ tokudb_lock_waits_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ TOKUDB_PLUGIN_VERSION_STR, /* string version */ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */ }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_locks_information_schema, "TokuDB_locks", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_locks_init, /* plugin init */ tokudb_locks_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ TOKUDB_PLUGIN_VERSION_STR, /* string version */ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */ }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_file_map_information_schema, "TokuDB_file_map", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_file_map_init, /* plugin init */ tokudb_file_map_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ TOKUDB_PLUGIN_VERSION_STR, /* string version */ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */ }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_fractal_tree_info_information_schema, "TokuDB_fractal_tree_info", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_fractal_tree_info_init, /* plugin init */ tokudb_fractal_tree_info_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ TOKUDB_PLUGIN_VERSION_STR, /* string version */ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */ }, { MYSQL_INFORMATION_SCHEMA_PLUGIN, &tokudb_fractal_tree_block_map_information_schema, "TokuDB_fractal_tree_block_map", "Tokutek Inc", "Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology", PLUGIN_LICENSE_GPL, tokudb_fractal_tree_block_map_init, /* plugin init */ tokudb_fractal_tree_block_map_done, /* plugin deinit */ TOKUDB_PLUGIN_VERSION, /* 4.0.0 */ NULL, /* status variables */ NULL, /* system variables */ TOKUDB_PLUGIN_VERSION_STR, /* string version */ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */ } maria_declare_plugin_end; #endif
Java
//GoodGBX - 1.020.0.dat char long_name[255]; #define DATROMS (2995+3501) #define GBC_ROMS 2995 struct { int crc; int size; char name[255]; } MyDat[DATROMS]={ //GBC!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! {0x204e2ceb,1048486,"1942 (U) [C][b1]"}, {0x1d7640cb,1048576,"720 (U) [C][b1]"}, {0x2a0e4db1,1048576,"720 (U) [C][b2]"}, {0x9469d766,245760,"720 (U) [C][b3]"}, {0x3900677d,1048565,"Bardigun (J) [C][b1]"}, {0x418a57f7,524288,"Bardigun (J) [C][b2]"}, {0x71eaf856,1048576,"Bardigun (J) [C][b3]"}, {0x964cd4f4,1048576,"B-Daman Bakugaiden - Victory eno Michi (J) [C][b1]"}, {0x9e03ed9a,983040,"B-Daman Bakugaiden V - Final Mega Tune (J) [C][b1]"}, {0x23e4f4ff,188773,"Beat Mania GB (J) [C][b1]"}, {0x22cefe5a,215328,"Beat Mania GB (J) [C][b2]"}, {0xb7d3b4df,1048576,"Beat Mania GB (J) [C][b3]"}, {0x59beb372,1048576,"Beat Mania GB 2 (J) [C][b1]"}, {0x98887c26,819200,"Billy Bob's Huntin' 'n' Fishin' (U) [C][b1]"}, {0xa7415b80,262144,"Blades of Steel (U) [C][b1]"}, {0xbfdf7a8c,1048576,"Bomberman Quest (J) [C][b1]"}, {0xf4de6802,1048576,"Bomberman Quest (J) [C][b2]"}, {0x6319acf7,1048576,"Bomberman Quest (J) [C][b3]"}, {0x7a721a22,131072,"Buffy - The Vampire Slayer (U) [C][b1]"}, {0xe401ca3f,1048576,"Bugs Bunny - Crazy Castle 3 (J) [C][b1]"}, {0x6480c37a,1048577,"Bugs Bunny - Crazy Castle 3 (J) [C][b2]"}, {0x80e6706e,524288,"Bugs Bunny - Crazy Castle 3 (J) [C][b3]"}, {0xbc310b5f,1048576,"Bugs Bunny - Crazy Castle 3 (J) [C][b4]"}, {0x003388a5,524288,"Bugs Bunny - Operation Carrots (E) (M6) [C][b1]"}, {0xe245fa39,1048576,"Bugs Bunny - Operation Carrots (E) (M6) [C][b2]"}, {0x94d22458,1048576,"Bug's Life, A (E) [C][b1]"}, {0x0c1f8c96,1048576,"Bug's Life, A (U) [C][b1]"}, {0xad1388e1,1048576,"Burger Paradise (J) [C][b1]"}, {0xac5ab5f7,1048576,"Caesar's Palace II (U) [C][b1]"}, {0x7a6716dd,131072,"Centipede (U) [C][b1]"}, {0xddf9137b,524288,"Clay Pidgeon Shooting by Jim Bagley (PD) [C][b1]"}, {0xe097ce67,262144,"Donkey Kong 5 [C][b1]"}, {0x4c539cad,1048576,"Doraemon Kart 2 (J) [C][b1]"}, {0x0b996495,1048576,"Doraemon Kart 2 (J) [C][b2]"}, {0x15d99fd6,197283,"Dragon Quest Monsters (V1.16) (J) [C][b1]"}, {0xfc2c375d,1048576,"Duke Nukem (E) (M5) [C][b1]"}, {0xae6c2e6a,2097152,"F-1 World Grand Prix (E) (M4) [C][b1]"}, {0x7c6d77b6,1048888,"F-18 Thunder Strike (E) [C][b1]"}, {0x250e3495,1048576,"Fairy Kitty (J) [C][b1]"}, {0x94622f98,1048609,"Fairy Kitty (J) [C][b2]"}, {0xed20bfb6,1048576,"Fairy Kitty (J) [C][b3]"}, {0xb902b1cc,131072,"Frogger (U) [C][b1]"}, {0x222cb93e,524288,"Frogger (U) [C][b2]"}, {0xd3622d56,524288,"Gameboy Color Promotional Demo (J) [C][b1]"}, {0x42bdf31b,524288,"Gameboy Wars 2 (J) [C][b1]"}, {0x6d6ff69d,1048576,"Ganbare Goemon Teng (J) [C][b1]"}, {0x0f4421c2,1048576,"Gex - Enter the Gecko (U) [C][b1]"}, {0x4fd5228d,524288,"Ghosts 'N Goblins (U) [C][b1]"}, {0xaecb53e8,1048576,"Glocal Hexcite (J) [C][b1]"}, {0x36cb189d,262144,"Glocal Hexcite (J) [C][b2]"}, {0x30064931,524288,"Glocal Hexcite (J) [C][b3]"}, {0x432dc371,1048576,"Grinch, The (J) [C][b1]"}, {0xc0162de3,1048576,"Harvest Moon GB (E) [C][b1]"}, {0xc9d2ae9c,524800,"Harvest Moon GB (G) [C][b1]"}, {0xf6768930,1048576,"Hello Kitty Magical Museum (J) [C][b1]"}, {0x4ea5127d,262144,"Hexcite (U) [C][b1]"}, {0xb5839a21,131072,"Highway Racing, The (J) [C][b1]"}, {0x4bc200c0,1048576,"Hollywood Pinball (UE) (M4) [C][b1][t1]"}, {0x7ca952b6,1048576,"Hugo 2.5 (G) [C][b1]"}, {0xd11253c4,557056,"J. League Excite Stage GB (J) [C][b1]"}, {0x20bf6b3d,491520,"Joryu Janshi Ni Chousen (J) [C][b1]"}, {0xa1f14acf,1048576,"Joust & Defender (U) [C][b1]"}, {0x0b4a2e77,1048576,"Kadume Monsters (J) [C][b1]"}, {0x0c1dfd38,1376256,"Kanji Boy (J) [C][b1]"}, {0xaa8f041d,1048576,"Karamucho Sawag (J) [C][b1]"}, {0x312ca2a3,1048576,"Kaseki Reborn II Monster Digger (J) [C][b1]"}, {0x06c85ad1,1048576,"Ken Griffey Jrs' Slugfest (U) [C][b1]"}, {0x82a2dad8,1048576,"Legend of the River King GB (E) (Pack in Video) [C][b1]"}, {0x8aad7092,1048576,"Legend of the River King GB (E) (Pack in Video) [C][b2]"}, {0x1848bf49,1051452,"Legend of Zelda, The - Link's Awakening DX (V1.0) (J) [C][b1]"}, {0x68accfe1,524288,"Lodoss War GB (J) [C][b1]"}, {0x1448abaf,524288,"Luca's Puzzle Adventure (J) [C][b1]"}, {0x4dfab0e5,1048576,"Mahjong Quest (J) [C][b1]"}, {0x363f2de5,524288,"Medarot 2 - Kabuto (J) [C][b1]"}, {0x0984c1b7,524288,"Medarot 2 - Kuwagata (J) [C][b1]"}, {0x063ed122,524290,"Medarot 2 - Kuwagata (J) [C][b2]"}, {0x79b981c0,1048576,"Men In Black - The Series (U) [C][b1]"}, {0x6e9f1a49,1048576,"Men In Black - The Series (U) [C][b2]"}, {0x6570e700,4194304,"Metal Gear Solid (E) (M5) [C][b1]"}, {0xdcd5d5f4,524288,"Monopoly (J) [C][b2]"}, {0x2940d0f3,1058522,"Monster Race 2 (J) [C][b1]"}, {0x61dedc1b,327680,"Montezuma's Return (U) (M2) [C][b1]"}, {0xd200e702,524288,"Montezuma's Return (U) (M2) [C][b2]"}, {0x95a53a0d,950272,"Moon Patrol & Spy Hunter (U) [C][b1]"}, {0x0bdb132e,983040,"Moon Patrol & Spy Hunter (U) [C][b2]"}, {0x84f70ed4,589824,"Mortal Kombat 4 (E) (no blood) [C][b1]"}, {0xcf5e8397,1048576,"Mortal Kombat 4 (U) [C][b1]"}, {0x8479807a,1048576,"Mr. Driller (J) [C][b1][t1]"}, {0xa39bebe4,1048576,"NBA Jam '99 (UE) [C][b1]"}, {0x67d5dd41,294912,"NBA Showtime - NBA on NBC (U) [C][b1]"}, {0xab31bbf3,393216,"NBA Showtime - NBA on NBC (U) [C][b2]"}, {0xed14dd33,988936,"New Adventures of Mary-Kate and Ashley, The (U) [C][b1]"}, {0x93d05b98,398336,"Nobunaga's Ambition 2 (J) [C][b1]"}, {0xf657dab7,1048576,"Ojarumaru (J) [C][b1]"}, {0x1d2b74b2,1048576,"Oodorobou Jing Devil (J) [C][b1]"}, {0x37196d30,1048576,"Oodorobou Jing Devil (J) [C][b2]"}, {0xe7eb258e,1048576,"Othello 2000 (J) [C][b1]"}, {0x0fedda07,1048576,"Pitfall - Beyond the Jungle (U) [C][b1]"}, {0x84ad2dbe,1048576,"Pocket Bomberman (U) [C][b1]"}, {0xc0a1b10d,524288,"Pocket Bomberman (U) [C][b2]"}, {0xbdc55ac0,524288,"Pocket Bomberman (U) [C][b3]"}, {0xb7b8fc64,1048576,"Pocket Bomberman (U) [C][b4]"}, {0xb534fa23,262144,"Pocket Hanafuda (J) [C][b1]"}, {0xf5780f4b,2097152,"Pocket Monsters Crystal Glass (J) [C][b1]"}, {0xd639ebfa,1048571,"Pocket Monsters Gold (V1.0) (J) [C][b1]"}, {0x2304b7f7,89960,"Pocket Monsters Gold (V1.0) (J) [C][b2]"}, {0x2da2f083,1048576,"Pocket Monsters Gold (V1.0) (J) [C][b3]"}, {0xa6e448be,1048576,"Pocket Monsters Gold (V1.0) (J) [C][b4]"}, {0xc08001af,1048576,"Pocket Monsters Pinball (J) [C][b1]"}, {0x51f2584c,1048576,"Pocket Monsters Pinball (J) [C][b2]"}, {0x1d0f3a78,1048576,"Pocket Monsters Silver (V1.0) (J) [C][b1]"}, {0xb35a96dc,1048576,"Pocket Monsters Trading Card Game (J) [C][b1]"}, {0xdd19460e,1048576,"Pocket Monsters Trading Card Game (J) [C][b2]"}, {0x74a63c3d,1048576,"Pocket Monsters Trading Card Game (J) [C][b3]"}, {0x86adfde1,1048576,"Pocket Monsters Trading Card Game (J) [C][b4]"}, {0x5c263190,1048576,"Pocket Puyo Sun (J) [C][b1]"}, {0xede23e49,1048576,"Pocket Puyo Sun (J) [C][b2]"}, {0x6b7e36d2,1048585,"Pokemon Pinball (U) [C][b1]"}, {0xb6a4ea28,1048605,"Pokemon Trading Card Game (U) [C][b1]"}, {0x5846a2a2,1048576,"Power Quest (E) (M6) [C][b1]"}, {0xbcdc6d37,2097152,"Poyon's Dungeon Room (J) [C][b1]"}, {0x9f340610,1048576,"Quest for Camelot (U) (M3) [C][b1]"}, {0x2fdd46b3,524288,"Rats! (UE) (M2) [C][b1]"}, {0x5ac2a67e,1048576,"Robopon Star (J) [C][b1]"}, {0xa3d7c8c1,1048576,"Rockman X (J) [C][b1]"}, {0xf024f152,1048576,"R-Type DX (U) [C][b1]"}, {0xe437c06e,1048576,"Rugrats - Time Travelers (U) [C][b1]"}, {0x8d79efec,1048576,"Rugrats Movie, The (U) [C][b1]"}, {0x07aa8468,1048576,"Sanrio Timenet Future (J) [C][b1]"}, {0xd915b4c2,1048576,"Sanrio Timenet Past (J) [C][b1]"}, {0x4cd55ff7,458752,"Sanrio Timenet Past (J) [C][b2]"}, {0xc8e1c506,1048576,"Senkai Imonroku Junteitaisen (J) [C][b1]"}, {0xc6ce2427,32768,"SGB Pack (PD) [C][b1]"}, {0xcac1f6c0,847556,"Shadowgate Classic (V1.0) (E) (M5) [C][b1]"}, {0x9b5f3b08,1048576,"Shadowgate Classic (V1.0) (E) (M5) [C][b2]"}, {0x3f5a6bf8,524288,"Shanghai Pocket (J) [C][b1]"}, {0xcb6fb00b,1048576,"Shanghai Pocket (J) [C][b2]"}, {0x4171177a,524288,"Sonic 7 (Unl) [C][b1]"}, {0x5228a682,1048576,"Spy vs Spy (U) [C][b1]"}, {0xba2234b5,1048576,"Spy vs Spy (U) [C][b1][t1]"}, {0x5e01a520,1048576,"Street Fighter Alpha (E) [C][b1]"}, {0x8e04bd16,131072,"Super Breakout! (U) [C][b1]"}, {0xcded962b,524288,"Super Breakout! (U) [C][b2]"}, {0xd60d7cb9,2097152,"Super Fighters '99 (Unl) (J) [C][b1]"}, {0x2dcc03aa,1048576,"Super Mario Bros. DX (V1.0) (U) [C][b1]"}, {0x730ea73d,868352,"Super Robot Wars Link Battler (J) [C][b1]"}, {0x71987ef1,1048576,"Sweet Ange (J) [C][b1]"}, {0x9b7a916e,524288,"Sylvester and Tweety (E) (M3) [C][b1]"}, {0x22b37f16,950058,"Sylvester and Tweety (E) (M3) [C][b2]"}, {0x192fe094,1048576,"Sylvester and Tweety (E) (M3) [C][b3]"}, {0x4e8e08c7,524288,"Sylvester and Tweety (E) (M6) [C][b1]"}, {0x33d466ab,1048576,"Sylvester and Tweety (E) (M6) [C][b2]"}, {0x3f244d34,2097152,"Tarzan (U) [C][b1]"}, {0xef94e6fa,524288,"Tetris DX (JU) [C][b1]"}, {0x56a6586b,32805,"Titney High Colour Demo (PD) [C][b1]"}, {0x0649df69,2031616,"Tokimeki Sport (J) [C][b1]"}, {0xed82760d,1048576,"Tom & Jerry - Mouse Hunt (E) (M5) [C][b1][t1]"}, {0xfbf9f10d,1048576,"Tonka Raceway (U) [C][b1]"}, {0xddaf1c02,1048576,"Top Gear Pocket (U) [C][b1]"}, {0x254d2148,1048576,"Track & Field GB (J) [C][b1]"}, {0x3a7cb5ef,524288,"Turok 2 - Seeds of Evil (U) (M4) [C][b1]"}, {0x2ab63d00,1048576,"Turok 2 - Seeds of Evil (U) (M4) [C][b2]"}, {0x75faa0b5,262144,"V-Rally - Championship Edition (E) (M3) [C][b1]"}, {0x3fb66738,2097152,"Warioland 2 (J) [C][b1]"}, {0x4166c1df,2097152,"Warioland 2 (U) [C][b1]"}, {0x21039393,2097152,"Warioland 2 (U) [C][b2]"}, {0x14b60ce1,1048576,"World Soccer GB 2 (J) [C][b1]"}, {0x60e8f86c,1048576,"WWF Attitude (U) [C][b1]"}, {0x09de995b,528384,"Yoda Stories (U) [C][b1]"}, {0xa0503993,1047550,"R-Type DX (U) [C][b2]"}, {0x6c3ff6e7,1050732,"Spirou La Panque Mecanique (E) (M7) [C][b1]"}, {0xe038e666,2097152,"007 - The World is Not Enough (U) [C][!]"}, {0xe84191a8,1048576,"102 Dalmatians - Puppies to the Rescue (F) [C][!]"}, {0x725a3483,1048576,"102 Dalmatians - Puppies to the Rescue (G) [C][!]"}, {0x56b83539,1048576,"102 Dalmatians - Puppies to the Rescue (U) [C][!]"}, {0x720c7023,1048576,"10-Pin Bowling (U) [C][!]"}, {0x87431672,1048576,"1942 (U) [C][!]"}, {0x8cdab77f,1048576,"3D Pocket Pool (E) (M6) [C][!]"}, {0xf62ad75e,1048576,"4x4 World Trophy (E) (M5) [C][!]"}, {0x4d87d92f,65536,"58-in-1 (Menu) (Unl) [C]"}, {0xe633841f,1048576,"720 (U) [C][!]"}, {0xf13b91ab,65536,"72-in-1 (Menu) (Unl) [C]"}, {0x1226499e,1048576,"Action Man (U) [C][!]"}, {0x8ee043ea,1048576,"Adventures of Arle, The (J) [C][!]"}, {0xac52f6ef,2097152,"Adventures of Kite, The (J) [C][!]"}, {0xd0d3dfed,1048576,"Adventures of the Smurfs, The (M6) (E) [C][!]"}, {0x5dfff5e2,1048576,"Air Force Delta (J) [C][!]"}, {0xff31cc92,1048576,"Air Force Delta (U) [C][!]"}, {0x446573cd,1048576,"Aladdin (E) (M6) [C][!]"}, {0x6f9ef15e,1048576,"Alfred's Adventure (E) (M5) [C][!]"}, {0x85545d81,2097152,"Alice in Wonderland (E) (M4) [C][!]"}, {0x3199f65f,2097152,"Alice in Wonderland (U) [C][!]"}, {0xbec3c24b,1048576,"Aliens - Thanatos Encounter (U) [C][!]"}, {0xe17f59a5,1048576,"All-Star Baseball 2000 (U) [C][!]"}, {0xbc562466,1048576,"All-Star Baseball 2001 (U) [C][!]"}, {0x952b94e5,1048576,"All-Star Tennis 2000 (U) [C][!]"}, {0xc145c036,4194304,"Alone in the Dark - The New Nightmare (E) (M3) [C][!]"}, {0x7ff2042f,4194304,"Alone in the Dark - The New Nightmare (E) (M6) [C][!]"}, {0xc62a4c30,4194304,"Animal Breeder 3 (J) [C][!]"}, {0x83d838c3,4194304,"Animal Breeder 4 (J) [C][!]"}, {0x7fd46da1,1048576,"Animorphs (E) (M6) [C][!]"}, {0xb4f293cc,1048576,"Animorphs (U) [C][!]"}, {0x4839e0c1,1048576,"Antz (E) (M6) [C][!]"}, {0xf625a959,1048576,"Antz Racing (E) (M6) [C][!]"}, {0xd14b7b15,1048576,"Antz Racing (E) [C][!]"}, {0xdfdf90c0,1048576,"Antz Racing (U) [C][!]"}, {0xe243feb4,1048576,"Aqualife (J) [C][!]"}, {0xd952cbab,1048576,"Armada FX Racers (U) [C][!]"}, {0xea3b9c73,1048576,"Armorines - Project S.W.A.R.M. (E) (M2) [C][!]"}, {0x34411753,1048576,"Army Men (U) (M3) [C][!]"}, {0x2272baca,1048576,"Army Men 2 (U) [C][!]"}, {0xb0d1de8c,1048576,"Army Men Air Combat (U) [C][!]"}, {0x71b857ea,1048576,"Army Men Sarge's Heroes 2 (U) [C][!]"}, {0xf03599a3,1048576,"Arthur's Absolutely Fun Day! (U) [C][!]"}, {0x408dc5c6,1048576,"Asterix - Search for Dogmatix (E) (M6) [C][!]"}, {0x89d5d936,1048576,"Asteroids (U) [C][!]"}, {0x7967320e,2097152,"Atelier Elie (J) [C][!]"}, {0x6144fc66,2097152,"Atelier Marie (J) [C][!]"}, {0xd594d24b,2097152,"Atlantis - The Lost Empire (U) [C][!]"}, {0xbf99f8cb,4194304,"Austin Powers - Oh, Behave! (E) (M5) [C][!]"}, {0xbb89190e,4194304,"Austin Powers - Oh, Behave! (U) [C][!]"}, {0x693f50da,4194304,"Austin Powers - Welcome to My Underground Lair (E) (M5)[C][!]"}, {0xaba42b78,4194304,"Austin Powers - Welcome to My Underground Lair (U) [C][!]"}, {0xf9ccab09,2097152,"Azure Dreams (E) (M3) [C][!]"}, {0xc6f1abd4,1048576,"Azure Dreams (J) [C][!]"}, {0x71d52876,1048576,"Azure Dreams (U) [C][!]"}, {0xe25407f1,1048576,"Babe and Friends (U) [C][!]"}, {0xd33d6f7b,1048576,"Backgammon (E) (M4) [C][!]"}, {0x712a49b3,1048576,"Backgammon (J) [C][!]"}, {0xd514c9a0,1048576,"Bakuhashi Senki Metal Walker - Kkoute no Yuujyou (J) [C][!]"}, {0xa9050f72,524288,"Ballistic (U) [C][!]"}, {0xd2af64ce,262144,"Balloon Fight GB (J) [C][!]"}, {0x4068e981,1048576,"Barbie - Chasse Au Tresor Sous-Marine (F) [C][!]"}, {0x09ee93a8,1048576,"Barbie - Fashion Pack Games (U) [C][!]"}, {0x57f1a202,1048576,"Barbie - Magic Genie (U) [C][!]"}, {0x5e46d64a,1048576,"Barbie - Meeresabenteuer (G) [C][!]"}, {0xfdc8e7f1,1048576,"Barbie - Ocean Discovery (E) [C][!]"}, {0x746936c6,1048576,"Barbie - Ocean Discovery (U) [C][!]"}, {0x1fc972cc,1048576,"Barbie - Pet Rescue (U) [C][!]"}, {0xcd15ed36,1048576,"Barca Total 2000 (E) (M7) [C][!]"}, {0xddfcf4b7,1048576,"Bardigun (J) [C][!]"}, {0xb70028e4,1048576,"Bass Masters Classic (U) [C][!]"}, {0xe025067b,1048576,"Batman - Chaos in Gotham (E) (M6) [C][!]"}, {0xb241a4f3,1048576,"Batman - Chaos in Gotham (U) [C][!]"}, {0xf9d5b399,1048576,"Batman Beyond - Return of the Joker (E) (M3) [C][!]"}, {0xb32f4586,1048576,"Batman Beyond - Return of the Joker (U) [C][!]"}, {0xc99cf3c5,2097152,"Battle Fishers (J) [C][!]"}, {0x4431f8e7,1048576,"Battle Tanx (U) [C][!]"}, {0x8e6f8037,1048576,"Battleship (U) [C][!]"}, {0xddce76d6,1048576,"B-Daman Bakugaiden - Victory eno Michi (J) [C][!]"}, {0x547a9a69,2097152,"B-Daman Bakugaiden V - Final Mega Tune (J) [C][!]"}, {0x82d1a721,1048576,"Beach 'n Ball (E) (M5) [C][!]"}, {0x72895639,1048576,"Beast Wars (J) [C][!]"}, {0x6e988c07,1048576,"Beat Breaker (J) [C][!]"}, {0x0d9cb195,1048576,"Beat Mania GB (J) [C][!]"}, {0x645c4faf,1048576,"Beat Mania GB 2 (J) [C][!]"}, {0xb92a6d16,2097152,"Beat Mania GB Gotcha Mix 2 (J) [C][!]"}, {0xe4c410f0,1048576,"Beauty and the Beast (E) (M5) [C][!]"}, {0x6de1d581,1048576,"Beauty and the Beast (U) [C][!]"}, {0x51972995,2097152,"Benjamin Bluemchen - Ein verrueckter Tag im Zoo (G) [C][!]"}, {0x9c56977e,2097152,"Bey Blade (J) [C][!]"}, {0x1ec9db95,2097152,"Bey Blade 2 - Tournament Fighting (J) [C][!]"}, {0x08da3a14,32768,"BHGOS - Multicart Menu (PD)[C]"}, {0x4d39fbfe,1048576,"Bibi Blocksberg - Im Bann der Hexenkugel (G) [C][!]"}, {0x5be2517c,2097152,"Bikkuriman 2000 Charging Card GB (J) [C][!]"}, {0xfa1e6853,1048576,"Billy Bob's Huntin' 'n' Fishin' (U) [C][!]"}, {0xa663cf31,2097152,"Bionic Commando - Elite Forces (U) [C][!]"}, {0x4fbec464,1048576,"Bistro Recipe - Best Garum Version (J) [C][!]"}, {0x459a126b,1048576,"Bistro Recipe - Food Battle Version (J) [C][!]"}, {0xe44977dc,1048576,"Black Bass - Lure Fishing (U) [C][!]"}, {0xe823d051,1048576,"Black Bass - Lure Fishing (U) [C][f1]"}, {0x582fe338,1048576,"Black Onyx, The (J) [C][!]"}, {0x2dd5907f,1048576,"Blade (U) [C][!]"}, {0xa890adb2,1048576,"Blades of Steel (U) [C][!]"}, {0x2f91e17c,1048576,"Blaster Master Enemy Below (U) [C][!]"}, {0x748d1345,1048576,"Blue's Clues - Blue's Alphabet Book (U) [C][!]"}, {0xa7152869,2097152,"Boarder Zone (U) [C][!]"}, {0xea33fe3d,1048576,"Bob the Builder - Fix It Fun! (E) (M5) [C][!]"}, {0x93fa37bd,1048576,"Bob the Builder - Fix It Fun! (U) [C][!]"}, {0xc87120b5,2097152,"Boku no Camp (J) [C][!]"}, {0x9fc7a3b5,2097152,"Bokujo Monogatari GB 2 (J) (Chinese) [C][!]"}, {0xee993302,2097152,"Bokujo Monogatari GB 2 (J) [C][!]"}, {0x3a18b41f,2097152,"Bokujo Monogatari GB 3 - Boy Meets Girl (J) [C][!]"}, {0x545e0da2,2097152,"Bomberman Max - Ain Special Edition (J) [C][!]"}, {0x5ccb66cf,2097152,"Bomberman Max - Blue Champion (U) [C][!]"}, {0x7a44ce88,2097152,"Bomberman Max - Hero of Light (J) [C][!]"}, {0x4853f586,2097152,"Bomberman Max - Red Challenger (U) [C][!]"}, {0x48b60e8e,2097152,"Bomberman Max - Shadow of Darkness (J) [C][!]"}, {0x5a9b9ae6,2097152,"Bomberman Quest (E) (M3) [C][!]"}, {0x55210934,1048576,"Bomberman Quest (J) [C][!]"}, {0xa089c656,1048576,"Bomberman Quest (U) [C][!]"}, {0x06c28962,1048576,"Bomberman Quest (U) [C][BF]"}, {0x5d5d294a,2097152,"Brave Saga Shinshou Astaria (J) [C][!]"}, {0xa0f66d87,1048576,"Bubble Bobble (E) [C][!]"}, {0x388c6760,1048576,"Bubble Bobble (J) [C][!]"}, {0xc1b22246,1048576,"Bubble Bobble (U) (Metro 3D) [C][!]"}, {0x5692e262,1048576,"Buffy - The Vampire Slayer (U) [C][!]"}, {0xae839cae,1048576,"Bugs Bunny - Crazy Castle 3 (J) [C][!]"}, {0x7a2801fb,1048576,"Bugs Bunny - Crazy Castle 3 (U) [C][!]"}, {0x53155e60,1048576,"Bugs Bunny - Crazy Castle 4 (E) [C][!]"}, {0xd6387eaa,1048576,"Bugs Bunny - Crazy Castle 4 (J) [C][!]"}, {0x98dbffe0,1048576,"Bugs Bunny - Crazy Castle 4 (U) [C][!]"}, {0x11fb5617,1048576,"Bugs Bunny - Operation Carrots (E) (M3) [C][!]"}, {0xf0cc407f,1048576,"Bugs Bunny - Operation Carrots (E) (M6) [C][!]"}, {0xdb93e0f6,1048576,"Bug's Life, A (E) [C][!]"}, {0x8360047a,1048576,"Bug's Life, A (U) [C][!]"}, {0x95493475,2097152,"Bullet Battlers (J) [C][!]"}, {0x4039c187,2097152,"Bullet Battlers (J) [C][a1]"}, {0x5622b551,1048576,"Bundesliga Stars 2001 (G) [C][!]"}, {0xe52fbd12,1048576,"Burai Fighter (J) [C][!]"}, {0xb4a133ce,1048576,"Burai Fighter (J) [C][BF]"}, {0x9092b0eb,1048576,"Burger Paradise (J) [C][!]"}, {0x1abcedbe,1048576,"Burger Pocket (J) [C][!]"}, {0x8e818e6f,524288,"Bust-a-Move 4 (UE) [C][!]"}, {0xf8da0c4a,1048576,"Bust-a-Move Millennium (U) [C][!]"}, {0x841674b0,524288,"Buzz Lightyear of Star Command (F) [C][!]"}, {0xf06d296c,524288,"Buzz Lightyear of Star Command (G) [C][!]"}, {0x84e29b87,524288,"Buzz Lightyear of Star Command (U) [C][!]"}, {0x351ba5ea,1048576,"Caesar's Palace II (U) [C][!]"}, {0xb060b053,1048576,"Caesar's Palace II (U) [C][f1]"}, {0x824c3bf3,4194304,"Cannon Fodder (E) (M5) [C][!]"}, {0xb18cba2a,2097152,"Card Hero (J) [C][!]"}, {0xf78f7998,2097152,"Cardcaptor Sakura - Tomoe Shougakkou Undoukai (J) [C][!]"}, {0x89ba58ed,524288,"Cardcaptor Sakura (V1.0) (J) [C][!]"}, {0x43f28e22,524288,"Cardcaptor Sakura (V1.1) (J) [C][!]"}, {0xda8d6283,1048576,"Carl Lewis Athletics 2000 (U) [C][!]"}, {0xb447bc06,2097152,"Carmageddon (G) [C][!]"}, {0xbb482ed7,2097152,"Carmageddon (U) (M4) [C][!]"}, {0xe6b9f155,1048576,"Casper (E) (M3) [C][!]"}, {0xc775d653,1048576,"Casper (U) [C][!]"}, {0xd20dc670,1048576,"Caterpillar Construction Zone (U) [C][!]"}, {0x41e78645,1048576,"Catwoman (E) [C][!]"}, {0x099d6555,1048576,"Catz (E) [C][!]"}, {0x769a2c5a,1048576,"Catz (U) [C][!]"}, {0x255db8be,524288,"Centipede (E) (M6) [C][!]"}, {0x13ad07b1,1048576,"Centipede (U) [C][!]"}, {0xcbb336ed,1048576,"Championship Motocross 2001 with Ricky Carmichael (U) [C][!]"}, {0x6a0c272d,1048576,"Chase HQ - Secret Police (J) [C][!]"}, {0x7c7fdefc,1048576,"Chase HQ - Secret Police (U) (Metro 3D re-release) [C][!]"}, {0xcfdf816b,1048576,"Chase HQ - Secret Police (U) [C][!]"}, {0x1aab415d,1048576,"Checkmate (J) [C][!]"}, {0x9e988ffe,4194304,"Chee Chai Alien (J) [C][!]"}, {0x1c13dbb0,1048576,"Chessmaster, The (U) [C][!]"}, {0xf8bd2a01,1048576,"Chicken Run (U) (M5) [C][!]"}, {0x65610ca4,2097152,"Choro Q Hyper Custom Bull GB (J) [C][!]"}, {0xef2cfd99,1048576,"ClassKing Yamazaki (J) [C][!]"}, {0x5d8eed0d,2097152,"Cokemon Gold! v0.3 (Pokemon Gold Hack) [C]"}, {0xe93af9c8,2097152,"Colin McRae Rally (E) [C][!]"}, {0xfbe5de37,524288,"Columns - Tezuka Osamu Characters (J) [C][!]"}, {0x9e0799f4,1048576,"Come Rascal! (J) [C][!]"}, {0xd10b5645,2097152,"Command Master (J) [C][!]"}, {0x4af4cc9c,1048576,"Commander Keen (U) [C][!]"}, {0xa50be9a8,2097152,"Conker's Pocket Tales (U) (M3) [C][!]"}, {0x994314b3,1048576,"Conveni 21 (J) [C][!]"}, {0x04fe7790,1048576,"Cool Bricks (E) (M5) [C][!]"}, {0xe6c91fb8,524288,"Cool Hand (E) (M3) [C][!]"}, {0x834091ba,1048576,"CR Monster House (J) [C][!]"}, {0x53e02b87,1048576,"Crazy Bikers (E) [C][!]"}, {0x2f7aef51,1048576,"Dracula - Crazy Vampire (E) (M5) [C][!]"}, {0x4664a167,1048576,"Croc (UE) [C][!]"}, {0xc1d60129,1048576,"Croc 2 (U) [C]"}, {0xb7b91fe9,1048576,"Cross Country Racing (E) (M3) [C][!]"}, {0x9562e7e8,2097152,"Cruis'n Exotica (U) [C][!]"}, {0x909bb02d,2097152,"Crystalis (U) [C][!]"}, {0x9f883b0f,1048576,"Cubix Robots For Everyone - Race'n Robots (U) (M5) [C][!]"}, {0x44767443,1048576,"Cute Pet Shop (J) [C][!]"}, {0xe470cafa,1048576,"CyberTiger (U) [C][!]"}, {0xe86bf12e,1048576,"Cyborg Kuro Chan 2 (J) [C][!]"}, {0xf41bb392,1048576,"Da! Da! Da! - Totsuzen Card Battle De Uranai (J) [C][!]"}, {0x45ebf09c,1048576,"Daffy Duck - Fowl Play (U) [C][!]"}, {0xd9062e49,1048576,"Daikatana (E) (M3) (Eng-Fre-Ita) [C][!]"}, {0xf7e83313,1048576,"Daikatana (E) (M3) (Fre-Ger-Span) [C][!]"}, {0xe2071293,1048576,"Daikuno Gensan (J) [C][!]"}, {0xc64ff2b6,2097152,"Dance Dance Revolution (J) [C][!]"}, {0x565fec36,2097152,"Dance Dance Revolution 2 (J) [C][!]"}, {0x58f26f36,2097152,"Dance Dance Revolution 3 (J) [C][!]"}, {0x3263f692,1048576,"Dancing Furby (J) [C][!]"}, {0x25b480c3,1048576,"Das Geheimnis der Happy Hippo-Insel (G) [C][!]"}, {0xc958ad75,1048576,"Data Navi Professional Baseball (J) [C][!]"}, {0x2df6e230,1048576,"Dave Mirra Freestyle BMX (U) [C][!]"}, {0x402de378,1048576,"Deadly Skies (E) (M3) [C][!]"}, {0x0fd34427,1048576,"Dear Danielns Sweet Adventure (J) [C][!]"}, {0x40a715fb,1048576,"Deer Hunter (U) [C][!]"}, {0x71f798b5,1048576,"Deja Vu I & II (E) (M2) (Eng-Fre) [C][!]"}, {0xc6e7f3c6,1048576,"Deja Vu I & II (E) (M2) (Ger-Fre) [C][!]"}, {0xbaf2cc96,1048576,"Deja Vu I & II (J) [C][!]"}, {0xad0937f4,1048576,"Deja Vu I & II (U) [C][!]"}, {0xc5501fce,2097152,"Dejiko no Mahjong Party (J) [C][!]"}, {0x92c8b9b5,1048576,"Dekotora GB Special (J) [C][!]"}, {0x14375072,4194304,"Densha De Go! (J) [C][!]"}, {0xb72603fc,8388608,"Densha De Go! 2 (J) [C][!]"}, {0x3b5f24fc,1048576,"Detective Conan - Karakuri Temple (J) [C][!]"}, {0xe620fae2,1048576,"Detective Conan 2 - Kigantou Hihou Densetsu (J) [C][!]"}, {0x39a10855,2097152,"Devil Children - Shiro no Syo (J) [C][!]"}, {0xd24d6601,1048576,"Dexter's Laboratory - Robot Rampage (U) [C][!]"}, {0xfd11138e,1048576,"Die Maus - Verrueckte Olympiade (G) [C][!]"}, {0xe7bd4a49,1048576,"Die Maus (E) (M4) [C][!]"}, {0x714ec204,1048576,"Die Original Moorhuhn Jagd (G) [C][!]"}, {0x55b9af51,2097152,"Digital Devil Story - Black Children (J) [C][!]"}, {0xf90c4977,2097152,"Digital Devil Story - Red Children (J) [C][!]"}, {0xd9f071bb,2097152,"Dino Breeder 3 (J) [C][!]"}, {0xb0106777,2097152,"Dino Breeder 4 (J) [C][!]"}, {0xe0f7719e,32768,"Dino's Quest (Unl) (Beta) [C]"}, {0xb0bb0f10,32768,"Dino's Quest (Unl) (Beta) [C][f1]"}, {0x0aa8d0cc,2097152,"Dinosaur (E) (M5) [C][!]"}, {0x0b087fe7,2097152,"Dinosaur (U) [C][!]"}, {0x276ecaae,2097152,"Dinosaur (U) [C][a1][!]"}, {0xf4609fe3,1048576,"Dinosaur'Us (U) (M6) [C][!]"}, {0xce8dd179,1048576,"Dogz (E) [C][!]"}, {0xa8397183,1048576,"Dogz (U) [C][!]"}, {0x4fe9e966,2097152,"Dokapon !! Millenium Quest (J) [C][!]"}, {0x83e47a1a,4194304,"Doki Doki Densetsu - Mahoujin Guru Guru (J) [C][!]"}, {0xce8ae58c,2097152,"Don Quijote Pachinko (J) [C][!]"}, {0x333c124c,4194304,"Donald Duck - Daisy O Tsukue (J) [C][!]"}, {0x07a13b5b,4194304,"Donald Duck (E) (M5) [C][!]"}, {0xcb065eba,4194304,"Donkey Kong 2001 (J) [C][!]"}, {0x945c3653,4194304,"Donkey Kong Country (Mag Demo) (UE) (M5) [C][!]"}, {0xb1743477,4194304,"Donkey Kong Country (UE) (M5) [C][!]"}, {0x28d7e8d3,1048576,"Donkey Kong GB - Dinky Kong and Dixie Kong (J) [C][!]"}, {0x000553a6,1048576,"Donkey Kong GB - Dinky Kong and Dixie Kong (J) [C][f1]"}, {0xcf1a2038,1048576,"Doraemon Kart 2 (J) [C][!]"}, {0xd187cec4,1048576,"Doraemon Memories - Nobita no Omoide Daibouken (J) [C][!]"}, {0x67413f65,1048576,"Doraemon no Study Boy - Kanji Game (J) [C][!]"}, {0xa8a353d8,1048576,"Doraemon no Study Boy - KuKu Game (J) [C][!]"}, {0x3bbf9ea8,1048576,"Doraemon Quiz Boy (J) [C][!]"}, {0xf6d79a79,1048576,"Doraemon Walking Labyrinth (J) [C][!]"}, {0x04fab6c5,1048576,"Doraemon Walking Labyrinth (J) [C][p1][!]"}, {0xa9e62f1a,1048576,"Doug's Big Game (F) [C][!]"}, {0x08e3d065,1048576,"Doug's Big Game (U) [C][!]"}, {0x2fa46211,1048576,"Draemon Kimi to Pet no Monogatari (J) [C][!]"}, {0x0602dbe1,262144,"Dragon Dance (U) [C][!]"}, {0xa053b42e,2097152,"Dragon Quest 1 & 2 (J) [C][!]"}, {0xff18df33,2097152,"Dragon Quest 1 & 2 (J) [C][f1]"}, {0x21078c16,4194304,"Dragon Quest III (J) [C][!]"}, {0x2a82b63b,2097152,"Dragon Quest Monsters (G) [C][!]"}, {0xe941a4cd,2097152,"Dragon Quest Monsters (G) [C][BF]"}, {0x4702c4f1,2097152,"Dragon Quest Monsters (J) [C][!]"}, {0xd263d88d,2097152,"Dragon Quest Monsters (V1.16) (J) [C][!]"}, {0x68ba18d7,4194304,"Dragon Quest Monsters 2 - Iru's Adventure (J) [C][!]"}, {0x2c428a87,4194304,"Dragon Quest Monsters 2 - Ruka's Adventure (J) [C][!]"}, {0x137d7b45,1048576,"Dragon Tales - Dragon Wings (E) [C][!]"}, {0x191d31ec,1048576,"Dragon Tales - Dragon Wings (U) [C][!]"}, {0x71d693da,2097152,"Dragon Warrior I and II (U) [C][!]"}, {0x0fd9c59c,4194304,"Dragon Warrior III (U) [C][!]"}, {0xe56c35b1,2097152,"Dragon Warrior Monsters (U) [C][!]"}, {0x580254c6,2097152,"Dragon Warrior Monsters (U) [C][BF]"}, {0xb8b120e4,2097152,"Dragon Warrior Monsters (U) [C][f1]"}, {0xab7bfdd5,4194304,"Dragon Warrior Monsters 2 - Cobi's Journey (U) [C][!]"}, {0x35ec5fb2,4194304,"Dragon Warrior Monsters 2 - Tara's Adventure (U) [C][!]"}, {0xbf076ca5,4194304,"Dragon's Lair (U) (M6) [C][!]"}, {0xd4c7f6df,1048576,"Driver - You Are The Wheelman (U) (M5) [C][!]"}, {0x1e71b67e,262144,"Dropzone (U) [C][!]"}, {0x6471622c,1048576,"Drymouth (U) [C]"}, {0x5b4507d9,1048576,"Duffy Duck - Fowl Play (J) [C][!]"}, {0x846fc830,1048576,"Duke Nukem (E) (M5) [C][!]"}, {0xfb08dceb,2097152,"Dukes of Hazzard, The - Racing for Home (U) [C][!]"}, {0x2bcb5f78,4194304,"Dungeon Saviour (J) [C][!]"}, {0x3f1e076c,1048576,"DX Monopoly GB (J) [C][!]"}, {0x2e65daaf,1048576,"Earthworm Jim - Menace 2 the Galaxy (U) [C][!]"}, {0x484eba10,1048576,"ECW Hardcore Revolution (U) [C][!]"}, {0x2154763c,1048576,"Elevator Action EX (E) (M5) [C][!]"}, {0xb70c4ddb,1048576,"Elevator Action EX (J) [C][!]"}, {0x41228ee7,1048576,"Elmo in Grouchland (E) [C][!]"}, {0x2c4c2a5f,262144,"Elmo in Grouchland (U) [C][!]"}, {0x1833fb38,262144,"Elmo's 123s (U) [C][!]"}, {0xcc1fb2a9,262144,"Elmo's ABCs (U) [C][!]"}, {0x4caa8cd0,2097152,"Emperor's New Groove, The (E) (M5) [C][!]"}, {0x6ebad539,2097152,"Emperor's New Groove, The (U) [C][!]"}, {0x42670496,32768,"EMS Multi-ROM Menu V1.1 (PD) [a1][C]"}, {0x4005d541,1048576,"ESPN International Track & Field (U) [C][!]"}, {0x600f61f9,2097152,"ESPN National Hockey Night (U) [C][!]"}, {0x5a0b7c72,1048576,"European Super League (E) (M5) [C][!]"}, {0xdfd6a908,2097152,"Evel Knievel (E) (M7) [C][!]"}, {0x5c0e7b44,1048576,"Extreme Sports with The Berenstein Bears (U) [C][!]"}, {0x5e3844fb,1048576,"F.A. Premier League Stars 2001 (U) [C][!]"}, {0x5c10315e,2097152,"F1 Championship Season 2000 (E) (M5) [C][!]"}, {0xe115ddb1,4194304,"F-1 Racing Championship (E) (Beta) (M5) [C][!]"}, {0xfc537719,4194304,"F-1 Racing Championship (E) (M5) [C][!]"}, {0x8d9a9182,2097152,"F-1 World Grand Prix (E) (M4) [C][!]"}, {0xeef4a20b,1048576,"F-1 World Grand Prix 2 (E) (M4) [C][!]"}, {0x28453467,1048576,"F-1 World Grand Prix 2 (J) [C][!]"}, {0x410fa858,1048576,"F-18 Thunder Strike (E) [C][!]"}, {0xb59a51c4,1048576,"Fairy Kitty (J) [C][!]"}, {0x8b742fb5,1048576,"Ferret Story - Dear my Ferret (J) [C][!]"}, {0xe6bc2e8c,1048576,"FIFA 2000 (U) [C][!]"}, {0x5dfc61e8,1048576,"Fix & Foxi (E) (M3) [C][!]"}, {0xecccd908,1048576,"Flintstones, The - Burgertime in Bedrock (E) (M6) [C][!]"}, {0x14d8cc5d,1048576,"Flintstones, The - Burgertime in Bedrock (U) [C][!]"}, {0x08b9e4aa,1048576,"Flipper & Lopaka (E) (M10) [C][!]"}, {0x2dcd0a0a,1048576,"Force 21 (U) (M3) [C][!]"}, {0x703c057f,1048576,"Formula One 2000 (U) [C][!]"}, {0x06c8e50a,1048576,"Fort Boyard (E) (M7) [C][!]"}, {0x0b9678d2,65536,"FREME Tuner (U) [C]"}, {0x0158492e,65536,"FREME Tuner (U) [C][a1]"}, {0x98d0fcb0,1048576,"Friendly Pet Series 1 - Lovely Hamster (J) [C][!]"}, {0x866095c2,1048576,"Friendly Pet Series 2 - Lovely Rabbit (J) [C][!]"}, {0xfa4e9896,1048576,"Friendly Pet Series 3 - Lovely Puppy (J) [C][!]"}, {0xb6bf0672,524288,"Frogger (E) (M6) [C][!]"}, {0xaf46ea77,1048576,"Frogger (U) [C][!]"}, {0x6a2666aa,1048576,"Frogger 2 (U) [C][!]"}, {0xc693aa37,4194304,"From TV Animation - One Piece - Dream of Rufi's Pirates is Born (J) [C][!]"}, {0xf48e1643,1048576,"Front Line - The Next Mission (J) [C][!]"}, {0x6eea9243,1048576,"Front Row (J) [C][!]"}, {0x3b46e7c9,1048576,"Funk the 9 Ball (J) [C][!]"}, {0x2c97e90f,4194304,"Furai no Siren GB2 (J) [C][!]"}, {0xe3c4abc6,1048576,"Galaga - Destination Earth (U) [C][!]"}, {0x969c8961,1048576,"Game & Watch Gallery 2 (UE) [C][!]"}, {0x1ac625da,1048576,"Game & Watch Gallery 3 (U) [C][!]"}, {0x7e15b3dd,2097152,"Game of Life DX, The (J) [C][!]"}, {0xf5e9aa8c,524288,"Gameboy Color Promotional Demo (J) [C]"}, {0x149f807e,1048576,"Gameboy Gallery 3 (J) [C][!]"}, {0x6935fea1,1048576,"Gameboy Gallery 3 (U) [C][!]"}, {0xe3b0319e,1048576,"Gameboy Wars 2 (J) [C][!]"}, {0xc69dc37b,1048576,"Gameboy Wars 2 (J) [C][a1][!]"}, {0x308a4ccb,1048576,"Games Frenzy (E) (M3) [C][!]"}, {0x2ea8d9d4,1048576,"Ganbare Goemon - Hoshizorashi Dynamites Arawaru!! (J) [C][!]"}, {0xd829eb2f,1048576,"Ganbare Goemon Teng (J) [C][!]"}, {0x8f3902f2,524288,"GB Backup Station BIOS (U) [C][!]"}, {0x63a62540,32768,"GB Gamejack 16M (EMP Hack 1.6) (Unl) [C]"}, {0x27e1ea03,32768,"GB Gamejack 16M (Select Pallete) (Unl) [C]"}, {0xafa3e555,32768,"GB Gamejack 16M (Unl) [C]"}, {0xc44cb531,32768,"GB Gamejack 64M (Select Pallete) (Unl) [C]"}, {0xdfd9b8bf,32768,"GB Gamejack 64M (Unl) [C]"}, {0x0d616244,32768,"GB Gamejack Menu for GBC with Setup-Menu (Unl) [C]"}, {0x1c0368fa,2097152,"GB Harobots (J) [C][!]"}, {0xde7505c0,1048576,"Gem Gem Monster (J) [C][!]"}, {0x1d04b408,1048576,"Gem Gem Monster (J) [C][p1][!]"}, {0x918a40e7,1048576,"Gensoumaden Saiyuuki - Sabaku no Shikami (J) [C][!]"}, {0x9ebdb6c6,1048576,"Get Mushi Club - Minna no Konchu Daizukan (J) [C][!]"}, {0xdccc7514,1048576,"Gex - Enter the Gecko (U) [C][!]"}, {0x025f305d,2097152,"Gex 3 - Deep Pocket Gecko (E) [C][!]"}, {0x85a98c7d,2097152,"Gex 3 - Deep Pocket Gecko (U) [C][!]"}, {0xae024c23,1048576,"Ghosts 'N Goblins (U) [C][!]"}, {0xd8e357ba,1048576,"Gift (E) (Demo Version) [C][!]"}, {0x1b0034e8,1048576,"Gift (E) [C][!]"}, {0xb97a8cb8,1048576,"Gifty (E) (German release) [C][!]"}, {0xf1908391,1048576,"Glocal Hexcite (J) [C][!]"}, {0x73311cfa,2097152,"Go Go Goemon (J) [C][!]"}, {0x2e61c391,1048576,"Gobs of Games (U) (M3) [C][!]"}, {0xe7ebb394,1048576,"Godzilla - The Series - Monster Wars (U) [C][!]"}, {0xdd716efe,1048576,"Godzilla - The Series (E) (M3) [C][!]"}, {0xb16f1752,1048576,"Gold and Glory - The Road to El Dorado (E) (M6) [C][!]"}, {0xb7d49490,1048576,"Gold and Glory - The Road to El Dorado (U) [C][!]"}, {0x14d1adbe,1048576,"Golden Goal (E) (M7) [C][!]"}, {0x80444a86,2097152,"Golf Daisuki - Let's Play Golf (J) [C][!]"}, {0x38273bdd,524288,"Golf De Ohasuta (J) [C][!]"}, {0xe45e99d2,1048576,"Gonta's Okiraku Adventure (J) [C][!]"}, {0xd589c501,2097152,"Gran Duel (J) [C][!]"}, {0x7122136d,2097152,"Gran Duel Trial Version (J) [C][!]"}, {0x25ba9231,4194304,"Grand Theft Auto (E) (M5) [C][!]"}, {0x924de366,4194304,"Grand Theft Auto (U) [C][!]"}, {0xad563bd9,2097152,"Grand Theft Auto 2 (E) (M5) [C][!]"}, {0x68610203,2097152,"Grand Theft Auto 2 (U) [C][!]"}, {0x23223670,4194304,"Grandia - Parallel Trips (J) [C][!]"}, {0xb471c095,1048576,"Great Battle Pocket, The (J) [C][!]"}, {0xc38d52e7,1048576,"Gremlins (E) (Beta) (M6) [C][!]"}, {0x9ed6059a,1048576,"Grinch, The (E) (M3) [C][!]"}, {0xc5a47896,1048576,"Grinch, The (U) [C][!]"}, {0x03fbfc9e,1048576,"Guru Guru Town Hanamaru Kun (J) [C][!]"}, {0x7eaeeeac,1048576,"Guruguru Galakedaizu (J) [C][!]"}, {0x5f13a2d4,1048576,"Gute Zeiten Schlechte Zeiten Quiz (G) [C][!]"}, {0x70f3b431,1048576,"Halloween Racer (E) (M6) [C][!]"}, {0xd56d68ff,1048576,"Hamster Club - Awasete Chuu (J) [C][!]"}, {0x8a4d86a0,2097152,"Hamster Club (J) [C][!]"}, {0x2fb398f9,4194304,"Hamster Club 2 (J) [C][!]"}, {0xf520cb19,1048576,"Hamster Paradise (J) [C][!]"}, {0x14cac67c,4194304,"Hamster Paradise 3 (J) [C][!]"}, {0x542c78b6,2097152,"Hamu Suta Para 2 (J) [C][!]"}, {0xff454711,1048576,"Hamunaptra - The Lost City (J) [C][!]"}, {0xf519f4c3,1048576,"Hands of Time (E) [C][!]"}, {0x644bac84,1048576,"Harley Davidson - Race Across America (U) [C][!]"}, {0x4fd8b7c5,4194304,"Harry Potter and The Sorcerer's Stone (U) (M13) [C][!]"}, {0xc8a6f68a,1048576,"Harvest Moon GB (E) [C][!]"}, {0xd3896652,1048576,"Harvest Moon GB (G) [C][!]"}, {0xab5738a1,1048576,"Harvest Moon GB (U) [C][!]"}, {0x160ca990,2097152,"Harvest Moon GBC 2 (E) [C][!]"}, {0x32a04c29,2097152,"Harvest Moon GBC 2 (G) [C][!]"}, {0x08906220,2097152,"Harvest Moon GBC 2 (U) [C][!]"}, {0xa0d67417,2097152,"Harvest Moon GBC 3 (U) [C][!]"}, {0x12f74cd4,1048576,"Hello Kitty Beads Factory (J) [C][!]"}, {0x5174584f,1048576,"Hello Kitty Magical Museum (J) [C][!]"}, {0x937729f6,1048576,"Hello Kitty's Cube Frenzy (U) [C][!]"}, {0x45f4159b,1048576,"Hello Kitty's Sweet Adventure (J) [C][!]"}, {0xc0ede71f,1048576,"Hercules - The Legendary Journeys (U) (M6) [C][!]"}, {0xbb0672a6,1048576,"Heroes of Might and Magic (U) (M3) [C][!]"}, {0x53156d4d,1048576,"Heroes of Might and Magic II (U) (M3) [C][!]"}, {0x84084e5f,1048576,"Hexcite (U) [C][!]"}, {0x36e781cd,131072,"Highway Racing, The (J) [C][!]"}, {0xbdae91e8,1048576,"Hiryu no Ken Retsuden (J) [C][!]"}, {0x70f10315,1048576,"Hisshatsu Pachinko Boy (J) [C][!]"}, {0x27a53965,1048576,"Hole in One Golf (U) [C][!]"}, {0x77d7e5b7,1048576,"Hollywood Pinball (J) [C][!]"}, {0x8bd1f635,1048576,"Hollywood Pinball (UE) (M4) [C][!]"}, {0xabd8ceae,1048576,"Holy Magic Century (E) (M3) [C][!]"}, {0x05dcbd55,1048576,"Honkaku Hanafuda (J) [C][!]"}, {0x89140949,1048576,"Honkaku Taisen Shogi (Ayumu) (J) [C][!]"}, {0x72a5e820,1048576,"Hot Wheels Stunt Track Driver (U) [C][!]"}, {0xdd5d3713,1048576,"Hoyle Card Games (U) [C][!]"}, {0x413473b0,1048576,"Hoyle Casino (U) [C][!]"}, {0x685cafcc,1048576,"Hugo - Black Diamond Fever (E) (M11) [C][!]"}, {0xfab64b18,1048576,"Hugo 2.5 (G) [C][!]"}, {0xd23c6a75,1048576,"Hunter X Hunter - Kindan no Hihou (J) [C][!]"}, {0xa1361642,4194304,"Hunter X Hunter (J) [C][!]"}, {0x24846d65,1048576,"Hype - The Time Quest (E) (M8) [C][!]"}, {0xa9b8f072,1048576,"Hyper Winter Olympics 2000 (J) [C][!]"}, {0x61df88ca,2097152,"Ide Mahjong GB (J) [C][!]"}, {0x7fff1142,1048576,"Indiana Jones and the Infernal Machine (U) (M3) [C][!]"}, {0x1af0b489,1048576,"Inspector Gadget - Operation Madkactus (U) [C][!]"}, {0x3390b056,1048576,"Inspector Gadget (E) (M6) [C][!]"}, {0x12e00808,1048576,"International Karate (E) [C][!]"}, {0x57ea1ec8,2097152,"International Superstar Soccer 2000 (E) [C][!]"}, {0x1b76d115,1048576,"International Superstar Soccer 99 (U) [C][!]"}, {0x327ec81f,1048576,"International Track & Field (E) (M4) [C][!]"}, {0x803d5d57,1048576,"International Track & Field (U) [C][!]"}, {0xd826c75f,1048576,"International Track & Field - Summer Games (E) [C][!]"}, {0x39e34650,1048576,"Its a World Rally (J) [C][!]"}, {0xa3687e47,1048576,"Its a World Rally (J) [C][f1]"}, {0xb3f38f16,1048576,"J. League Excite Stage GB (J) [C][!]"}, {0xcff5325a,2097152,"Jack's Journey - an Elemental Tale (J) [C][!]"}, {0xaeb634c5,1048576,"Jagainu Kun (J) [C][!]"}, {0x32c8ee13,1048576,"Janosch - Das Grosse Panama Spiel (G) [C][!]"}, {0x73f4f6da,1048576,"Jay Und Die Spielzeugdiebe (G) [C][!]"}, {0xa41ed926,1048576,"Jeff Gordan XS Racing (U) [C][!]"}, {0xf0f9abe6,1048576,"Jeremy McGrath Supercross 2000 (U) [C][!]"}, {0x20c4ccf6,2097152,"Jet De Go! (J) [C][!]"}, {0x0fafa3f2,2097152,"Jim Henson's Muppets (E) (M7) [C][!]"}, {0x3c476c6f,2097152,"Jim Henson's Muppets (U) [C][!]"}, {0x27632f4f,1048576,"Jimmy White's Cueball (E) [C][!]"}, {0xc8d46e99,1048576,"Jinsei Tomedachi (J) [C][!]"}, {0x38d5aa6b,524288,"Joryu Janshi Ni Chousen (J) [C]"}, {0x9fa5cdb5,1048576,"Joryu Janshi Ni Chousen (J) [C][!]"}, {0x4c1ececb,1048576,"Joust & Defender (U) [C][!]"}, {0xb609ecea,4194304,"Jungle Book, The - Mowgli's Wild Adventure (E) (M5) [C][!]"}, {0x9b6b755f,4194304,"Jungle Book, The - Mowgli's Wild Adventure (U) (M5) [C][!]"}, {0x44827e74,2097152,"Jurassic Boy 2 (E) [C][!]"}, {0xca9dd8e9,2097199,"Jurassic Boy 2 (E) [C][a1]"}, {0x69f08c89,1048576,"K.O. - The Pro Boxing (J) [C][!]"}, {0x6d5b59c0,1048576,"Kadume Monsters (J) [C][!]"}, {0x77e13dbe,1048576,"Kaept'n Blaubaer - Die verrueckte Schatzsuche (G) [C][!]"}, {0x18caa513,4194304,"Kanji Boy (J) [C][!]"}, {0x81fd8918,4194304,"Kanji Boy 2 (J) [C][!]"}, {0x25efa1d7,1048576,"Kanji de Puzzle (J) [C][!]"}, {0x6c568e06,1048576,"Karamucho Owakari (J) [C][!]"}, {0xdd948071,1048576,"Karamucho Sawag (J) [C][!]"}, {0xaaba1ea4,2097152,"Karankoron (J) [C][!]"}, {0xbf80c897,1048576,"Kaseki Reborn II Monster Digger (J) [C][!]"}, {0xa262269f,1048576,"Katou 123 (J) [C][!]"}, {0x3791dca1,2097152,"Kawaii Pet Shop Monogatari 2 (J) [C][!]"}, {0xb868e846,1048576,"Keep the Balance (E) (M5) [C][!]"}, {0x710286ea,1048576,"Keiba Jou e Ikou Wide! (J) [C][!]"}, {0x6e39ebc4,1048576,"Kelly Club - Clubhouse Fun (U) [C][!]"}, {0x1e64d19c,1048576,"Ken Griffey Jrs' Slugfest (U) [C][!]"}, {0x6427cd7a,2097152,"Kidou Senkan Nadesco Ruri Ruri Mahjong (J) [C][!]"}, {0xde52ffdc,2097152,"Kindaichi Shounen no Jikenbo Juutoshime no Shoutaijou (J)[C][!]"}, {0x634b2d43,4194304,"King of Golf, The (J) [C][!]"}, {0x934f4b0a,2097152,"Kinsekae Tales (J) [C][!]"}, {0xc0face3d,1048576,"Kirby's Tilt 'n Tumble (J) [C][!]"}, {0xaddaff09,1048576,"Kirby's Tilt 'n Tumble (J) [C][f1]"}, {0xe541acf1,1048576,"Kirby's Tilt 'n Tumble (U) [C][!]"}, {0x343df2d8,1048576,"Kirby's Tilt 'n Tumble (U) [C][f1]"}, {0x783bc02d,1048576,"Kirikou (E) (M6) [C][!]"}, {0x14f91f86,1048576,"Kiwame GB II (J) [C][!]"}, {0x7181cbd0,1048576,"Klax (U) [C][!]"}, {0x577e1521,262144,"Klustar (E) (M5) [C][!]"}, {0x3f8d6041,262144,"Klustar (U) [C][!]"}, {0xa0d64934,1048576,"Knockout Kings (UE) [C][!]"}, {0x203f8727,1048576,"Konami GB Collection Volume 1 (E) [C][!]"}, {0xa6499792,1048576,"Konami GB Collection Volume 2 (E) [C][!]"}, {0xd4d6243d,1048576,"Konami GB Collection Volume 3 (E) [C][!]"}, {0x8800f1c9,1048576,"Konami GB Collection Volume 4 (E) [C][!]"}, {0x1c644040,1048576,"Konami Winter Games (E) [C][!]"}, {0xb6381744,2097152,"Konchu Hakase 2 (J) [C][!]"}, {0x430eb1e1,2097152,"KotoBattle (J) [C][!]"}, {0x3c39bcab,1048576,"Koukou Yakyuu High School Baseball (J) [C][!]"}, {0x6910ff3a,1048576,"Koushien Pocket (J) [C][!]"}, {0x392d630f,1048576,"Kuro Chan (J) [C][!]"}, {0x36b9a28c,1048576,"La Lellenda De La Cerda - Ed Charnega DX (Zelda Spain) (E) [C]"}, {0x016af0d7,1048576,"La Lellenda De La Cerda - Ed Charnega DX (Zelda Spain) (E) [C][a1]"}, {0x5a385226,1048576,"Land Before Time, The (E) (M5) [C][!]"}, {0xbce9cb16,1048576,"Land Before Time, The (U) [C][!]"}, {0xbef1cde4,524288,"Las Vegas Cool Hand (U) [C][!]"}, {0xbd9ba639,1048576,"Last Bible (J) [C][!]"}, {0x9caa00b5,1048576,"Last Bible 2 (J) [C][!]"}, {0xf90a3dae,1048576,"Laura (M8) (E) [C][!]"}, {0x1b49d07d,1048576,"Le Mans 24 Hours (E) (M5) [C][!]"}, {0x081d7fcb,1048576,"Legend of Soukoban, The (J) [C][!]"}, {0xf24d010a,1048576,"Legend of the River King 2 (E) [C][!]"}, {0x840fd525,1048576,"Legend of the River King 2 (U) [C][!]"}, {0x87ef9530,1048576,"Legend of the River King GB (E) (Pack in Video) [C][!]"}, {0x1241f3f5,1048576,"Legend of the River King GB (G) [C][!]"}, {0x7e821f47,1048576,"Legend of the River King GB (U) (Natsume) [C][!]"}, {0xf48824fe,1048576,"Legend of Zelda, The - Link's Awakening DX (F) [C][!]"}, {0xfed5959b,1048576,"Legend of Zelda, The - Link's Awakening DX (G) [C][!]"}, {0xd974abea,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.0) (J) [C][!]"}, {0x97822948,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.0) (U) [C][!]"}, {0xbd8a1041,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.1) (J) [C][!]"}, {0xb38eb9de,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.1) (U) [C][!]"}, {0x5933e3fa,2097152,"Legend of Zelda, The - Oracle of Ages (E) (M5) [C][!]"}, {0x3272e6f9,1048576,"Legend of Zelda, The - Oracle of Ages (J) [C][!]"}, {0x3800a387,1048576,"Legend of Zelda, The - Oracle of Ages (U) [C][!]"}, {0xdbac1357,2097152,"Legend of Zelda, The - Oracle of Seasons (E) (M5) [C][!]"}, {0xe42538f0,1048576,"Legend of Zelda, The - Oracle of Seasons (J) [C][!]"}, {0xd7e9f5d7,1048576,"Legend of Zelda, The - Oracle of Seasons (U) [C][!]"}, {0x690c0373,1048576,"LEGO Alpha Team (E) (M10) [C][!]"}, {0x6d7ec41b,1048576,"LEGO Alpha Team (U) [C][!]"}, {0x921abb21,1048576,"LEGO Island 2 - The Brickster's Revenge (E) (M10) [C][!]"}, {0xb14fa7e7,1048576,"LEGO Island 2 - The Brickster's Revenge (U) (M3) [C][!]"}, {0x0a109f13,1048576,"LEGO Racers (E) (M10) [C][!]"}, {0x05cc01fb,1048576,"LEGO Stunt Rally (E) (M10) [C][!]"}, {0xda084760,1048576,"LEGO Stunt Rally (U) [C][!]"}, {0x97e5ce2f,4194304,"Lemmings & Oh No! More Lemmings (U) [C][!]"}, {0x1d66cb29,1048576,"Les Razmoket 100% Angelica (F) [C][!]"}, {0x2f8fef3f,1048576,"Les Razmoket Voyages Dans Le Temps (F) [C][!]"}, {0xd843f898,1048576,"Les Visiteurs (F) [C][!]"}, {0xc6859b34,1048576,"Lil' Monster (U) [C][!]"}, {0x6467fba0,1048576,"Lion King, The - Simba's Mighty Adventure (F) [C][!]"}, {0xd5b4b7bb,1048576,"Lion King, The - Simba's Mighty Adventure (U) [C][!]"}, {0xca38283d,1048576,"Little Magic (J) [C][!]"}, {0x9fec297e,1048576,"Little Mermaid II Pinball Frenzy, The (E) (M5) [C][!]"}, {0x364f9ccd,1048576,"Little Mermaid II Pinball Frenzy, The (U) (M5) [C][!]"}, {0x27310900,2097152,"Little Nicky (U) [C][!]"}, {0xf8bf3ee7,1048576,"LNF Stars 2001 (F) [C][!]"}, {0xeceab84e,1048576,"Lode Runner (J) [C][!]"}, {0x66e166bb,1048576,"Lodoss War GB (J) [C][!]"}, {0x49bfacc8,1048576,"Lodoss War GB (J) [C][p1][!]"}, {0xd67275f7,1048576,"Logical (U) (Sunsoft) [C][!]"}, {0x5eee76c4,1048576,"Logical (U) (THQ) [C][!]"}, {0x4ef3ddd7,1048576,"Looney Tunes (U) [C][!]"}, {0x54509d24,2097152,"Looney Tunes Collector - Alert! (U) (M3) [C][!]"}, {0x22952662,2097152,"Looney Tunes Collector - Martian Revenge! (E) (M6) [C][!]"}, {0x66792cde,1048576,"Looney Tunes Racing (U) [C][!]"}, {0x034d2686,2097152,"Love Hina Party (J) [C][!]"}, {0x1c877abd,4194304,"Love Hina Pocket (J) [C][!]"}, {0x3aebfad8,524288,"Luca's Puzzle Adventure (J) [C][!]"}, {0xaba69b40,524288,"Luca's Puzzle Adventure (J) [C][BF]"}, {0xce7f108a,1048576,"Lucky Luke - Desperado Train (E) (M6) [C][!]"}, {0x412fb57c,1048576,"Lucky Luke (E) (M4) [C][!]"}, {0x5bae3c04,2097152,"Lufia - The Legend Returns (U) [C][!]"}, {0xa666f54d,1048576,"M&M's Minis Madness (G) [C][!]"}, {0x8649d7a0,1048576,"M&M's Minis Madness (U) [C][!]"}, {0x83293b1b,1048576,"M&M's Minis Madness Demo (U) [C][!]"}, {0x66328695,2097152,"MacDonalds Monogatari (J) [C][!]"}, {0x2b7abba4,2097152,"Macross 7 - Ginga no Heart wo Furuwasero! (J) [C][!]"}, {0x482944aa,1048576,"Madden NFL 2000 (U) [C][!]"}, {0x160e9e3c,1048576,"Madden NFL 2001 (U) [C][!]"}, {0xde1338d2,1048576,"Madden NFL 2002 (U) [C][!]"}, {0x15e5d499,1048576,"Magical Chase (J) [C][!]"}, {0xea9ee203,1048576,"Magical Drop (E) (M3) [C][!]"}, {0xe4188a79,1048576,"Magical Drop (U) [C][!]"}, {0xf53cf66c,1048576,"Magical Tetris Challenge (U) [C][!]"}, {0x0a421839,1048576,"Magical Tetris Challenge (V1.0) (E) (M7) [C][!]"}, {0x5042450b,2097152,"Magi-Nation (U) [C][!]"}, {0x8ed4bbba,1048576,"Mahjong King (J) [C][!]"}, {0x7d83a5e8,1048576,"Mahjong Kobo (J) [C][!]"}, {0xc870b88f,1048576,"Mahjong Quest (J) [C][!]"}, {0x29a78a49,1048576,"Mahjong Quest (J) [C][BF]"}, {0x4ec78785,1048576,"Marble Madness (U) [C][!]"}, {0xa132417d,2097152,"Mario Golf (E) [C][!]"}, {0x4ca2191a,2097152,"Mario Golf (J) [C][!]"}, {0x905ad0cb,2097152,"Mario Golf (U) [C][!]"}, {0xa781c63c,2097152,"Mario Tennis (U) [C][!]"}, {0x19070962,2097152,"Mario Tennis GB (J) [C][!]"}, {0x5d85dfad,2097152,"Martian Alert! (E) (M6) [C][!]"}, {0x11b4788c,2097152,"Marvin Strikes Back (U) (M3) [C]"}, {0x46faa730,1048576,"Mary-Kate & Ashley - Get a Clue (U) [C][!]"}, {0x84a880b9,1048576,"Mary-Kate & Ashley - Pocket Planner (U) [C][!]"}, {0x35d6ddcc,1048576,"Mary-Kate & Ashley - Winners Circle (U) [C][!]"}, {0x909c870f,1048576,"Mask of Zorro, The (E) [C][!]"}, {0x2c92ad12,1048576,"Mask of Zorro, The (U) [C][!]"}, {0x515c1459,1048576,"Mat Hoffman's Pro BMX (U) [C][!]"}, {0xa3f23d7e,2097152,"Matchbox - Emergency Patrol (U) [C][!]"}, {0x142b6efb,1048576,"Maya the Bee - Garden Adventures (E) (M4) [C][!]"}, {0x983b1d26,1048576,"Maya the Bee and Her Friends (E) (M3) [C][!]"}, {0x315caa18,1048576,"Me Mail Bear Happy Mail Town (J) [C][!]"}, {0xbf6bd446,2097152,"Medarot 2 - Kabuto (J) [C][!]"}, {0x5b8ffd37,2097152,"Medarot 2 - Kuwagata (J) [C][!]"}, {0x159673db,2097152,"Medarot 2 - Parts Collection (J) [C][!]"}, {0xe655632c,4194304,"Medarot 3 - Kabuto (J) [C][!]"}, {0xc4b71879,4194304,"Medarot 3 - Kuwagata (V1.0) (J) [C][!]"}, {0xbc617834,4194304,"Medarot 3 - Kuwagata (V1.1) (J) [C][!]"}, {0xee2d977f,2097152,"Medarot 3 - Parts Collection (J) [C][!]"}, {0xc192a368,4194304,"Medarot 4 - Kabuto Version (J) [C][!]"}, {0x6a29b9d8,4194304,"Medarot 4 - Kuwagata Version (J) [C][!]"}, {0x4f03d80a,2097152,"Medarot Cardrobottle - Kabuto Version (J) [C][!]"}, {0xa3735f81,2097152,"Medarot Cardrobottle - Kuwagata Version (J) [C][!]"}, {0x3a4d94d5,1048576,"Mega Man Xtreme (U) [C][!]"}, {0x8fedb6d8,1048576,"Mega Man Xtreme 2 (U) [C][!]"}, {0x65b8b343,1048576,"Men In Black - The Series (U) [C][!]"}, {0xca675933,1048576,"Men In Black 2 (E) [C][!]"}, {0x8b63f36f,1048576,"Men In Black 2 (U) (M3) [C][!]"}, {0xc5290cee,1048576,"Merlin (E) (M6) [C][!]"}, {0x00733c77,1048576,"Meta Fight (J) [C][!]"}, {0xa76eed5b,2097152,"Meta Mode (J) [C][!]"}, {0x7831f84d,2097152,"Metal Gear - Ghost Babel (J) [C][!]"}, {0x16796957,4194304,"Metal Gear Solid (E) (M5) [C][!]"}, {0x04b0c5d6,2097152,"Metal Gear Solid (U) [C][!]"}, {0x3be68391,1048576,"Metal Walker (U) [C][!]"}, {0xd77971c0,1048576,"Mia Hamm Soccer Shootout (U) [C][!]"}, {0xd5e845f4,4194304,"Mickey's Racing Adventure (E) (M5) [C][!]"}, {0x11763934,4194304,"Mickey's Speedway USA (U) (M4) [C][!]"}, {0xeaf6e4f2,1048576,"Mickey's Tetris Adventure (J) [C][!]"}, {0x5dd337eb,2097152,"Micro Machines 1&2 - Twin Turbo (U) [C][!]"}, {0xb8064453,2097152,"Micro Machines V3 (U) [C][!]"}, {0xe66e093b,2097152,"Micro Maniacs (E) [C][!]"}, {0x0f02d708,1048576,"Microsoft - The Best of Entertainment Pack (E) [C][!]"}, {0xd2d88cfa,1048576,"Microsoft - The Best of Entertainment Pack (U) [C][!]"}, {0x504f55c5,1048576,"Microsoft Pinball (U) [C][!]"}, {0xee4cba24,1048576,"Microsoft Puzzle Collection (E) (M5) [C][!]"}, {0xb57dabae,1048576,"Millenium Winter Sports (U) [C][!]"}, {0x5cb4fc8a,1048576,"Minna no Shogi (J) [C][!]"}, {0x18216e26,1048576,"Missile Command (E) [C][!]"}, {0x47543c51,1048576,"Missile Command (U) [C][!]"}, {0x0af32baa,1048576,"Mission Impossible (E) (M5) [C][!]"}, {0x41230d11,1048576,"Mission Impossible (U) (M3) [C][!]"}, {0x7226ead0,2097152,"Mobile Trainer (J) [C][!]"}, {0xda7fb08f,2097152,"Momotaro Densetsu 1-2 (J) [C][!]"}, {0xbc1809ce,2097152,"Monkey Puncher (E) [C][!]"}, {0xb02564fc,2097152,"Monkey Puncher (J) [C][!]"}, {0xe48adf8d,2097152,"Monkore Knight (J) [C][!]"}, {0x0503e567,1048576,"Monopoly (J) [C][!]"}, {0x95ce6846,1048576,"Monopoly (J) [C][BF]"}, {0xe559a717,1048576,"Monopoly (U) [C][!]"}, {0x69b88f1e,2097152,"Monster Farm Battle Card (J) [C][!]"}, {0xb985f0d8,2097152,"Monster Race 2 (J) [C][!]"}, {0x50ddf120,2097152,"Monster Rancher Battle Card GB (U) [C][!]"}, {0x6c35e8f0,1048576,"Monster Rancher Explorer (U) [C][!]"}, {0x9cfa76c3,2097152,"Monster Tactics (J) [C][!]"}, {0x183dbb31,1048576,"Monsters Inc. (U) [C][!]"}, {0xde04772f,524288,"Montezuma's Return (U) (M2) [C][!]"}, {0x659693de,524288,"Montezuma's Return (E) (M5) [C][!]"}, {0xbd29ee6f,2097152,"Moomin's Adventure (J) [C][!]"}, {0x45543ba2,1048576,"Moomin's Tale (G) (M3) [C][!]"}, {0xf40199c9,1048576,"Moon Patrol & Spy Hunter (U) [C][!]"}, {0xed52ceaf,1048576,"Moorhuhn 2 (G) [C][!]"}, {0x87588725,1048576,"Mortal Kombat 4 (E) (no blood) [C][!]"}, {0x4eb71448,1048576,"Mortal Kombat 4 (U) [C][!]"}, {0x17d27fa9,1048576,"Motocross Maniacs 2 (U) [C][!]"}, {0x773729af,1048576,"Mr. Driller (J) [C][!]"}, {0x492c0ebf,1048576,"Mr. Driller (U) [C][!]"}, {0x4e37c741,1048576,"Mr. Nutz (E) (M6) [C][!]"}, {0xf2335da9,1048576,"Ms. Pac-Man & Pac-Man SCE (E) (Acclaim) [C][!]"}, {0x103e212d,524288,"Ms. Pac-Man & Pac-Man SCE (U) (Namco) [C][!]"}, {0xb7b2354b,1048576,"MTV Sports - Pure Ride (U) [C][!]"}, {0x744561f3,1048576,"MTV Sports - Skateboarding (U) [C][!]"}, {0x904663af,1048576,"MTV Sports - TJ Lavin's Ultimate BMX (U) [C][!]"}, {0xc997f45b,1048576,"Mummy Returns, The (U) [C][!]"}, {0x84fc838a,1048576,"Mummy, The (E) (M3) [C][!]"}, {0xc6ba9f27,1048576,"Mummy, The (U) [C][!]"}, {0xe2e4328b,1048576,"Muscle Ranking GB (J) [C][!]"}, {0x42de9092,2097152,"Muscle Ranking GB 2 (J) [C][!]"}, {0xe2f6253e,4194304,"Muscle Ranking GB 3 (J) [C][!]"}, {0xb9fa3ce4,1048576,"Nakayoshi Cooking Series - Oishii Pan Ya San (J) [C][!]"}, {0xe5ec7be5,1048576,"Nakayoshi Pet Series - Kawaii Hamster 2 (J) [C][!]"}, {0x1a382367,1048576,"Nakayoshi Pet Series 4 Kawaii Koneko (J) [C][!]"}, {0x54d90a4c,1048576,"NASCAR 2000 (E) [C][!]"}, {0x39c6b868,1048576,"NASCAR Challenge (U) [C][!]"}, {0xfa83b37c,1048576,"NASCAR Heat (U) [C][!]"}, {0xf39a5c4f,1048576,"NASCAR Racers (U) [C][!]"}, {0x001f4754,1048576,"NBA 3 on 3 Featuring Kobe Bryant (U) [C][!]"}, {0x5011a419,1048576,"NBA Hoopz (U) [C][!]"}, {0xbe949f74,1048576,"NBA In The Zone (U) [C][!]"}, {0xe6af6d07,2097152,"NBA In The Zone 2000 (E) [C][!]"}, {0xfdb38c49,2097152,"NBA In The Zone 2000 (U) [C][!]"}, {0x3aa75f1c,1048576,"NBA Jam 2001 (U) [C][!]"}, {0x84be0eed,1048576,"NBA Jam '99 (UE) [C][!]"}, {0x03f44abc,1048576,"NBA Jam '99 (UE) [C][BF]"}, {0x748564ae,1048576,"NBA Pro '99 (E) [C][!]"}, {0x7ae23888,1048576,"NBA Showtime - NBA on NBC (U) [C][!]"}, {0x5337ff55,2097152,"Neon Evangelion Mahjong (J) [C][!]"}, {0xdca4474e,1048576,"New Adventures of Mary-Kate and Ashley, The (U) [C][!]"}, {0x62f560d8,1048576,"New York Racer (E) (M6) [C][!]"}, {0xd731ded7,524288,"NFL Blitz (U) [C][!]"}, {0x090c7dac,1048576,"NFL Blitz 2000 (U) [C][!]"}, {0x61c653ae,1048576,"NFL Blitz 2001 (U) [C][!]"}, {0xbb625129,1048576,"NHL 2000 (U) [C][!]"}, {0x8bc5b62a,1048576,"NHL Blades of Steel 2000 (U) [C][!]"}, {0xa3f079d4,1048576,"Nicktoon's Racing (U) [C][!]"}, {0x4631d8bf,1048576,"Nintama Rantaro (J) [C][!]"}, {0xec823cc1,131072,"Nintendo Power Menu Program (J) [C]"}, {0x0f69f574,1048576,"No Fear - Downhill Mountain Biking (E) [C][!]"}, {0x233862d0,1048576,"Nobunaga's Ambition 2 (J) [C][!]"}, {0x845b4e44,1048576,"Noddy and the Birthday Party (E) (M4) [C][!]"}, {0x6628cdee,1048576,"Obelix (E) (M4) [C][!]"}, {0x5c260d5a,1048576,"Oddworld Adventures 2 (E) (M5) [C][!]"}, {0x840ef32f,262144,"Ohasta Yamachan & Reimondo (J) [C][!]"}, {0xe5c9569a,1048576,"Oishii Cake Okusan (J) [C][!]"}, {0xd86507c9,1048576,"Ojarumaru (J) [C][!]"}, {0xed7461d2,2097152,"Ojarumaru Tsukiyogaike (J) [C][!]"}, {0x3485761a,1048576,"O'Leary Manager 2000 (E) (M7) [C][!]"}, {0xd47c0dcf,1048576,"Oodorobou Jing Angel (J) [C][!]"}, {0x2a39a874,1048576,"Oodorobou Jing Devil (J) [C][!]"}, {0x948f4a96,2097152,"Oshare Nikki (J) [C][!]"}, {0xc7800576,1048576,"Othello 2000 (J) [C][!]"}, {0x3eac3d1c,1048576,"Ottifanten - Kommando Stoertebecker (G) [C][!]"}, {0x3f635a4f,1048576,"Owarai Yoiko no Game Dou - Oyaji Sagashite 3 Choume (J)[C][!]"}, {0x1e443d1b,1048576,"Pachi Pachi Pachisurou (J) [C][!]"}, {0x1a631bab,1048576,"Pachinko Hissho Guide - The King of Data (J) [C][!]"}, {0xf75e269e,1048576,"Pachislot CR Genjin (J) [C][!]"}, {0x3485ef86,262144,"Pac-Man & Pac-Attack SCE (U) (Namco) [C][!]"}, {0xf565647f,1048576,"Pac-Man & Pac-Panic SCE (E) (Acclaim) [C][!]"}, {0xc0a98305,1048576,"Paperboy (U) [C][!]"}, {0xda3a3278,1048576,"Papyrus (E) (M6) [C][!]"}, {0xafa1aac3,2097152,"Perfect Choro Q (J) [C][!]"}, {0x0601bef6,4194304,"Perfect Dark (U) (M5) [C][!]"}, {0x3e43f25f,2097152,"Phantom Zona (J) [C][!]"}, {0xfa09cebe,1048576,"Pitfall - Beyond the Jungle (J) [C][!]"}, {0xf911bb5d,1048576,"Pitfall - Beyond the Jungle (U) [C][!]"}, {0x375c35e0,1048576,"Player Manager 2001 (E) (M2) [C][!]"}, {0x911007e1,1048576,"Pocket Billiard (J) [C][!]"}, {0xfa2a66e9,1048576,"Pocket Bomberman (U) [C][!]"}, {0x26589b79,524288,"Pocket Bowling (J) [C][!]"}, {0x3ed30908,524288,"Pocket Bowling (U) [C][!]"}, {0x389cf56f,131072,"Pocket Color Block (J) [C][!]"}, {0x08dc0af4,1048576,"Pocket Color Mahjong (J) [C][!]"}, {0xc73eb10e,1048576,"Pocket Color Trump (J) [C][!]"}, {0x4d26e880,1048576,"Pocket Densya 2 (J) [C][!]"}, {0x2a273244,2097152,"Pocket Family GB 2 (J) [C][!]"}, {0xc424874e,2097152,"Pocket GI Stable (J) [C][!]"}, {0x2ac77c5a,1048576,"Pocket GT (J) [C][!]"}, {0xaf0c51b8,262144,"Pocket Hanafuda (J) [C][!]"}, {0xdee71d44,2097152,"Pocket King (J) [C][!]"}, {0x35a29628,1048576,"Pocket Lure Boy (J) [C][!]"}, {0xc78fba94,1048576,"Pocket Lure Boy (J) [C][p1][!]"}, {0x8edb9eb7,524288,"Pocket Monsters Adventure (J) [C][p1][!]"}, {0x270c4ecc,2097152,"Pocket Monsters Crystal Glass (J) [C][!]"}, {0xa6e53a50,2097152,"Pocket Monsters Crystal Glass (J) [C][f1]"}, {0xa690ed9f,2097152,"Pocket Monsters Crystal Glass (J) [C][p1][!]"}, {0xdd13f234,524288,"Pocket Monsters GO!GO!GO! (J) [C][p1][!]"}, {0xdc8c08e8,1048576,"Pocket Monsters Gold (V1 Bung Fix) (V1.0) (J) [C][f1]"}, {0xf4bb388e,1048576,"Pocket Monsters Gold (V1 Bung Fix) (V1.1) (J) [C][f1]"}, {0x524478d4,1048576,"Pocket Monsters Gold (V1.0) (J) [C][!]"}, {0x4ef7f2a5,1048576,"Pocket Monsters Gold (V1.1) (J) [C][!]"}, {0x13c70de9,1048576,"Pocket Monsters Pinball (J) [C][!]"}, {0x98eb4a17,1048576,"Pocket Monsters Silver (V1 Bung Fix) (V1.0) (J) [C][f1]"}, {0x5447746b,1048576,"Pocket Monsters Silver (V1 Bung Fix) (V1.1) (J) [C][f1]"}, {0xbe1b928a,1048576,"Pocket Monsters Silver (V1.0) (J) [C][!]"}, {0x0aea5383,1048576,"Pocket Monsters Silver (V1.1) (J) [C][!]"}, {0x1926f570,1048576,"Pocket Monsters Trading Card Game (J) [C][!]"}, {0xe09f8243,1048576,"Pocket Monsters Trading Card Game (J) [C][a1]"}, {0xd7eb280b,1048576,"Pocket Monsters Trading Card Game (J) [C][BF1]"}, {0x54cb23d9,1048576,"Pocket Monsters Trading Card Game (J) [C][BF2]"}, {0x6c933a14,2097152,"Pocket Monsters Trading Card GB 2 - Team Great Rocket Visit! (J) [C][!]"}, {0xd4ebba41,2097152,"Pocket Pro Wrestling Perfect Wrestler (J) [C][!]"}, {0x870db337,1048576,"Pocket Puyo Puyo 4 (J) [C][!]"}, {0x45661ec3,1048576,"Pocket Puyo Sun (J) [C][!]"}, {0xfbf97372,1048576,"Pocket Racing (E) [C][!]"}, {0xe8f5824f,2097152,"Pocket Soccer (E) (M6) [C][!]"}, {0x25eee713,32768,"Pocket Voice Multi-ROM Menu V2.0 (Unl) [C]"}, {0x88dfcac5,32768,"Pocket Voice Multi-ROM Menu V2.1 (Unl) [C]"}, {0xcf904f72,524288,"Pocket Voice V1.0 (Unl) [C]"}, {0xb604a804,524288,"Pocket Voice V1.1 (Unl) [C]"}, {0x22da549e,262144,"Pocket Voice V1.1 (Unl) [C][a1]"}, {0x6a808bcf,262144,"Pocket Voice V1.1 (Unl) [C][a2]"}, {0xb5d34632,262144,"Pocket Voice V1.2 (Unl) [C]"}, {0xc34621ad,524288,"Pocket Voice V2.0 (Unl) [C]"}, {0x964b7a10,1048576,"Pokemon Amarillo (Yellow) (S) [C][!]"}, {0x3358e30a,2097152,"Pokemon Crystal (E) [C][!]"}, {0x878b2aa7,2097152,"Pokemon Crystal (F) [C][!]"}, {0x616d85de,2097152,"Pokemon Crystal (G) [C][!]"}, {0xf9b4798e,2097152,"Pokemon Crystal (I) [C][!]"}, {0xff0a6f8a,2097152,"Pokemon Crystal (S) [C][!]"}, {0xee6f5188,2097152,"Pokemon Crystal (U) [C][!]"}, {0xc075b6c5,1048576,"Pokemon Cute V1.4 (Yellow Hack) [C]"}, {0x6bf7e4a6,2097152,"Pokemon de Panepon (J) [C][!]"}, {0x41e3723c,2097152,"Pokemon Diamond (U) [p1][C][!]"}, {0xe4243849,1048576,"Pokemon Dreamland V1.4 (Pocket Monsters Gold Hack) [C]"}, {0x7a01e45a,1048576,"Pokemon Gelb (Yellow) (G) [C][!]"}, {0x8b56fe33,1048576,"Pokemon Giallo (Yellow) (I) [C][!]"}, {0x37a70702,2097152,"Pokemon Gold (F) [C][!]"}, {0x4889dfaa,2097152,"Pokemon Gold (G) [C][!]"}, {0x4c184ce3,2097152,"Pokemon Gold (I) [C][!]"}, {0x3434a92b,2097152,"Pokemon Gold (S) [C][!]"}, {0x6bde3c3e,2097152,"Pokemon Gold (U) [C][!]"}, {0xd03426e9,1048576,"Pokemon Jaune (Yellow) (F) [C][!]"}, {0x004096b8,1048576,"Pokemon of the Past DX V1.0 (Zelda DX hack by PR) (U) [C]"}, {0x3bc57f8c,1048576,"Pokemon of the Past DX V1.1 (Zelda DX hack by PR) (U) [C]"}, {0x39c432a4,2097152,"Pokemon Pinball (E) (M5) [C][!]"}, {0x03ce8d9a,1048576,"Pokemon Pinball (U) [C][!]"}, {0x8206b1ce,2097152,"Pokemon Puzzle Challenge (E) (M5) [C][!]"}, {0xd06bba96,2097152,"Pokemon Puzzle Challenge (U) [C][!]"}, {0xe0c216ea,2097152,"Pokemon Silver (F) [C][!]"}, {0x96c9db95,2097152,"Pokemon Silver (G) [C][!]"}, {0xcba6d2d4,2097152,"Pokemon Silver (I) [C][!]"}, {0x1d9faac5,2097152,"Pokemon Silver (S) [C][!]"}, {0x8ad48636,2097152,"Pokemon Silver (U) [C][!]"}, {0x4523376e,2097152,"Pokemon Trading Card Game (E) (M3) (Eng-Ger-Fre) [C][!]"}, {0x966daef1,2097152,"Pokemon Trading Card Game (E) (M3) (Eng-Spa-Ita) [C][!]"}, {0x81069d53,1048576,"Pokemon Trading Card Game (U) [C][!]"}, {0x7d527d62,1048576,"Pokemon Yellow (U) [C][!]"}, {0x7aace6a6,1048576,"Pokemon Yellow (U) [C][BF]"}, {0xdd8b189e,1048576,"Polaris SnoCross (U) [C][!]"}, {0x71693f5c,1048576,"Polaris SnoCross (U) [C][BF]"}, {0x476bd39d,1048576,"Pong - The Next Level (U) [C][!]"}, {0xfc67f7e4,1048576,"Pop 'N' Pop (E) [C][!]"}, {0x1cffb764,1048576,"Pop 'N' Pop (J) [C][!]"}, {0x9b2429a7,1048576,"Pop'N Music - Animated Melody (J) [C][!]"}, {0x48c3c6ef,1048576,"Pop'N Music - Disney Tunes (J) [C][!]"}, {0x07e6ca95,1048576,"Pop'N Music (J) [C][!]"}, {0x913ac306,1048576,"Portal Runner (U) [C][!]"}, {0xc2a4a3eb,2097152,"Power Pro Kun 2 (J) [C][!]"}, {0x145540d8,2097152,"Power Pro Kun Pocket (V1.0) (J) [C][!]"}, {0x894d88f2,2097152,"Power Pro Kun Pocket (V1.1) (J) [C][!]"}, {0x2a6ef6a8,1048576,"Power Proyaku Kun Baseball (J) [C][!]"}, {0x30e1e567,1048576,"Power Quest (E) (M6) [C][!]"}, {0x99869172,1048576,"Power Rangers Light Speed Rescue (U) [C][!]"}, {0x17e51443,1048576,"Power Rangers Time Force (U) [C][!]"}, {0xae57d1c3,1048576,"Power Spike - Pro Beach Volleyball (U) [C][!]"}, {0x834caf7a,2097152,"Powerpuff Girls, The - Bad Mojo Jojo (U) [C][!]"}, {0xd8455984,2097152,"Powerpuff Girls, The - Battle Him (U) [C][!]"}, {0x9d47261a,2097152,"Powerpuff Girls, The - Paint the Townsville Green (U) [C][!]"}, {0x2f368da6,2097152,"Poyon's Dungeon Room (J) [C][!]"}, {0x5e312730,2097152,"Poyon's Dungeon Room 2 (J) [C][!]"}, {0x91def753,2097152,"Prince Naseem Boxing (E) (M3) [C][!]"}, {0xe6bec6d1,1048576,"Prince of Persia (E) (M5) [C][!]"}, {0x834a72c0,1048576,"Pro Darts (U) [C][!]"}, {0x1461d8d8,1048576,"Pro Mahjong Tsuwamono (J) [C][!]"}, {0xf03016f5,1048576,"Pro Mahjong Tsuwamono 2 (J) [C][!]"}, {0x04d3031a,1048576,"Pro Pool (E) (M3) [C][!]"}, {0x20cee2e8,524288,"Project S-11 (U) [C][!]"}, {0xa9a89dda,1048576,"Puchi Carat (E) [C][!]"}, {0xf0d0c36d,1048576,"Puchi Carat (J) [C][!]"}, {0xf55cdb79,1048576,"Pumuckl's Abenteuer bei den Piraten (G) [C][!]"}, {0x87fcec24,1048576,"Pumuckl's Abenteuer im Geisterschloss (G) [C][!]"}, {0x67350bc9,1048576,"Puyo Wars (J) [C][!]"}, {0xaf858234,1048576,"Puzz Loop (J) [C][!]"}, {0x79a35284,524288,"Puzzle Bobble 4 (J) [C][!]"}, {0x00fded94,1048576,"Puzzle Bobble Millennium (J) [C][!]"}, {0x73ed3042,1048576,"Puzzle De Shoubuyo Wootamachan (J) [C][!]"}, {0x06eb7a01,1048576,"Puzzle Master (U) [C][!]"}, {0x15b44d68,1048576,"Puzzled (E) (M3) [C][!]"}, {0xf03ffdaf,1048576,"Puzzled (U) [C][!]"}, {0x90f46d7e,1048576,"Q-bert (U) [C][!]"}, {0xd729db40,1048576,"Qix Adventure (E) [C][!]"}, {0x5acea4a9,1048576,"Qix Adventure (J) [C][!]"}, {0x98285775,1048576,"Quest - Fantasy Challenge (U) [C][!]"}, {0xce55a4de,1048576,"Quest for Camelot (E) (M6) [C][!]"}, {0xd903db7d,1048576,"Quest for Camelot (U) (M3) [C][!]"}, {0x9ac27645,2097152,"Quest RPG (U) [C][!]"}, {0x56d76ba2,1048576,"Qui Qui (J) [C][!]"}, {0x6decc6b3,1048576,"Rainbow Islands (E) (M5) [C][!]"}, {0xb029017f,524288,"Rampage - World Tour (U) [C][!]"}, {0x20b86f1e,1048576,"Rampage 2 - Universal Tour (U) [C][!]"}, {0xd5aeed2e,1048576,"Rampart (U) [C][!]"}, {0x17635ad1,524288,"Rats! (UE) (M2) [C][!]"}, {0xc430a89a,4194304,"Rayman (E) [C][!]"}, {0x3fde5bac,4194304,"Rayman (J) [C][!]"}, {0xeda12f0d,4194304,"Rayman (U) [C][!]"}, {0x5c201286,1048576,"Razor Freestyle Scooter (U) [C][!]"}, {0x345e20a4,2097152,"Ready 2 Rumble Boxing (U) [C][!]"}, {0xafff6bb9,524288,"Real Baseball - Continental League (J) [C][!]"}, {0x16b81c36,524288,"Real Baseball - Pacific League (J) [C][!]"}, {0x77a4dc63,1048576,"Rescue Heroes - Fire Frenzy (U) [C][!]"}, {0x22621803,524288,"Reservoir Rats (E) (M5) [C][!]"}, {0x6c432979,2097152,"Resident Evil Gaiden (E) [C][!]"}, {0x8e04849a,1048576,"Return of the Ninja (E) [C][!]"}, {0xa07da702,1048576,"Return of the Ninja (U) [C][!]"}, {0xd1a65d74,1048576,"Revelations - The Demon Slayer (U) [C][!]"}, {0xa6fa9f09,1048576,"Revelations - The Demon Slayer (U) [C][BF]"}, {0x73160e05,1048576,"Rhino Rumble (U) [C][!]"}, {0xab8c3a31,1048576,"Rip-Tide Racing (E) (M5) [C][!]"}, {0xf0b09ddb,1048576,"River Fishing 4 (J) [C][!]"}, {0x98c59706,1048576,"Road Champs BXS Stunt Biking (U) [C][!]"}, {0x11025eeb,1048576,"Road Rash (U) [C][!]"}, {0xfe2995a1,131072,"Roadsters '98 (U) [C][!]"}, {0x717b3525,1048576,"Roadsters Trophy (E) (M6) [C][!]"}, {0xd4f84329,1048576,"Robin Hood (E) (M6) [C][!]"}, {0x6c6423e2,1048576,"Robocop (U) (M6) [C][!]"}, {0xb28f32ac,1048576,"Robopon Star (J) [C][!]"}, {0xfa57ea6a,1048576,"Robopon Star (J) [C][BF]"}, {0xcb0b8003,1048576,"Robopon Sun (J) [C][!]"}, {0x89d389ba,1048576,"Robopon Sun (J) [C][BF]"}, {0x32caef11,1048576,"Robopon Sun (U) [C][!]"}, {0x87a29030,1048576,"Robot Ponkottsu Moon Version (J) [C][!]"}, {0xe99bdee6,1048576,"Robot Wars Metal Mayhem (E) (M6) [C][!]"}, {0x7025eb63,1048576,"Rocket Power - Gettin' Air (U) [C][!]"}, {0xc9a7aa7b,1048576,"Rocket Racer - La Glisse De L'Extreme (F) [C][!]"}, {0x919077ab,1048576,"Rockman X (J) [C][!]"}, {0x17913dd0,1048576,"Rockman X2 - Soul Eraser (J) [C][!]"}, {0x9aa5b021,1048576,"Rocky Mountain Trophy Hunter (U) [C][!]"}, {0x10dbde7c,1048576,"Roland Garros French Open (E) (M6) [C][!]"}, {0xa856c066,1048576,"Ronaldo V.Football (E) (M7) [C][!]"}, {0x49101556,1048576,"Roswell Conspiracies - Aliens, Myths & Legends (E) (M3) [C][!]"}, {0x1f5ec131,1048576,"Roswell Conspiracies - Aliens, Myths & Legends (U) (M3) [C][!]"}, {0x2e944775,262144,"Rox (E) [C][!]"}, {0x4bd73d99,262144,"Rox (J) [C][!]"}, {0x0b614307,2097152,"RPG Maker (J) [C][!]"}, {0x3623ebb6,1048576,"R-Type DX (J) [C][!]"}, {0xfc1d4089,1048576,"R-Type DX (U) [C][!]"}, {0x9c743f03,1048576,"Rugrats - Time Travelers (U) [C][!]"}, {0xfc6195ef,1048576,"Rugrats - Totally Angelica (U) [C][!]"}, {0x026c4794,1048576,"Rugrats - Typisch Angelica (G) [C][!]"}, {0x094494e9,1048576,"Rugrats in Paris - The Movie (F) [C][!]"}, {0x8b195237,1048576,"Rugrats in Paris - The Movie (U) [C][!]"}, {0xb4091600,1048576,"Rugrats Movie, The (U) [C][!]"}, {0x2cf48188,1048576,"Sabrina - The Animated Series - Spooked (U) [C][!]"}, {0x818f3af6,2097152,"Sabrina - The Animated Series - Zapped! (E) (M3) [C][!]"}, {0x5d39a9b0,2097152,"Sabrina - The Animated Series - Zapped! (U) [C][!]"}, {0xb5412c6f,1048576,"Sakata (J) [C][!]"}, {0xef503d50,4194304,"Sakura Wars (J) [C][!]"}, {0xef368f16,1048576,"San Francisco Rush 2049 (U) [C][!]"}, {0xe787b44c,1048576,"Sangokushi 2 (J) [C][!]"}, {0x8cfdc80f,1048576,"Sangokushi 2 (J) [C][p1][!]"}, {0xefe51e17,1048576,"Sanrio Timenet Future (J) [C][!]"}, {0x458b579d,1048576,"Sanrio Timenet Past (J) [C][!]"}, {0xe3704755,1048576,"Scooby-Doo! Classic Creep Capers (U) [C][!]"}, {0x365bf43f,1048576,"SD Hiryu Ex (J) [C][!]"}, {0xfd4e9a51,1048576,"SD Hiryu Ex (J) [C][BF]"}, {0x612f0529,1048576,"Sei Hai (J) [C][!]"}, {0x8804f856,1048576,"Sei Hai (J) [C][f1]"}, {0x0b1b928c,2097152,"Seme COM Dungeon - Druaga (J) [C][!]"}, {0x23fa5f53,1048576,"Senkai Imonroku Junteitaisen (J) [C][!]"}, {0x521a2f77,1048576,"Sgt. Rock - On The Front Line (U) [C][!]"}, {0xf6a876a5,1048576,"Shadowgate Classic (V1.0) (E) (M5) [C][!]"}, {0xd337f450,1048576,"Shadowgate Classic (V1.1) (E) (M5) [C][!]"}, {0x1bcd7d70,1048576,"Shadowgate Return (J) [C][!]"}, {0xefb9196d,1048576,"Shamus (U) [C][!]"}, {0xa5e3ece9,1048576,"Shanghai Pocket (J) [C][!]"}, {0x9401ba47,1048576,"Shanghai Pocket (V1.0) (U) [C][!]"}, {0xd8fac36c,1048576,"Shanghai Pocket (V1.1) (U) [C][!]"}, {0x709cda93,2097152,"Shaun Palmer's Pro Snowboarder (U) [C][!]"}, {0x85264877,2097152,"Shin Megami Tensei Trading Card Summoner (J) [C][!]"}, {0x3a96e868,1048576,"Shogi Oh (J) [C][!]"}, {0x28356950,1048576,"Shoubushi Densetsu Tetsuya Shinjuku Tenun hen (J) [C][!]"}, {0xa7748d2b,262144,"Shougi 2 (J) [C][!]"}, {0x387e6459,2097152,"Shrek Fairy Tale Freakdown (U) (M6) [C][!]"}, {0xebaf4888,1048576,"Simpsons, The - Night of the Living Treehouse of Horror (U) [C][!]"}, {0x6dd8ac91,1048576,"Sirubaniamorinonakama (J) [C][!]"}, {0x6f97b043,1048576,"Smurfs Nightmare, The (E) (M4) [C][!]"}, {0xd882eccc,1048576,"Snoopy Tennis (E) (M3) [C][!]"}, {0xc9c68471,1048576,"Snow White And The Seven Dwarfs (E) (M9) [C][!]"}, {0x846fea2b,1048576,"Snowboard Champion (J) [C][!]"}, {0x4ba47dbc,1048576,"Snowcross (E) (M6) [C][!]"}, {0x237ecef9,1048576,"Soccer Manager (E) (M4) [C][!]"}, {0x6aee0958,1048576,"Solomon - Cox Adventure of the White Tower (J) [C][!]"}, {0xdec1260e,524288,"Sonic 7 (Unl) [C]"}, {0x7ecbcd39,1049088,"Soreike! Anpanman 2 (J) [C][!]"}, {0x3ffcd45b,2097152,"Soul Getter (J) [C][!]"}, {0xdab7460c,1048576,"Space Invaders (U) [C][!]"}, {0xc016bc79,1048576,"Space Invaders X (J) [C][!]"}, {0x60dfa546,131072,"Space Invasion (Thalamus Interactive) V0.01 (E) [C]"}, {0x4f83b35e,1048576,"Space Marauder (U) [C][!]"}, {0x63353c0f,2097152,"Space Station Silicon Valley (E) (M7) [C][!]"}, {0xf606d369,2097152,"Space-Net Cosmo Blue (J) [C][!]"}, {0x01f96353,2097152,"Space-Net Cosmo Red (J) [C][!]"}, {0x72fcb0ad,2097152,"Spawn (U) [C][!]"}, {0xf4010cbd,2097152,"Spawn (U) [C][BF]"}, {0xae82afa4,1048576,"Speedy Gonzales - Aztec Adventure (U) [C][!]"}, {0xf6334dc5,1048576,"Spider-Man (F) [C][!]"}, {0x5a83dfc4,1048576,"Spider-Man (J) [C][!]"}, {0x34e2b3ba,1048576,"Spider-Man (U) [C][!]"}, {0xa7faaccf,1048576,"Spider-Man 2 - The Sinister Six (U) [C][!]"}, {0x3e9bc90b,1048576,"Spirou La Panque Mecanique (E) (M7) [C][!]"}, {0x81230564,1048576,"SpongeBob SquarePants - Legend of the Lost Spatula (U) [C][!]"}, {0x713c6c17,1048576,"Spy vs Spy (E) (M7) [C][!]"}, {0x0e783117,1048576,"Spy vs Spy (J) [C][!]"}, {0xfc551dab,1048576,"Spy vs Spy (J) [C][f1]"}, {0xf0463d51,1048576,"Spy vs Spy (U) [C][!]"}, {0x8c7ddbda,4194304,"Star Ocean - Bluesphere (J) [C][!]"}, {0xe584dfc2,1048576,"Star Wars Episode 1 - Obi-Wan's Adventures (E) (M5) [C][!]"}, {0x0e697582,1048576,"Star Wars Episode 1 - Obi-Wan's Adventures (U) [C][!]"}, {0x0ebc5758,2097152,"Star Wars Episode I Racer (UE) [C][!]"}, {0x816a4d94,1048576,"Stranded Kids (E) (M3) [C][!]"}, {0x28a3ab3a,1048576,"Street Fighter Alpha (E) [C][!]"}, {0x32739b34,1048576,"Street Fighter Alpha (J) [C][!]"}, {0xaa5f14d2,1048576,"Street Fighter Alpha (U) [C][!]"}, {0xeb273887,1048576,"Stuart Little - The Journey Home (U) [C][!]"}, {0x5c95d5a2,1048576,"Super B-Daman (J) [C][!]"}, {0xb7f77b6a,4194304,"Super Black Bass - Real Fight (J) [C][!]"}, {0xae466545,1048576,"Super Black Bass Pocket 3 (J) [C][!]"}, {0x34c8a4a5,262144,"Super Bombliss DX (U) [C][!]"}, {0x6833923d,524288,"Super Breakout! (E) (M6) [C][!]"}, {0x52f51cb5,1048576,"Super Breakout! (U) [C][!]"}, {0xdcdaa333,1048576,"Super Chinese Fighter EX (J) [C][!]"}, {0xdf50473f,1048576,"Super Doll Rika Chan Kisekae Daisakusen (J) [C][!]"}, {0x866b1212,1048576,"Super Mario Bros. DX (J) [C][!]"}, {0xa4cd26ff,1048576,"Super Mario Bros. DX (V1.0) (U) [C][!]"}, {0x90ab047b,1048576,"Super Mario Bros. DX (V1.1) (U) [C][!]"}, {0x00865161,1048576,"Super Real Fishing (J) [C][!]"}, {0x6e330fcd,2097152,"Super Robot Pinball (J) [C][!]"}, {0xcbb7159f,1048576,"Super Robot War Final Volume 1 (Unl) [p1][C]"}, {0xd24e592d,1048576,"Super Robot Wars Link Battler (J) [C][!]"}, {0x4d3e0f51,2097152,"Supercross Freestyle (E) (M5) [C][!]"}, {0x53b1e661,2097152,"Supreme Snowboarding (E) (M3) [C][!]"}, {0x19c2bd07,1048576,"Survival Kids (J) [C][!]"}, {0xea314903,1048576,"Survival Kids (J) [C][f1]"}, {0x61fa675c,1048576,"Survival Kids (J) [C][f2]"}, {0xc46aba56,1048576,"Survival Kids (U) [C][!]"}, {0xab8b25d8,1048576,"Survival Kids 2 (J) [C][!]"}, {0x0f7264ba,524288,"Suzuki Alstare Extreme (E) (M6) [C][!]"}, {0x4be9b159,1048576,"Sweet Ange (J) [C][!]"}, {0x7041929d,1048576,"SWiNG (G) [C][!]"}, {0x44d30b7a,1048576,"SWIV (E) (M5) [C][!]"}, {0xc6fe4497,2097152,"Sylvania Family (J) [C][!]"}, {0xf82d391f,2097152,"Sylvania Family 2 (J) [C][!]"}, {0x698d7be4,1048576,"Sylvester and Tweety (E) (M3) [C][!]"}, {0x6bb3b0dc,1048576,"Sylvester and Tweety (E) (M6) [C][!]"}, {0xf09f92d7,1048576,"Tabaluga (G) [C][!]"}, {0x95310c8b,1048576,"Taisen Tsume Shogi (J) [C][!]"}, {0x725cf31c,2097152,"Tales of Phantasia - Narikiri Dungeon (J) [C][!]"}, {0x81fb43e1,1048576,"Tango! (J) [C][!]"}, {0x39d04581,2097152,"Tarzan (G) [C][!]"}, {0xf2005973,2097152,"Tarzan (J) [C][!]"}, {0x4224f930,2097152,"Tarzan (U) [C][!]"}, {0x0fd9fff0,1048576,"Taxi 2 (F) [C][!]"}, {0x683752a0,1048576,"Tazmanian Devil - Munching Madness (E) (M5) [C][!]"}, {0x3611d0d8,1048576,"Tazmanian Devil - Munching Madness (U) (M5) [C][!]"}, {0xc07ebe70,1048576,"Tech Deck Skateboarding (U) [C][!]"}, {0x8f16393f,2097152,"Telefang - Power Version (J) [C][!]"}, {0xfb528f66,2097152,"Telefang - Speed Version (J) [C][!]"}, {0xbb894ec7,2097152,"Test Drive 2001 (U) [C][!]"}, {0x2f179045,1048576,"Test Drive 6 (Coke 'Destinations Toutes Sensations') (F)[C][!]"}, {0x5ce00547,1048576,"Test Drive 6 (U) [C][!]"}, {0xe32bb06f,1048576,"Test Drive Cycles (U) [C][!]"}, {0xe6d6ac8f,1048576,"Test Drive Le Mans (U) [C][!]"}, {0x0fdd5b9e,1048576,"Test Drive Off-Road 3 (U) [C][!]"}, {0x69989152,524288,"Tetris DX (JU) [C][!]"}, {0x1cbea1aa,1048576,"Three Lions (U) (M7) [C][!]"}, {0x648e44b8,262144,"Thunder Blast Man (J) [C][!]"}, {0xb5bececf,2097152,"Thunderbirds (F) [C][!]"}, {0xa6dfb1d9,1048576,"Tiger Woods PGA Tour 2000 (U) [C][!]"}, {0xb2205d49,1048576,"TinTin - Le Temple du Soleil (E) (M3) [C][!]"}, {0x6832f38a,1048576,"TinTin in Tibet (E) (M7) [C][!]"}, {0x7aa371ed,1048576,"Tiny Toons - Buster Saves the Day (E) (M5) [C][!]"}, {0x800efb3d,1048576,"Tiny Toons - Buster Saves the Day (U) [C][!]"}, {0x5a0d41aa,1048576,"Tiny Toons - Dizzy's Candy Quest (E) (M6) [C][!]"}, {0x1972cbf7,1048576,"Titeuf (E) (M6) [C][!]"}, {0x2f9f19de,1048576,"Titus the Fox (E) [C][!]"}, {0x00a14d18,1048576,"TNN Outdoors Fishing Champ (U) [C][!]"}, {0xb509892b,1048576,"Toca Touring Car Championship (U) [C][!]"}, {0x0a0f9289,1048576,"Toki Tori (U) [C][!]"}, {0x4be4a8ed,4194304,"Tokimeki Culture (J) [C][!]"}, {0x78e14fa9,4194304,"Tokimeki Sport (J) [C][!]"}, {0x9139e307,1048576,"Tokoro San no Setagaya Country Club (J) [C][!]"}, {0x3e17d04a,1048576,"Tom & Jerry - Mouse Hunt (E) (M5) [C][!]"}, {0x5fc6bec0,1048576,"Tom & Jerry - Mouse Hunt (U) [C][!]"}, {0xb97c0bd9,1048576,"Tom & Jerry (U) [C][!]"}, {0x9d9c84f4,2097152,"Tom & Jerry in Mouse Attacks! (E) (M7) [C][!]"}, {0x38ce3f76,2097152,"Tom & Jerry in Mouse Attacks! (U) [C][!]"}, {0xe72f2683,1048576,"Tom Clancy's Rainbow Six (U) (M3) [C][!]"}, {0x02c1035a,4194304,"Tomb Raider - Curse of the Sword (U) [C][!]"}, {0x2988fc78,4194304,"Tomb Raider (E) (M5) [C][!]"}, {0x58590868,4194304,"Tomb Raider (UE) (M5) (Beta) [C][!]"}, {0xa8628f7a,1048576,"Tonic Trouble (E) (M6) [C][!]"}, {0xe108b2c2,1048576,"Tonka Raceway (E) [C][!]"}, {0xa5af4b28,1048576,"Tonka Raceway (U) [C][!]"}, {0x8d8bb5c4,1048576,"Tony Hawk's Pro Skater (U) [C][!]"}, {0x2c27c61f,2097152,"Tony Hawk's Pro Skater 2 (U) [C][!]"}, {0xfd5290a1,1048576,"Tony Hawk's Pro Skater 3 (U) [C][!]"}, {0x3d6b598c,1048576,"Toobin' (U) [C][!]"}, {0x6573b88f,1048576,"Toonsylvania (E) (M6) [C][!]"}, {0xebcca3da,1048576,"Top Gear Pocket (J) [C][!]"}, {0x84499fc1,1048576,"Top Gear Pocket (U) [C][!]"}, {0x1845f25a,1048576,"Top Gear Pocket 2 (J) (Kemco) [C][!]"}, {0xefb87f80,1048576,"Top Gear Pocket 2 (U) (Vadical) [C][!]"}, {0x337e5dd3,1048576,"Top Gear Rally (U) [C][!]"}, {0xdcc60117,1048576,"Top Gear Rally (U) [C][BF]"}, {0x017773cd,1048576,"Top Gear Rally 2 (E) [C][!]"}, {0x283cf13a,1048576,"Top Gun - Firestorm (U) (M6) [C][!]"}, {0xc25ee35a,1048576,"Total Soccer 2000 (E) (M6) [C][!]"}, {0x0aeae8fb,4194304,"Totsugeki! Papparatai (J) [C][!]"}, {0x19eb4516,1048576,"Tottoko Hum Taru (J) [C][!]"}, {0xf1fbcf84,2097152,"Tottoko Hum Taru 2 (J) [C][!]"}, {0x4a5f1e2b,131072,"Touch Boy System ROM (Unl) [C]"}, {0x7b9b2468,1048576,"Towers - Lord Baniff's Deceit (U) [C][!]"}, {0x47aecb95,1048576,"Toy Story 2 (U) [C][!]"}, {0xf660ed94,2097152,"Toy Story Racing (E) (M3) [C][!]"}, {0xd911dd97,2097152,"Toy Story Racing (U) [C][!]"}, {0x77f76ebc,1048576,"Track & Field GB (J) [C][!]"}, {0xbf33a212,1048576,"Track & Field GB (J) [C][f1]"}, {0x4c7258d9,1048576,"Treasure World (J) [C][!]"}, {0x31740097,1048576,"Trick Boarder (J) [C][!]"}, {0xe856dc3d,1048576,"Trick Boarder (U) [C][!]"}, {0x74e04c07,1048576,"Triple Play 2001 (U) [C][!]"}, {0x0bab7a61,2097152,"Tri-Zenon (J) [C][!]"}, {0x260eed04,524288,"Trouballs (U) [C][!]"}, {0x1be00a6e,2097152,"Turi Sensei 2 (J) [C][!]"}, {0x786b5ab4,1048576,"Turok - Rage Wars (E) (M4) [C][!]"}, {0xf095b446,1048576,"Turok 2 - Seeds of Evil (J) [C][!]"}, {0x6eda6a3a,1048576,"Turok 2 - Seeds of Evil (U) (M4) [C][!]"}, {0x6d48765e,1048576,"Turok 3 - Shadow of Oblivion (E) (M4) [C][!]"}, {0x2f2c418b,1048576,"Turok 3 - Shadow of Oblivion (E) (M5) [C][!]"}, {0x9306edd0,1048576,"Tweenies - Doodles' Bones (E) (M4) [C][!]"}, {0x147f427a,1048576,"Tweety - The World Goes Around (J) [C][!]"}, {0x7361d6bc,1048576,"Tweety's Highflying Adventures (E) (M3) [C][!]"}, {0xce55ed18,1048576,"Tweety's Highflying Adventures (F) [C][!]"}, {0xd6881014,1048576,"Tyco RC Racin' Ratz (U) [C][!]"}, {0x4b314d4b,1048576,"UEFA 2000 (E) (M6) [C][!]"}, {0xd5f036ce,1048576,"Ultimate Fighting Championship (U) [C][!]"}, {0x6dcfdfe2,1048576,"Ultimate Paintball (U) [C][!]"}, {0xe84df1f0,1048576,"Ultimate Surfing (U) [C][!]"}, {0x1766e558,524288,"Ultra 3D Pinball - Thrillride (U) [C][!]"}, {0x70760cce,1048576,"Uno (E) (M6) [C][!]"}, {0xf026d509,1048576,"Uno (U) [C][!]"}, {0xa80eeead,1048576,"Unpanma (J) [C][!]"}, {0x81b2bb8d,1048576,"Vegas Games (E) (M3) [C][!]"}, {0x40b5ea96,1048576,"Vegas Games (U) [C][!]"}, {0xd1a188dc,1048576,"Vigilante 8 (U) [C][!]"}, {0xdbdd6d85,1048576,"VIP (E) (M5) [C][!]"}, {0xda300c6c,1048576,"V-Rally - Championship Edition (E) (M3) [C][!]"}, {0x1312b3f7,1048576,"V-Rally - Championship Edition (E) (M4) [C][!]"}, {0xfab9d941,1048576,"V-Rally - Championship Edition (J) [C][!]"}, {0x947d45ae,4194304,"VS Lemmings (J) [C][!]"}, {0x37ea6093,1048576,"Wacky Races (E) (M6) [C][!]"}, {0x543abb1b,1048576,"Wacky Races (U) [C][!]"}, {0x56beb694,2097152,"Walt Disney World Quest - Magical Racing Tour (U) [C][!]"}, {0xe93f1582,1048576,"Warau Inu no Bouken (J) [C][!]"}, {0xb30fdbf5,2097152,"Warioland 2 (J) [C][!]"}, {0xa13017d4,2097152,"Warioland 2 (J) [C][f1]"}, {0x047bdf80,2097152,"Warioland 2 (U) [C][!]"}, {0x359c31c4,2097152,"Warioland 2 (U) [C][f1]"}, {0x480d0259,2097152,"Warioland 3 (J) (M2) [C][!]"}, {0xcfa0df0f,2097152,"Warlocked (U) [C][!]"}, {0xef9f5bea,1048576,"Warriors of Might and Magic (U) [C][!]"}, {0x9f8620d1,1048576,"WCW Mayhem (U) [C][!]"}, {0x2267360b,4194304,"Welcome to Pia Carrot 2.2 (J) [C][!]"}, {0x4ac6907b,1048576,"Wendy - Every Witch Way (U) [C][!]"}, {0x9cbfaa3d,1048576,"Wetrix GB (E) [C][!]"}, {0x6215c5b3,1048576,"Wetrix GB (J) [C][!]"}, {0x6830b7af,1048576,"Who Wants to Be a Millionaire - 2nd Edition (U) [C][!]"}, {0x0e1465cb,1048576,"Wild Thornberrys Rambler, The (U) [C][!]"}, {0x6d59104f,1048576,"Wings of Fury (E) (M3) [C][!]"}, {0xc94a413a,1048576,"Wings of Fury (U) [C][!]"}, {0x1db0840c,2097152,"Winnie the Pooh - Adventures in the 100 Acre Wood (E)(M7)[C][!]"}, {0x476ede93,2097152,"Winnie the Pooh - Adventures in the 100 Acre Wood (J) [C][!]"}, {0x066a2196,2097152,"Winnie the Pooh - Adventures in the 100 Acre Wood (U) [C][!]"}, {0x7adc90e1,1048576,"Wizardry Empire (V1.0) (J) [C][!]"}, {0xfa82620f,1048576,"Wizardry Empire (V1.1) (J) [C][!]"}, {0x1a10552b,1048576,"Wizardry Empire I - Fukkatsu no Tsue (J) [C][!]"}, {0xa99a33dc,1048576,"Wizardry I - Proving Grounds of the Mad Overlord (J) [C][!]"}, {0xdd727f1a,1048576,"Wizardry II - Legacy of Llylgamyn (J) [C][!]"}, {0xd44d3596,1048576,"Wizardry III - Knights of Diamonds (J) [C][!]"}, {0x2612f8c4,1048576,"Woody Woodpecker - Escape from Buzz Buzzard's Park (E) (M5) [C][!]"}, {0xbd2d1f8b,1048576,"Woody Woodpecker - Escape from Buzz Buzzard's Park (U) [C][!]"}, {0xf59daa99,1048576,"Woody Woodpecker no Go! Go! Racing (J) [C][!]"}, {0xb0f43498,1048576,"Woody Woodpecker Racing (U) [C][!]"}, {0x1a0bf4d7,1048576,"World Destruction League Thunder Tanks (U) [C][!]"}, {0x6775b29e,2097152,"World Soccer Gameboy 2000 (J) [C][!]"}, {0xdd18db5f,1048576,"World Soccer GB 2 (J) [C][!]"}, {0xcb04f34d,1048576,"Worms Armageddon (E) (M6) [C][!]"}, {0xd5fdf68a,1048576,"WWF Attitude (U) [C][!]"}, {0x05cb3b90,1048576,"WWF Attitude (U) [C][f1]"}, {0x6c28bcb5,1048576,"WWF Betrayal (U) [C][!]"}, {0xfcba12ae,1048576,"WWF Wrestlemania 2000 (U) [C][!]"}, {0xf0de3ce7,1048576,"Xena - Warrior Princess (U) [C][!]"}, {0x104968e7,4194304,"Xin Tiao Hui Yi (Chinese) (Unl) [C][!]"}, {0x8162adc1,1048576,"X-Men - Mutant Academy (J) [C][!]"}, {0xec6278a3,1048576,"X-Men - Mutant Academy (U) [C][!]"}, {0x921999e2,1048576,"X-Men - Mutant Wars (U) [C][!]"}, {0x12fc1a6e,1048576,"X-Men - Wolverine's Rage (U) [C][!]"}, {0x19828751,4194304,"Xtreme Sports (U) [C][!]"}, {0xe101246f,1048576,"Xtreme Wheels (E) [C][!]"}, {0x129465db,1048576,"Xtreme Wheels (U) [C][!]"}, {0xaa05daf1,2097152,"Yakochu (J) [C][!]"}, {0xd6a26444,1048576,"Yar's Revenge - The Quotile Ultimatum (U) [C][!]"}, {0x6314da32,1048576,"Yoda Stories (U) [C][!]"}, {0xf817e978,1048576,"Yogi Bear - Great Ballon Blast (U) [C][!]"}, {0x2a783280,2097152,"Yongzhe Dou Elong 1 & 2 (Unl) [C]"}, {0x1371e872,1048576,"Yu-Gi-Oh! - Capsule (J) [C][!]"}, {0xba7182c3,4194304,"Yu-Gi-Oh! - Dark Duel Stories II - Duel Monsters (J) [C][!]"}, {0x9f9dbab4,4194304,"Yu-Gi-Oh! - Dark Duel Stories III (J) [C][!]"}, {0x298bd054,4194304,"Yu-Gi-Oh! 4 - Johnouchi Deck (J) [C][!]"}, {0xa4d06001,4194304,"Yu-Gi-Oh! 4 - Kaiba Deck (J) [C][!]"}, {0x4d6105f6,4194304,"Yu-Gi-Oh! 4 - Yugi Deck (J) [C][!]"}, {0x692d6794,1048576,"Z - Miracle of the Zone 2, The (J) [C][!]"}, {0x3cc6b1f9,1048576,"Zebco Fishing (U) [C][!]"}, {0xe47308dd,2097152,"Zelda Shi Kong Zhi Zhang (Encrypted) (Unl) [C]"}, {0xe96dbfb5,1048576,"Zidane - Football Generation (E) (M5) [C][!]"}, {0x38d91885,1048576,"Zoboomafoo - Playtime In Zobooland (U) [C][!]"}, {0xf36c874d,2097152,"Zoids (J) [C][!]"}, {0xc09f9e1b,2097152,"Zok Zok Heroes (J) [C][!]"}, {0xfd73992d,65536,"Carillon Player & FX Hammer V1.0 - 7645HZ Sample Player (PD)[C]"}, {0xc7be299e,65536,"Donkey Kong (NES Conversion) (PD) [a1][C]"}, {0x45f19cec,787288,"Fire Demo (PD) (no emulator runs) [C]"}, {0x4598b4b4,1048576,"Barbie - Magic Genie (Chinese) [C][p1][!]"}, {0x3be86e8d,2097152,"Bokujo Monogatari GB 3 - Boy Meets Girl (Chinese) (Unl) [C]"}, {0x26ced667,1048576,"Last Bible 2 (Chinese) [C][p1][!]"}, {0x0a80b185,1048576,"Survival Kids (U) [C][p1][T-Chinese][!]"}, {0x7ded5c71,1048576,"Baby Felix Halloween (E) (M6) [C][!]"}, {0x885634e6,1048576,"Bakuhashi Senki Metal Walker - Kkoute no Yuujyou (Chinese) (Unl) [C]"}, {0xbc306ea4,2097152,"Bakuten Shoot Bey Blade (J) [C]"}, {0x12f0c196,1048576,"Catwomen (U) [C][!]"}, {0x20faa0d1,1048576,"Chibi Maruko Chan (J) [C]"}, {0x48e1ba7d,4194304,"Cross Hunter - Monster Hunter Version (J) [C][!]"}, {0x623c1516,4194304,"Cross Hunter - Treasure Hunter Version (J) [C][!]"}, {0x858010e0,4194304,"Cross Hunter - X Hunter Version (J) [C][!]"}, {0x2bb01aad,1048576,"Daikatana (J) [C][!]"}, {0xb31a59bf,2097152,"Dance Dance Revolution Disney Mix (J) [C][!]"}, {0xe338c118,2097152,"Dance Dance Revolution Ohasuta (J) [C][!]"}, {0x753bdce4,1048576,"David Beckham Soccer (E) (M5) [C][!]"}, {0xcabdd802,2097152,"Detective Conan 3 - Norowareta Kouro (J) [C][!]"}, {0x3a9602e8,1048576,"Die Monster AG (G) [C][!]"}, {0x63948092,2097152,"Digital Monsters 3 (Chinese) (Unl) [C][!]"}, {0xebe0ecd6,1048576,"Diva Starz - Mall Mania (U) [C][!]"}, {0x4685909b,4194304,"Donald Duck (U) (M5) [C][!]"}, {0x9dad6e23,2097152,"Dragon Ball Z - Guerreros de Leyenda (F) [C][!]"}, {0x01d31c9e,4194304,"Dragon Quest III (Chinese) (Unl) [C]"}, {0xbd651350,4194304,"Dragon Quest Monsters 2 - Ruka's Adventure (Chinese) (Unl) [C]"}, {0x42ceb854,4194304,"DT - Lords of Genomes (J) [C][!]"}, {0x086106de,1048576,"E.T. Escape From Planet Earth (U) [C][!]"}, {0x84872999,1048576,"E.T. The Extra Terrestrial Digital Companion (U) [C]"}, {0x54617416,2097152,"Estpolis Denki Yomigaeru Densetsu (J) [C][!]"}, {0xcc777b98,1048576,"Extreme Ghostbusters (E) (M6) [C][!]"}, {0xd6abc1f8,4194304,"Fish Files, The (E) [C]"}, {0xa7317bb8,4194304,"From TV Animation - One Piece - Maboroshi no Grand Line Boukenhen! (J) [C][!]"}, {0x30c26262,1048576,"Gameboy Wars 3 (J) [C][!]"}, {0xbcdf9d53,524288,"GPSboy (U) [C]"}, {0x78206460,2097152,"Gaiamaster Dual Card Attackers (J) [C][!]"}, {0x053bc315,1048576,"Gremlins (E) (M6) [C]"}, {0x469f0284,2097152,"Hana Yori Dango - Another Love Story (J) [C][!]"}, {0x8cabdca4,2097152,"Hero Hero Kun (J) [C][!]"}, {0x2da2686a,4194304,"Harry Potter and The Sorceror's Stone (J) [C][!]"}, {0x018eed29,1048576,"Hello Kitty and Dear Daniel Dream Adventure (J) [C][!]"}, {0x159fe5e7,4194304,"Hello Kitty No Happy House (J) [C][!]"}, {0x558f4631,2097152,"J. League Excite Stage Tactics (J) [C][!]"}, {0xd60e1c0a,4194304,"Jankyusei (J) [C][!]"}, {0x6d50772d,1048576,"JumpStart Dino Adventure (U) [C]"}, {0x380f19ed,2097152,"Konchu Hakase 3 (J) [C][!]"}, {0xc30d7e03,2097152,"Legend of Zelda, The - Link's Awakening DX (J) [C][p1][T-Chinese][!]"}, {0x06887a34,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.2) (U) [C][!]"}, {0x29e193c5,262144,"Loppi Puzzle Magazine - Hirameku 2 (J) [C][!]"}, {0x69db3cd8,1048576,"Mary-Kate & Ashley - Crush Course (U) [C][!]"}, {0xf8a6fee2,4194304,"Medarot 5 - Kabuto Version (J) [C]"}, {0x549c9287,4194304,"Medarot 5 - Kabuto Version (J) [C][a1]"}, {0xa6a7d206,4194304,"Medarot 5 - Kuwagata Version (J) [C][!]"}, {0x35fc5b32,4194304,"Mobile Golf (J) [C][!]"}, {0xac5e477d,1048576,"Naminori Yarou (J) [C][!]"}, {0x8c195f49,1048576,"Nations, The - Land of Legends (E) (M2) [C][!]"}, {0xd65c8ba1,2097152,"Network Adventure Bugsite -Alpha- (J)[C][!]"}, {0x56f52663,2097152,"Network Adventure Bugsite -Beta- (J)[C][!]"}, {0xfbb97680,2097152,"New Addams Family Series, The (E) [C]"}, {0xf770878b,1048576,"NSYNC Get to the Show (U) [C][!]"}, {0xa92dcb79,1048576,"Planet of the Apes (E) (M6) [C]"}, {0x4b2b8b57,2097152,"Pocket Monsters Crystal Glass (Chinese) (Unl) [C]"}, {0x313a1c13,2097152,"Pocket Monsters Crystal Glass (Chinese) (Unl) [C][a1]"}, {0x1bfb531e,1048576,"Pocket Music (E) (M5) [C][!]"}, {0x7cc884b4,524288,"Pocket Voice V2.0 Demo 3e (Unl) [C]"}, {0x443fef63,524288,"Pocket Voice V2.0 Demo 4e (Unl) [C]"}, {0xcbb8f4bd,1048576,"Pokemon Blue (Chinese) (Unl) [C]"}, {0xcee9c818,1048576,"Pokemon Red (Chinese) (Unl) [C]"}, {0x8505d139,2097152,"Pooh and Tigger's Hunny Safari (E) (M6) [C]"}, {0x622690da,2097152,"Pooh and Tigger's Hunny Safari (U) [C][!]"}, {0x250015d4,4194304,"Rayman 2 - The Great Escape (E) (M5) [C][!]"}, {0xd0204f10,1048576,"Ronaldo V.Soccer (E) (M4) [C][!]"}, {0x47636a2c,4194304,"Sakura Wars GB 2 (J) [C][!]"}, {0x44a9ddfb,1048576,"Samurai Kid (J) [C][!]"}, {0xa744df64,1048576,"Santa Claus Junior (U) [C][!]"}, {0x998657b7,1048576,"Scrabble (U) [C][!]"}, {0xef10272e,4194304,"Shaman King Tyoh Senji Ryakketu Funbari Hen (J) [C][!]"}, {0x5730393d,4194304,"Shaman King Tyoh Senji Ryakketu Meramera Hen (J) [C][!]"}, {0xe994b59b,4194304,"Shantae (U) [C][!]"}, {0xd088eefd,1048576,"Snoopy Tennis (J) [C][!]"}, {0x90379c16,4194304,"Super Gals Kotobukiran (J) [C][!]"}, {0xba70d28f,1048576,"Titus the Fox (U) [C][!]"}, {0x269f0852,4194304,"Tomb Raider (Chinese) (Unl) [C][!]"}, {0x717a5d19,4194304,"Tomb Raider 2 (Chinese) (Unl) [C][!]"}, {0x096d0c27,1048576,"Toonsylvania (U) [C][!]"}, {0x6f2cbd1d,2097152,"Tsuriiko!! (J) [C][!]"}, {0x283742e4,1048576,"Universal Studios Monsters - Crazy Vampire Dracula (U) [C][!]"}, {0x219e42e3,4194304,"Utyujin Tanaka Tarou de RPG Maker (J) [C][!]"}, {0xd893d58f,1048576,"Yu-Gi-Oh! - Capsule (Chinese) [C][p1]"}, {0x803a56ae,4194304,"Yu-Gi-Oh! - Dark Duel Stories (U) [C][!]"}, {0x530705a1,2097152,"Zoids Hakugin no Raiger Zero (J) [C][!]"}, {0xea3ac4c4,524288,"Work Master 2 DEMO (v.1.9) (Unl) [C]"}, {0xcf80fe7a,524288,"Work Master 2 DEMO (v.1.99) (Unl) [C]"}, {0x8f96b796,524288,"Friendly Pet Jurassic Park 3 (Chinese) (Unl) [C]"}, {0x2180d649,2097152,"Bokujo Monogatari GB 3 - Boy Meets Girl (Chinese) (Unl) [C][a1]"}, {0xb7508147,524288,"Pocket Voice V2.0 Demo 2c (Unl) [C]"}, {0x9536fb32,1048576,"Alfred's Adventure (E) (M5) [C][h1]"}, {0x725cc3ee,1048576,"Alfred's Adventure (E) (M5) [C][h2]"}, {0x9615be9f,1048576,"Backgammon (E) (M4) [C][h1]"}, {0x4c3ff259,524288,"Bust-a-Move 4 (UE) [C][h1] (mono hack)"}, {0xa82e2147,4194304,"Cannon Fodder (E) (M5) [C][h1]"}, {0xa3b430ad,4194304,"Cannon Fodder (E) (M5) [C][h1][t1]"}, {0x81b86364,2097152,"Carmageddon (U) (M4) [C][h1]"}, {0xdaa17e4f,1048576,"Checkmate (J) [C][h1]"}, {0x46bc2e14,1048576,"Checkmate (J) [C][h2] (Diff Colors and No Coordinates)"}, {0x851e6c0a,1048576,"Chessmaster, The (U) [C][h1]"}, {0xcadc33fe,1048576,"Chessmaster, The (U) [C][h2]"}, {0x8a109f81,1048576,"Chessmaster, The (U) [C][h3]"}, {0xffbd6003,1048576,"Chessmaster, The (U) [C][h4] (New Figures and Diff Options)"}, {0x4b196a6f,2097152,"Conker's Pocket Tales (U) (M3) [C][h1]"}, {0x69e01b94,1048576,"Croc 2 (U) [C][h1]"}, {0x0fa25e36,32768,"Dan Laser Demo (PD) [C][h1]"}, {0x28ca1690,1048576,"Denki Blocks (E) (M5) [C][h1]"}, {0xe8af77cc,1048576,"Denki Blocks (E) (M5) [C][h2] (Intro Removed)"}, {0xe4f72e45,4194304,"Donkey Kong Country (Mag Demo) (UE) (M5) [C][h1]"}, {0x678c2998,2097152,"Dragon Quest Monsters (J) [C][h1]"}, {0xcc043ee8,2097152,"Dragon Warrior Monsters (U) [C][h1]"}, {0xefb4d531,1048576,"Elevator Action EX (J) [C][h1]"}, {0xcb12299c,2097152,"Evel Knievel (E) (M7) [C][h1]"}, {0x642a1219,262144,"Full Time Soccer (E) [C][h1]"}, {0xffd919a7,1048576,"Gambare Nippon Olympic 2000 (J) [C][h1]"}, {0x3580a61d,524288,"GB Backup Station BIOS (U) [C][h1]"}, {0xfe228544,32768,"GB Pack V1.3 (EMP Hack V1.6) (PD) [C][h1]"}, {0x3b00818e,1048576,"Gex - Enter the Gecko (U) [C][h1]"}, {0x400cca44,4194304,"Grand Theft Auto (E) (M5) [C][h1]"}, {0xcea157d0,2097152,"Grand Theft Auto 2 (E) (M5) [C][h1]"}, {0x9f5246a0,1048576,"Guruguru Galakedaizu (J) [C][h1]"}, {0x30da8b51,1048576,"Hollywood Pinball (UE) (M4) [C][h1]"}, {0x4acdf314,1048576,"International Track & Field (U) [C][h1] (Enables German)"}, {0xbac18728,1048576,"Jimmy White's Cueball (E) [C][h1]"}, {0xd451c751,262144,"Karate Joe (E) [C][h1]"}, {0x937514f0,262144,"Karate Joe (E) [C][h2]"}, {0x7ad63279,262144,"Karate Joe (E) [C][h2][t1]"}, {0x4f2f12cf,1048576,"Last Bible (J) [C][h1]"}, {0x3c746580,1048576,"Legend of Zelda, The - Link's Awakening DX (U) [C][h-SGB]"}, {0x218b98c7,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.0) (J) [C][h1]"}, {0x7933bd37,2097152,"Legend of Zelda, The - Oracle of Ages (E) (M5) [C][h1] (GBA Version v0.3)"}, {0xc6928757,1048576,"Legend of Zelda, The - Oracle of Ages (J) [C][h1] (GBA Version V0.2)"}, {0x27f36a8e,1048576,"Legend of Zelda, The - Oracle of Ages (J) [C][h2] (GBA Version V0.3)"}, {0xa842ef65,1048576,"Legend of Zelda, The - Oracle of Ages (U) [C][h1] (GBA Version V0.2)"}, {0xefcc26f4,1048576,"Legend of Zelda, The - Oracle of Ages (U) [C][h2]"}, {0x2d812ff0,1048576,"Legend of Zelda, The - Oracle of Ages (U) [C][h3] (GBA Version V0.3)"}, {0xfbac4d9a,2097152,"Legend of Zelda, The - Oracle of Seasons (E) (M5) [C][h1] (GBA Version V0.3)"}, {0x9c966ff6,1048576,"Legend of Zelda, The - Oracle of Seasons (J) [C][h1] (GBA Version V0.2)"}, {0xf1a4b487,1048576,"Legend of Zelda, The - Oracle of Seasons (J) [C][h1] (GBA Version V0.3)"}, {0x2f9b3ee8,1048576,"Legend of Zelda, The - Oracle of Seasons (U) [C][h1] (GBA Version V0.2)"}, {0x6815f779,1048576,"Legend of Zelda, The - Oracle of Seasons (U) [C][h2]"}, {0xc26879a0,1048576,"Legend of Zelda, The - Oracle of Seasons (U) [C][h3] (GBA Version V0.3)"}, {0x781b242b,1048576,"LEGO Racers (E) (M10) [C][h1]"}, {0x81acfb80,1048576,"LEGO Stunt Rally (E) (M10) [C][h1]"}, {0xf1ea93bb,1048576,"Link Edition V1.0 (Pokemon Gelb) (G) [C][h1]"}, {0xd043cdee,1064960,"Lucky Luke - Desperado Train (E) (M6) [C][h1]"}, {0xfda878fc,1064960,"Lucky Luke - Desperado Train (E) (M6) [C][h1][t1]"}, {0xe0d465b6,1064960,"Lucky Luke - Desperado Train (E) (M6) [C][h1][t2]"}, {0x55921a06,1064960,"Lucky Luke - Desperado Train (E) (M6) [C][h2]"}, {0x0ea6a9e9,2097152,"Marvin Strikes Back (U) (M3) [C][h1]"}, {0xca5bd34b,4194304,"Metal Gear Solid (E) (M5) [C][h1]"}, {0x4908a1f5,2097152,"Monkey Puncher (E) [C][h1]"}, {0xcb3bbd15,2097152,"Moomin's Adventure (J) [C][h1]"}, {0x17beaf7c,1048576,"Mr. Driller (J) [C][h1]"}, {0x0b21662d,1048576,"Oak Vs Gio (V1.0) (Yellow hack) (U) [C][h1]"}, {0x3fa94d36,1048576,"Obelix (E) (M4) [C][h1]"}, {0xbfb266c6,1048576,"Ojarumaru (J) [C][h1]"}, {0x58fad706,262144,"Painter (E) [C][h1]"}, {0x3b9e6f54,262144,"Painter (E) [C][h2]"}, {0x11456408,262144,"Painter (E) [C][h2][t1]"}, {0x7b96b31e,32768,"Pattern Demo (PD) [C][h1]"}, {0xb290fa35,1048576,"Pikabomber v1.10 (Pocket Bomberman Hack) [C][h1]"}, {0x27491bea,1048576,"Pikamon Silver V1.5 (Pocket Mon. Silver) [C][h1]"}, {0x88975c3a,1048576,"Pikamon Silver V1.5 (Pocket Mon. Silver) [C][h1][T-Eng1.08_Vida]"}, {0xa9211df4,2097152,"Pikamon Silver v1.5 (Pokemon Silver Hack) [C][h1]"}, {0xc1a9a562,1048576,"Pocket Bomberman (U) [C][h1]"}, {0xffc70f81,2097152,"Pocket Monsters Gold (V1.0) (J) [C][h1]"}, {0x4462e6df,1048576,"Pocket Monsters Gold (V1.0) (J) [C][h2] (Sonic)"}, {0xe65672eb,1048576,"Pocket Monsters Pinball (J) [C][h1]"}, {0xc16b8d98,2097152,"Pocket Monsters Silver (V1.0) (J) [C][h1]"}, {0xb4dbe213,1048576,"Pocket Monsters Silver (V1.0) (J) [C][h2]"}, {0x270baff9,2097152,"Pokemon Crystal (U) [C][h1] (enable setting of time)"}, {0xdbadae5e,2097152,"Pokemon Dreamland v1.4 (Pokemon Gold Hack) [C][h1]"}, {0x16282679,1048576,"Pokemon Gelb (Yellow) (Font hack by Teralink) (G) [C][h1]"}, {0x85ba82b5,2097152,"Pokemon Gold (U) [C][h1] (Enable clock reset)"}, {0x0ace1c91,2097152,"Pokemon Puzzle Challenge (U) [C][h1]"}, {0x2f267222,1048576,"Pokemon Rocket Edition V1.0 (Gelb hack) (G) [C][h1]"}, {0xe191e8ae,1048576,"Pokemon Rocket Edition V1.0 (Yellow hack by Filb) (U) [C][h1]"}, {0xaa419c31,2097152,"Pokemon Silver (U) [C][h1] (Enable clock reset)"}, {0x6b875ae3,1048576,"Pokemon Trading Card Game (New Character hack) (U) [C][h1]"}, {0x3acadd26,1048576,"Pokemon Yellow (Link Edition V1.0 hack) (U) [C][h1]"}, {0x85d482e8,1048576,"Pokemon Yellow (New Chars & Story hack V1.2) (U) [C][h1]"}, {0x7a0fa30a,1048576,"Pokemon Yellow Upgrade V2.0 (Yellow hack) (U) [C][h1]"}, {0x536f1ddb,1048576,"Pokemon Z2 (V0.1) (Silver hack) (J) [C][h1]"}, {0xb2a3581d,1048576,"Pop 'N' Pop (E) [C][h1]"}, {0xdad6f6b4,1048576,"Power Quest (E) (M6) [C][h1]"}, {0xb053ab1f,1048576,"Qix Adventure (E) [C][h1]"}, {0x8a5fa98c,262144,"Race Time (E) [C][h1]"}, {0x85f7966c,1048576,"Robot Wars Metal Mayhem (E) (M6) [C][h1]"}, {0x716e695d,1048576,"Rockman X (J) [C][h1]"}, {0x9609aa88,1048576,"SD Hiryu Ex (J) [C][h1]"}, {0x28cdf5bc,32768,"SGB Pack (PD) [C][h1]"}, {0x33db5e78,1048576,"Shadowgate Classic (V1.0) (E) (M5) [C][h1]"}, {0xa171f894,131072,"Space Invasion (E) [C][h2][t1]"}, {0x36d1120b,131072,"Space Invasion (Rocket Games) (E) [C][h1]"}, {0xe620b13d,131072,"Space Invasion (Rocket Games) (E) [C][h2]"}, {0x66ae5972,1048576,"Street Fighter Alpha (E) [C][h1]"}, {0x17794020,1048576,"Super Chinese Fighter EX (J) [C][h1]"}, {0x50dae913,1048576,"Super Mario Bros. DX (J) [C][h1]"}, {0x17a95744,1048576,"Super Robot Wars Link Battler (J) [C][h1]"}, {0x128fc37f,1048576,"Super Robot Wars Link Battler (J) [C][h2]"}, {0x21aac06e,2097152,"Supercross Freestyle (E) (M5) [C][h1]"}, {0x36f5db1e,2097152,"Tarzan (U) [C][h1]"}, {0x3a9dba80,1048576,"Tom & Jerry - Mouse Hunt (E) (M5) [C][h1]"}, {0xd097dc17,524288,"Trouballs (U) [C][h1]"}, {0x9c8c73a6,524288,"Trouballs (U) [C][h2] (Intro Removed)"}, {0x3440ce0a,524288,"Trouballs (U) [C][h3] (Intro Removed)"}, {0xd8269843,524288,"Trouballs (U) [C][h4] (Intro Removed)"}, {0x47185e22,524288,"Turok 2 - Seeds of Evil (U) (M4) [C][h1]"}, {0x34348af7,1048576,"Vegas Games (U) [C][h1]"}, {0xbb816486,1048576,"Wizardry I - Proving Grounds of the Mad Overlord (J) [C][h1]"}, {0x683176b4,1048576,"Wizardry II - Legacy of Llylgamyn (J) [C][h1]"}, {0x4988d148,1048576,"Wizardry III - Knights of Diamonds (J) [C][h1]"}, {0xe759e002,1048576,"Woody Woodpecker Racing (U) [C][h1]"}, {0xe4ab2bed,2097152,"World Soccer Gameboy 2000 (J) [C][h1]"}, {0xb4ba03e6,1048576,"Xtreme Wheels (E) [C][h1]"}, {0xe0a06018,2097152,"Yakochu (J) [C][h1]"}, {0xb6438fd7,1048576,"Zopharmon Blue (Zophar's Domain 3rd Bday) [C][h1]"}, {0x986b5a67,1048576,"Zopharmon Red (Zophar's Domain 3rd Bday) [C][h1]"}, {0x91cfc037,2097152,"Pokemon Gold (U) [C][BF][h1] (Enable clock reset)"}, {0x70c57a3f,2097152,"Pokemon Silver (U) [C][BF][h1] (Enable clock reset)"}, {0xb769594f,1048576,"Bear in the Big Blue House (U) (M7) [C][h1]"}, {0x4efdb7f9,2097152,"Gex 3 - Deep Pocket Gecko (U) [C][h1]"}, {0x1003d58a,4194304,"Rayman 2 - The Great Escape (E) (M5) [C][h1]"}, {0x255fc765,1048576,"Pocket Monsters Silver (V1.0) (J) [C][h3]"}, {0x8525ec18,131072,"GB Backup Station BIOS (U) [C][o1]"}, {0xaf282efd,1048578,"Pocket Monsters Gold (V1.0) (J) [C][o1]"}, {0x8cdea8f6,1048578,"Pocket Monsters Gold (V1.0) (J) [C][o1][BF]"}, {0xcbcfb91e,1048578,"Pocket Monsters Silver (V1.0) (J) [C][o1]"}, {0x8728315f,1048578,"Pocket Monsters Silver (V1.0) (J) [C][o1][BF]"}, {0xa2cd9764,65536,"100000 Boys (LCP2000) (PD) [C]"}, {0x487b9c58,32768,"175 Sprite Parallax Starfield Demo (PD) [C]"}, {0x8f501a1a,32768,"2560 Colors Demo (PD) [C]"}, {0x7c19f4fa,32768,"2nd BNG Demo (Sonic&Knuckles) (PD) [C]"}, {0xfc141888,32768,"3D Wireframe Demo (PD) [C]"}, {0x2934f188,32768,"40x18 Wide Demo V1.1 (PD) [C]"}, {0x502d48fe,32768,"40x24 Text Demo by DarkFader (PD) [C]"}, {0x23f7b9cb,32768,"720 Simultaneous Sprites Demo (PD) [C]"}, {0x8bc9c589,262144,"7447 (Lik-Sang) (PD) [C]"}, {0xb95fc31d,32768,"99 Demo (PD) [C]"}, {0x908ada91,65536,"Abyss - Less is More Demo (PD) [C]"}, {0xdcc646a9,65536,"AGO Realtime Demo (LCP2000) (PD) [C]"}, {0xa7fed0f8,65536,"Alien Planet (Freedom GB Contest 2001 - 1st Place) (PD) [C]"}, {0x50139db7,32768,"All7 (PD) [C]"}, {0x754b6b6a,32768,"Alpha Wing (Bung) (PD) [C]"}, {0x4196f2cc,32768,"Amingo's Wild Journey (Bung V4) (PD) [C]"}, {0x2aa4f65b,32768,"Animal XXX1 (PD) [C]"}, {0x0e2de3f1,32768,"Animation Demo 1 (PD) [C]"}, {0xb11e129b,32768,"Animation Demo 2 (PD) [C]"}, {0x5971af91,32768,"APA Demo (PD) [C]"}, {0x8549b2f3,32768,"APA Demo 2 (PD) [C]"}, {0xc96d1124,262144,"Apache (Bung) (PD) [C]"}, {0xfb5d3e49,524288,"Aqueous Demo (PD) [C]"}, {0xba862b26,65536,"Arkanoid (Bung) (PD) [C]"}, {0x6555c0ae,524288,"artROM #1 v1.0 (PD) [C]"}, {0x58aae2c0,32768,"ATC - Air Traffic Control Simulation (PD) [C]"}, {0xd4255616,262144,"Back to Earth 3D (PD) [C]"}, {0x13a6b8a1,32768,"Backwards XXX (PD) [C]"}, {0x2b58263c,262144,"Ball (Bung) (PD) [C]"}, {0x143d5e83,131072,"Ballgame DX Demo (Oxyd clone) (Bung) (PD) [C]"}, {0xe2f861ab,131072,"Balloon Balloon (PD) [C]"}, {0xd0ba276d,32768,"Ballpark Title Screen (PD) [C]"}, {0xd861da6a,32768,"Beach (PD) [C]"}, {0x9ec16c24,524288,"Beauty Girls Volume 1 (Anna Kurnikova) (V1.0) (PD) [C]"}, {0x9162a9d3,524288,"Beauty Girls Volume 1 (Anna Kurnikova) (V1.01) (PD) [C]"}, {0x94ebcaa1,262144,"Berlin-Hotball-Paranoid Preview 1 by Aleksi Eeben (PD) [C]"}, {0x6a1aa843,262144,"Berlin-Hotball-Paranoid Preview 2 by Aleksi Eeben (PD) [C]"}, {0x7ecd9106,262144,"Berlin-Hotball-Paranoid Preview 3 by Aleksi Eeben (PD) [C]"}, {0xc182f337,262144,"Berlin-Hotball-Paranoid Preview 4 by Aleksi Eeben (PD) [C]"}, {0x5d5aa56e,262144,"Berlin-Hotball-Paranoid Preview 5 by Aleksi Eeben (PD) [C]"}, {0x662bceb6,32768,"Berzerk Legends (PD) [C]"}, {0xaccfd424,589824,"BHGOS - Overclocked Combo (PD) [C]"}, {0x03ce05d8,4194304,"BHGOS - Y2Kode Combo (PD) [C]"}, {0xd90d82fe,524288,"Binary Chaos (Y2kode) (PD) [C]"}, {0x5bafb998,1048576,"Bitte 8 Bit Demo by HITMEN (PD) [C]"}, {0xd3d8af78,32768,"BlackJack (PD) [C]"}, {0x0461e865,65536,"Blastah (Bung) (PD) [C]"}, {0x37e72667,65536,"Blastah (PD) [C]"}, {0xa50f364b,32768,"Blobz (Bung) (PD) [C]"}, {0x4d7c3acb,32768,"Block Badger (PD) [C]"}, {0x44ed44bd,32768,"BNG Demo (PD) [C]"}, {0x1e5d5ecc,32768,"Bomber (Bung V4) (PD) [C]"}, {0xd0735e9b,32768,"Boulder Dash (PD) [C]"}, {0x99ba49fe,32768,"Boulder Dash DX Demo (Bung) by DarkFader (PD) [C]"}, {0xc882cc27,32768,"Breakout (PD) [C]"}, {0x3eecf169,65536,"Breakout Demo (PD) [C]"}, {0xac8f3499,32768,"Brick Breaker DX (PD) [C]"}, {0x2a9abb39,32768,"Brickster (PD) [C]"}, {0x0d4185a4,131072,"Bubbles (PD) [C]"}, {0x9ff22917,32768,"Bump Demo (PD) [C]"}, {0xd099f9bb,131072,"Capman (Lik-Sang) (PD) [C]"}, {0xf8e2e81c,65536,"Carillion Demos - Chords (PD) [C]"}, {0x53994d0d,32768,"Carillion Demos - Fruitless (PD) [C]"}, {0x48b0098b,65536,"Carillion Demos - Oldschool (PD) [C]"}, {0x0228cc3e,65536,"Carillion Demos - Samplecheck (PD) [C]"}, {0xc5e6a678,32768,"Carillion Demos - Soundcheck (PD) [C]"}, {0xede371b6,32768,"Carillion Demos - Train (PD) [C]"}, {0x38b5a8fc,65536,"Carillon Editor V1.0 by Alexsi Eeben (PD) [C]"}, {0xefc67246,65536,"Carillon Editor V1.1 by Alexsi Eeben (PD) [C]"}, {0xa55838f4,65536,"Carillon Editor V1.2 by Alexsi Eeben (PD) [C]"}, {0xac71dbf7,65536,"Carillon Player & FX Hammer V1.0 - No Sample Player (PD) [C]"}, {0x615ff2de,16384,"Carillon Player V1.0 (16K) (PD) [C]"}, {0x7b2dbcf4,32768,"Carillon Player V1.0 (32K) (PD) [C]"}, {0x153dadbe,65536,"Carillon Player V1.2 (PD) [C]"}, {0x8b41235c,32768,"CARS (Bung V4) (PD) [C]"}, {0x16d5427d,524288,"Cat and Dog (PD) [C]"}, {0xd0fd44c4,65536,"Channel 49 - First Strike (Freedom GB Contest 2001) (PD) [C]"}, {0x70544978,32768,"Chaos89 by Charles Doty (PD) [C]"}, {0x5619fb89,32768,"Christmas Greetings (PD) [C]"}, {0xa3c0e143,131072,"Chuckie DX V0.33 (Y2kode) (PD) [C]"}, {0xdde733a6,32768,"Chunk Out (PD) [C]"}, {0x5e7b9287,32768,"Chunky World (Quang2000) (PD) [C]"}, {0x197b8075,32768,"Circuit Breaker (Bung) (PD) [C]"}, {0xea820c0f,32768,"Circular Canon (PD) [C]"}, {0xbda31b42,524288,"Clay Pidgeon Shooting by Jim Bagley (PD) [C]"}, {0x24678334,65536,"Clickomania by Ph0x (PD) [C]"}, {0xb6680c74,32768,"Clockworks (PD) [C]"}, {0xc75b03e3,65536,"CNCD Circle 1886 Demo (PD) [C]"}, {0xe25b2d0b,32768,"Code Demo (PD) [C]"}, {0x0338e1b4,65536,"Coffee Drop (Bung) (PD) [C]"}, {0x909a303a,32768,"Color Bar Demo (PD) [C]"}, {0xdd5bb56e,32768,"Color Fader Demo (1) (PD) [C]"}, {0xe59309b4,32768,"Color Fader Demo (2) (PD) [C]"}, {0x322e355c,131072,"Color Lines (Bung) (PD) [C]"}, {0x9d98c80e,32768,"Color Mines (Bung) (PD) [C]"}, {0xd5ef0014,32768,"Color Panel Demo (PD) [C]"}, {0xa1e8633f,32768,"Color Tuner V1.0 (PD) [C]"}, {0xae0ed2b7,32768,"Colors Demo (PD) [C]"}, {0x83f29781,32768,"COLumnOR Demo (PD) [C]"}, {0xf18f1f4f,65536,"Columns DX (PD) [C]"}, {0xca77bb38,65536,"Columns DX (PD) [C][a1]"}, {0x4fd9cf86,32768,"Combat Soccer (Bung) (PD) [C]"}, {0x79e16ba6,32768,"Consoleemul Christmas Greeting by Fagemul (PD) [C]"}, {0xb604d19d,32768,"Cosmic Attack (Bung V4) (PD) [C]"}, {0x9a300385,32768,"Cosmic Attack (Y2kode) (PD) [C]"}, {0xa2eeaa0b,32768,"Cowering Christmas Greeting by Fagemul (PD) [C]"}, {0x4906cfdf,131072,"Crazy Zone (1) (Bung) (PD) [C]"}, {0x55ebd26e,131072,"Crazy Zone (2) (Bung) (PD) [C]"}, {0xf004440c,262144,"Cube Raider by DarkFader (Bung) (PD) [C]"}, {0x445d2bd9,32768,"Cwan 4 (Checkers) (PD) [C]"}, {0x48fd4ce9,32768,"Cyber Squash (Freedom GB Contest 2001) (PD) [C]"}, {0xa1adc8bf,32768,"Cyberball (Bung) (PD) [C]"}, {0xc1de7488,32768,"Dark Intensions by DarkFader (Quang2000) (PD) [C]"}, {0x6b1525c4,32768,"Dark Soul Demo v0.1 (PD) [C]"}, {0xf9b47696,32768,"Darts 180 (PD) [C]"}, {0xbf55b3cc,16384,"DaVinci KB (PD) [C]"}, {0xc1f2435a,32768,"Deep Scan (PD) [C]"}, {0xfeb189b9,131072,"Defender of the Crown (PD) [C]"}, {0x8880acbc,131072,"Defender of the Crown (PD) [C][a1]"}, {0x4c30ef57,32768,"Demiforce Demo (PD) [C]"}, {0x1b65092f,32768,"Dick Demo (PD) [C]"}, {0xf329cff6,524288,"DigiBoy (PD) [C]"}, {0xcc16688f,262144,"DigiBoy (PD) [C][a1]"}, {0xfe4e98f8,524288,"DigiBoy (PD) [C][f1]"}, {0x12e36854,32768,"Digico Move (PD) [C]"}, {0x75c200d0,32768,"Dimension of Miracles (Quang2000) (PD) [C]"}, {0xb7ab9320,65536,"Dimensionless Sample (PD) [C]"}, {0xbf3b39b8,32768,"Doctor GB Menu (PD) [C]"}, {0x2b043e4a,32768,"Doctor GB Menu (PD) [C][a1]"}, {0xbe8c4320,32768,"Doctor GB Menu (PD) [C][a2]"}, {0xde912844,32768,"Doctor GB Menu V2.0 (PD) [C]"}, {0x83daaf64,32768,"Doctor GB Menu V2.0 (PD) [C][a1]"}, {0xc7b83b93,32768,"Doctor Sprite Demo (Bung) (PD) [C]"}, {0xafac8e13,90062,"Donkey Kong (NES Conversion) (PD) [C]"}, {0x7d982411,90072,"Donkey Kong 3 (NES Conversion) (PD) [C]"}, {0x92b12600,32768,"Dot Matrix Demo (Quang2000) (PD) [C]"}, {0x4ba5b7cf,32768,"Double Vision Demo (PD) [C]"}, {0x3627c5ba,131072,"Downward Spiral, The (Bung) (PD) [C]"}, {0x3c8117de,32768,"Dragonball Z Tetris Demo (PD) [C]"}, {0x48106fae,32768,"Dragon's Lair - Title Screen (PD) [C]"}, {0xbcd638a1,262144,"Drains (Lik-Sang) (PD) [C]"}, {0xa3bf876a,262144,"Drains (Lik-Sang) (Rev 2) (PD) [C]"}, {0xe90395e7,32768,"Draw V1.03 by JK (PD) [C]"}, {0x10b83264,131072,"Drunken Pooper (Y2kode) (PD) [C]"}, {0x3a576777,1048576,"Drymouth (Lik-Sang) (Y2kode) (PD) [C]"}, {0x060e74a8,32768,"Duel, The (Bung) (PD) [C]"}, {0xf113181f,32768,"Duux (Bung) (PD) [C]"}, {0x78bbf938,32768,"Dynamite!! (Quang2000) (PD) [C]"}, {0x6ba625d2,65536,"Egg Racer (Lik-Sang) (PD) [C]"}, {0xb023c11c,32768,"EMS Multi-ROM Menu V1.0 (PD) [C]"}, {0x0b15df0d,32768,"EMS Multi-ROM Menu V1.1 (PD) [C]"}, {0x371508a8,32768,"EMS Multi-ROM Menu V1.2 (PD) [C]"}, {0x69e4105a,32768,"Enlightenment BA1 Demo (PD) [C]"}, {0x55907773,32768,"Eskupelota (Bung V4) (PD) [C]"}, {0xb38c2585,32768,"Fall Down (Bung) (PD) [C]"}, {0x85aed8c2,65536,"Fatlicks Lardstyle (Bung) (PD) [C]"}, {0x4f322281,65536,"FC Emulator for GameBoy V0.00 by Kami (PD) [C]"}, {0xb15d97d7,65536,"FC Emulator for GameBoy V0.02 by Kami (PD) [C]"}, {0xeb0d8b50,65536,"FC Emulator for GameBoy V0.01 by Kami (PD) [C]"}, {0x65c5baad,32768,"Feel It XXX (PD) [C]"}, {0xaa292992,524288,"FGB-Demo v2.10 (PD) [C]"}, {0xc551b678,131072,"FGB-Demo vx.xx (PD) [C]"}, {0x254ca608,524288,"Final Blade by Aaron Pendley and Sam Gage (Y2kode) (PD) [C]"}, {0x80822f84,32768,"Fire Demo 1 (PD) [C]"}, {0xa94c050a,32768,"Fire Demo 2 (PD) [C]"}, {0x16c4ebd8,32769,"Fire Demo 3 (PD) [C]"}, {0x82d59ad8,32768,"Fire Demo 4 (PD) [C]"}, {0xd3de5b76,32768,"Fire Demo 5 (PD) [C]"}, {0x123b8216,65536,"Fire Gear (Bung) (PD) [C]"}, {0x40fd0005,65536,"Fire Gear (Bung) (PD) [C][a1]"}, {0x4fa93d9f,32768,"Fire Routine Example (PD) [C]"}, {0xf2b2ec57,65536,"Fli-Plasma (PD) [C]"}, {0x5bbdd058,32768,"Flood (PD) [C]"}, {0xc0d3881f,32768,"Fogen and Budfreak Made Me Do It (PD) [C]"}, {0x7b94f983,32768,"Font Demo (Jonathan Waugh) (PD) [C]"}, {0xddcd0b1b,32768,"Forgot Slip XXX (PD) [C]"}, {0x728dc814,32768,"Forward XXX (PD) [C]"}, {0xde9a099c,32768,"FREEART Intro V0.1 (PD) [C]"}, {0xc2545485,32768,"FREEART Intro V1 (PD) [C]"}, {0x48792bb7,32768,"FREEART Intro V2 (PD) [C]"}, {0x42258961,262144,"FREEART Intro V3 (PD) [C]"}, {0xc960e092,65536,"French D64 Demo (PD) [C]"}, {0xf2f408d7,65536,"Friki Race (Bung) (PD) [C]"}, {0x332f687d,65536,"Friki Race (Bung) (PD) [C][a1]"}, {0x6e67bb95,262144,"Frode (Bung) (PD) [C]"}, {0xc2a791c2,65536,"Frogs (PD) [C]"}, {0xfd442b7b,32768,"Frox by Flavour (PD) [C]"}, {0x4c619c49,32768,"Fruit Spin V1.0 (PD) [C]"}, {0x34ff080f,262144,"FX Shooter G - MiniRPG2 Story (Y2kode) (PD) [C]"}, {0x6987d1cf,32768,"Galaxy (PD) [C]"}, {0xe48f525b,32768,"Gameboy 3D Filled Demo (PD) [C]"}, {0x70aad957,32768,"Gameboy 3D Line Draw Demo (PD) [C]"}, {0x69b73a7b,32768,"Gameboy Asteroid - Treasure Hunt (Bung V4) (PD) [C]"}, {0x89dab13b,65536,"Bajki i Przypowiesci by Ignacy Krasicki (Polish) (PD) [C]"}, {0x35302f41,65536,"Dziady Czesc II by Adam Mickiewicz (Polish) (PD) [C]"}, {0xf3857477,2097152,"Dzieci kapitana Granta by Juliusz Verne (Polish) (PD) [C]"}, {0x9c1f652e,524288,"Faraon tom 1 by Boleslaw Prus (Polish) (PD) [C]"}, {0xc5c11f43,1048576,"Faraon tom 2 by Boleslaw Prus (Polish) (PD) [C]"}, {0xe08a6b0f,524288,"Faraon tom 3 by Boleslaw Prus (Polish) (PD) [C]"}, {0xddcc0aaa,262144,"Hamlet by William Shakespeare (Polish) (PD) [C]"}, {0x53680497,1048576,"Hobbit, The by J.R.R. Tolkien (Polish) (PD) [C]"}, {0xc56e9afd,1048576,"Kariera Nikodema Dyzmy by Tadeusz Dolega Mostowicz (Polish) (PD) [C]"}, {0x5010f829,131072,"Konstytucja Rzeczpospolitej Polskiej by Sejm III RP (Polish) (PD) [C]"}, {0x92c76263,262144,"Kronika Polska by Anonim Tak Zwany Gall (Polish) (PD) [C]"}, {0xc33b5ffc,1048576,"Krzyzacy tom 1 by Henryk Sienkiewicz (Polish) (PD) [C]"}, {0xe898059e,1048576,"Krzyzacy tom 2 by Henryk Sienkiewicz (Polish) (PD) [C]"}, {0x9bc49c49,1048576,"Lalka tom 1 by Boleslaw Prus (Polish) (PD) [C]"}, {0x2314476b,1048576,"Lalka tom 2 by Boleslaw Prus (Polish) (PD) [C]"}, {0x1b68c366,131072,"Legendy Warszawskie by Artur Oppan (Polish) (PD) [C]"}, {0x5cb4fe2e,1048576,"Ludzie Bezdomni by Stefan Zeromski (Polish) (PD) [C]"}, {0xb7777427,262144,"Magiczne przygody Kubusia Puchatka (Polish) (PD) [C]"}, {0xfc7506de,131072,"Macbeth by William Shakespeare (Polish) (PD) [C]"}, {0x953f92d0,524288,"Mikolaja Doswiadczynskiego Przypadki by Ignacy Krasicki (Polish) (PD) [C]"}, {0x6c5eb8a2,1048576,"Ogniem i Mieczem tom I Powiesc by Henryk Sienkiewicz (Polish) (PD) [C][a1]"}, {0x878fa289,1048576,"Ogniem i Mieczem tom II Powiesc by Henryk Sienkiewicz (Polish) (PD) [C][a1]"}, {0x222fe5c1,262144,"Opowiadania by Edgar Alan Poe (Polish) (PD) [C]"}, {0xfa789c28,262144,"Opowiesc Wigilijna by Charles Dickens (Polish) (PD) [C]"}, {0xb55c3005,262144,"Othello by William Shakespeare (Polish) (PD) [C]"}, {0x15d94a26,524288,"Pan Tadeusz by Adam Mickiewicz (Polish) (PD) [C]"}, {0xc09b0c3a,2097152,"Pan Wolodyjowski by Henryk Sienkiewicz (Polish) (PD) [C]"}, {0x28c619f4,1048576,"Podroze Gulliwera by Jonathan Swift (Polish) (PD) [C]"}, {0x48fd038d,1048576,"Przedwiosnie by Stefan Zeromski (Polish) (PD) [C]"}, {0x26099866,1048576,"Przygody Hucka by Mark Twain (Polish) (PD) [C]"}, {0x23f19092,524288,"Przypadki Robinsona Kruzoe by Daniel Defoe (Polish) (PD) [C]"}, {0xfa044e4a,2097152,"Quo Vadis by Henryk Sienkiewicz (Polish) (PD) [C]"}, {0x7f684914,262144,"Romeo & Juliet by William Shakespeare (Polish) (PD) [C]"}, {0x8ad1d581,131072,"Skapiec by Moliere (Polish) (PD) [C]"}, {0x0b9275ff,262144,"Studium w Szkarlacie by Arthur Conan Doyle (Polish) (PD) [C]"}, {0xf5a92402,131072,"Swietoszek by Moliere (Polish) (PD) [C]"}, {0xbb59707c,1048576,"W Pustyni i W Puszczy by Henryk Sienkiewicz (Polish) (PD) [C]"}, {0x28b30c3e,524288,"Wampir by Wladyslaw Stanislaw Reymont (Polish) (PD) [C]"}, {0xea1cd207,262144,"Wesele by Stanislaw Wyspianski (Polish) (PD) [C]"}, {0xe57243eb,131072,"Zemsta by Alexsander Fredro (Polish) (PD) [C]"}, {0xff5cd142,1048576,"Znachor by Tadeusz Dolega Mostowicz (Polish) (PD) [C]"}, {0xb58e7707,131072,"Znikniecie Mlodego Lorda by Arthur Conan Doyle (Polish) (PD) [C]"}, {0xb63fde7c,262144,"Zywot Czlowieka Poczciwego by Mikolaj Rej (Polish) (PD) [C]"}, {0x1b7fe1e9,1048576,"Robinson Crusoe by Daniel Defoe (V1.3) (PD) [C]"}, {0xe8f1a2f8,32768,"Gameboy Book Reader V1.3 (PD) [C]"}, {0x57da4012,1048576,"Robinson Crusoe by Daniel Defoe (V1.4) (PD) [C]"}, {0x6a50558e,262144,"Time Machine, The (V1.4) (PD) [C]"}, {0x9de8173b,262144,"Time Machine, The (V1.4) (PD) [C][a1]"}, {0x65a00e03,524288,"Underground City, The by Jules Verne (V1.4) (PD) [C]"}, {0xdc62715a,32768,"Why He Was Whipped by Mrs Amy Terese Powelson (V1.4) (PD) [C]"}, {0x44fbb42c,1048576,"Robinson Crusoe by Daniel Defoe (V1.5) (PD) [C]"}, {0xc7f23e79,32768,"Why He Was Whipped by Mrs Amy Terese Powelson (V1.5) (PD) [C]"}, {0xefc8422f,1048576,"Lolita by Vladimir Nobokov (V1.6) (PD) [C]"}, {0x5bda7b51,524288,"Markurells i WadKoping by Hjalmar Bergman (V1.6) (Polish) (PD) [C]"}, {0xfe2dffd5,1048576,"Robinson Crusoe by Daniel Defoe (V1.6) (PD) [C]"}, {0x4acf8870,262144,"39 Steps, The by John Buchan (V1.6) (PD) [C]"}, {0x30840a39,524288,"Lost World, The by Sir Arthur Conan Doyle (V1.6) (PD) [C]"}, {0x2c026bdb,131072,"Theatre of Cruelty by Terry Pratchett (V1.6) (PD) [C]"}, {0xdabac518,1048576,"Robinson Crusoe by Daniel Defoe (V2.0) (PD) [C]"}, {0x84de3f6a,32768,"Why He Was Whipped by Mrs Amy Terese Powelson (V2.0) (PD) [C]"}, {0xfb8d635b,1048576,"Robinson Crusoe by Daniel Defoe (V2.3) (PD) [C]"}, {0x7a3c4263,65536,"Suddshwer (Korean) (V2.3) (PD) [C]"}, {0x9e4dba6a,524288,"Underground City, The by Jules Verne (V2.3) (PD) [C]"}, {0x91a73e40,65536,"Why He Was Whipped by Mrs Amy Terese Powelson (V2.3) (PD) [C]"}, {0x49a8d9bd,1048576,"Robinson Crusoe by Daniel Defoe (V2.3b) (PD) [C]"}, {0x4b3224b2,65536,"Suddshwer (Korean) (V2.3b) (PD) [C]"}, {0x947815cb,65536,"Why He Was Whipped by Mrs Amy Terese Powelson (V2.3b) (PD) [C]"}, {0x26b77e61,32768,"Gameboy Book Reader V3.0 (PD) [C]"}, {0xe3fa5a64,32768,"Gameboy Demo (PD) [C]"}, {0x58f9df1c,65536,"Gameboy Palette Changing Example - V1 (PD) [C]"}, {0x5f856a22,65536,"Gameboy Print to Screen Library V2.0 by Shen Mansell (PD) [C]"}, {0x46218b26,65536,"Gameboy Tile Loading Example - V1 (PD) [C]"}, {0x737f2c28,131072,"Garpster's Archaic Rooms of Paranoia (Bung) (PD) [C]"}, {0x07aca1c2,32768,"GAS Demo 1 (PD) [C]"}, {0x0ed93c0c,32768,"Gay Sex0rs (18+ Only) (PD) [C]"}, {0xdf840450,32768,"GB Basic (Royal Davinci version) (PD) [C]"}, {0x17b1285b,32768,"GB Basic V2.00 (PD) [C]"}, {0x6692fd14,32768,"GB Basic V2.10 (PD) [C]"}, {0x1a7832ae,32768,"GB Cart Mag-E-Zine Vol 1 Issue 1 October 2nd, 2000 (PD) [C]"}, {0x291d001a,32768,"GB Cart Mag-E-Zine Vol 1 Issue 2 November 3rd, 2000 (PD) [C]"}, {0xf6d47de3,131072,"GB Flyer (Lik-Sang) (PD) [C]"}, {0x247a915b,131072,"GB Hi-Colour Demo (PD) [C]"}, {0x32d90a27,32768,"GB Hi-Colour Demo 2 (PD) [C]"}, {0xc44d04d0,32768,"GB Lander V0.02 (PD) [C]"}, {0x31822b24,32768,"GB Pack V1.0 (PD) [C]"}, {0xf0f90407,32768,"GB Pack V1.1 (PD) [C]"}, {0x08d12870,32768,"GB Pack V1.2 (PD) [C]"}, {0x22246b90,32768,"GB Pack V1.3 (PD) [C]"}, {0x7bbc50d2,32768,"GB Pack Vx.x (16Mbit) (PD) [C][a1]"}, {0xb7be6e4a,65536,"GB Remote (PD) [C]"}, {0xf6a4cb13,32768,"GB Sound Manipulator V1.00 (PD) [C]"}, {0x475a6933,32768,"GB Sound Manipulator V1.01 (PD) [C]"}, {0xd82dc27a,65536,"GBC Checkerboard Demo (PD) [C]"}, {0xc8627a52,524288,"GBC Intro Collection (PD) [C]"}, {0x5889c2f5,131072,"GBC vs NGPC Movie (PD) [C]"}, {0x4c6a82e3,524288,"GBC XXX Number 1 (PD) [C]"}, {0x89c87c70,524288,"GBC XXX Number 2 (PD) [C]"}, {0xfed81417,524288,"GBC XXX Number 3 (PD) [C]"}, {0x42d46f16,32768,"GBC2GBA Gamepack V3.0 GBA (PD) [C]"}, {0x92910ad6,32768,"GBC-Link (PD) [C]"}, {0xf2af76a3,65536,"GBDK Code Examples - Bunglogo (PD) [C]"}, {0x3a13e70f,65536,"GBDK Code Examples - Hiscore (PD) [C]"}, {0xff48b461,65536,"GBDK Code Examples - Println (PD) [C]"}, {0x44a60b50,65536,"GBDK Code Examples - Savepic (PD) [C]"}, {0xdb3c1b2f,32768,"GB-FLIP Beta (Bung) (PD) [C]"}, {0x7eeb78e6,32768,"GB-FLIP Beta (Bung) (PD) [C][a1]"}, {0xb1fa5ceb,32768,"GB-FLIP Demo (Bung) (PD) [C]"}, {0x041ec976,524288,"GB-PDA V3.0 (PD) [C]"}, {0xceb47905,524288,"GB-PDA V4.0 (06-16-1999) (PD) [C]"}, {0x9724cfec,524288,"GB-PDA V4.0 (06-28-1999) (PD) [C]"}, {0xeb91b08b,524288,"GB-PDA V4.1 (01-14-2000) (PD) [C]"}, {0x2f5a0761,524288,"GB-PDA V4.1 (01-28-2000) (PD) [C]"}, {0x83589ae9,32768,"GBS Player V1.02 - Blades of Steel (PD) [C]"}, {0x5f3e659c,65536,"GBS Player V1.02 - Commander Keen (PD) [C]"}, {0xc9371a75,131072,"GBS Player V1.02 - Legend of Zelda - Oracle of Ages (PD) [C]"}, {0xf196e724,131072,"GBS Player V1.02 - Legend of Zelda - Oracle of Season (PD) [C]"}, {0x3d750a16,131072,"GBS Player V1.02 - Mario Tennis (PD) [C]"}, {0x7613b32a,131072,"GBS Player V1.02 - Metal Gear Solid (PD) [C]"}, {0x9b148375,32768,"GBS Player V1.02 - Tiny Toon Adventures - Wacky Sport (PD) [C]"}, {0x1eaf1dac,32768,"Genetic (PD) [C]"}, {0xd0fc7eff,32768,"GHX Example Sample (PD) [C]"}, {0xefe20bde,32768,"GHX Music - Melodic (PD) [C]"}, {0x17c06b1f,32768,"GHX Music - Near end (PD) [C]"}, {0xd2546da5,32768,"GHX Music - Walkabout (PD) [C]"}, {0x64483e84,32768,"GHX Music - Wonders (PD) [C]"}, {0x0fe5c6cd,32768,"GHX Walkabout (PD) [C]"}, {0x6a47fc01,32768,"Glowing Ember (PD) [C]"}, {0x14e79342,32768,"God Save The Queen (PD) [C]"}, {0xfe410123,32768,"Going In XXX (PD) [C]"}, {0x6b461455,32768,"Good Direction XXX (PD) [C]"}, {0x5aded71b,262144,"Graal V1.1 Adventure Demo (PD) [C]"}, {0x7c796b2a,2097152,"Gran Turismo 2 (PD) [C]"}, {0x461032e8,65536,"Grand Bleu, Le (Freedom GB Contest 2001) (PD) [C]"}, {0x2ed509d9,65536,"Green Beret (PD) [C]"}, {0x5ec58aaf,32768,"Greeting Card Demo 1 (PD) [C]"}, {0xa29d0c6e,32768,"Greeting Card Demo 2 (PD) [C]"}, {0x3113e172,524288,"Guess The Number 3 (PD) [C]"}, {0xe5ec31a5,65536,"Gunpey (PD) [C]"}, {0xb6ee732a,1048576,"Helitac Demo (PD) [C]"}, {0x133fca93,1048576,"Helitac V0.01 (PD) [C]"}, {0x83cc85f4,32768,"Hello World (PD) [C]"}, {0x965e17bf,32768,"Hello World Splash Demo (PD) [C]"}, {0x5cbf4042,32768,"Hentai for Color Demo (PD) [C]"}, {0x92d4c6ec,32768,"Hentai for Color Demo (PD) [C][a2]"}, {0x371495d2,32768,"Hentai for Color Demo (PD) [C][a3]"}, {0x570e49c4,32768,"Hentai for Color Demo (PD) [C][a1]"}, {0x048243e6,131072,"Hi-Color Demo (PD) [C]"}, {0x735b4ad6,262144,"Hi-Color Demo 2 (PD) [C]"}, {0x03aeb63d,65536,"Hi-Color Demo 3 (PD) [C]"}, {0xcb50d8bd,131072,"Hi-Color Demo 4 (PD) [C]"}, {0x7c5955ba,32768,"Hi-Color Demo 5 (PD) [C]"}, {0xf71aba8a,65536,"High Score Routines V2 by Shen Mansell (PD) [C]"}, {0x8ac67ed0,32768,"HighNoon (PD) [C]"}, {0xb3852cd0,32768,"Holiday Greetings (Bung) (PD) [C]"}, {0x221b0ab6,131072,"Horrible Demon 2, The (Lik-Sang) (PD) [C]"}, {0xf7218a94,262144,"Horrible Demon 3, The (Bung V4) (PD) [C]"}, {0x0ab36333,262144,"Horrible Demon 4, The (Freedom GB Contest 2001 - Grand Prize) (PD) [C]"}, {0x79ef1a66,32768,"Horse Race (PD) [C]"}, {0xfd48e218,32768,"Huelsi (Alpha 8) (PD) [C]"}, {0x04119342,32768,"Huelsi (Bung) (PD) [C]"}, {0xab39fc0f,32768,"Huelsi (PD) [C]"}, {0x69cca42b,524288,"Hungry are the Dead - Demo 3 by Berserker Industries (PD) [C]"}, {0x03f2f2b0,131072,"Hungry are the Dead (Bung) (PD) [C]"}, {0xce0e75f2,131072,"Hungry are the Dead (PD) [C]"}, {0x3e5be6bb,65536,"I Guardian (PD) [C]"}, {0x0940c051,32768,"IBM IR Keyboard (PD) [C]"}, {0xa1c9a4f7,65536,"Infinite BOBS Demo (PD) [C]"}, {0x83c3e427,65536,"Infinite BOBS Demo (PD) [C][a1]"}, {0x82818c1e,262144,"Infocom - BALLYHOO (PD) [C]"}, {0x2476a2a4,131072,"Infocom - Cutthroats (PD) [C]"}, {0xd513f2fe,131072,"Infocom - Deadline (PD) [C]"}, {0x67b9a83b,131072,"Infocom - Enchanter (PD) [C]"}, {0xd6f3955b,131072,"Infocom - Enchanter 2 - Sorcerer (PD) [C]"}, {0x6ab59ad2,131072,"Infocom - Hitchiker's Guide to the Galaxy, The (PD) [C]"}, {0x18206c25,131072,"Infocom - Hollywood Hijinx (PD) [C]"}, {0x59c1b06e,131072,"Infocom - Infidel (PD) [C]"}, {0xd163650d,262144,"Infocom - Leather Goddesses of Phobos, The (PD) [C]"}, {0x865930c2,262144,"Infocom - Lurking Horror, The (PD) [C]"}, {0x3fed8f80,262144,"Infocom - Moonmist (PD) [C]"}, {0x6750f818,131072,"Infocom - Planetfall (PD) [C]"}, {0x9dffb06d,262144,"Infocom - Plundered Hearts (PD) [C]"}, {0xcb33a052,131072,"Infocom - Seastalker (PD) [C]"}, {0x978af406,262144,"Infocom - Spellbreaker (Enchanter 3) (PD) [C]"}, {0xd9fbbbf9,131072,"Infocom - Starcross (PD) [C]"}, {0xa75d493e,262144,"Infocom - Stationfall (PD) [C]"}, {0x33f6b667,131072,"Infocom - Suspect (PD) [C]"}, {0x843f5956,131072,"Infocom - Suspended (PD) [C]"}, {0x36b5bb07,262144,"Infocom - Wishbringer (PD) [C]"}, {0xea6d3cdf,131072,"Infocom - Witness, The (PD) [C]"}, {0x932ccb0a,131072,"Infocom - Zork I - The Great Underground Empire (PD) [C]"}, {0x162e3e9e,131072,"Infocom - Zork II - The Wizard of Frobozz (PD) [C]"}, {0x94026713,131072,"Infocom - Zork III - The Dungeon Master (PD) [C]"}, {0x1b7e60dd,32768,"Infra-Read Demo (PD) [C]"}, {0x50128c1f,32768,"Infrared Investigator by Ken Kaarvik (PD) [C]"}, {0xfd096905,32768,"In-Game Rumble Demo (PD) [C]"}, {0x87f0bb59,65536,"Invasion DX (Bung) (PD) [C]"}, {0xcd765690,65536,"Invasion DX (Bung) (PD) [C][a1]"}, {0x8dfa2d66,65536,"Invasion DX (Lik-Sang) (PD) [C]"}, {0xf415fb4b,32768,"IR 0604 Controller (PD) [C]"}, {0x22a891ee,262144,"Iron Hike (Bung) (PD) [C]"}, {0x4eb3576c,65536,"IR-Viewer (PD) [C]"}, {0xdfd7af9c,32768,"Issac's First GB Demo (Quang2000) (PD) [C]"}, {0xb7590216,262144,"Jet Set Willy (Bung) (PD) [C]"}, {0xa17e25ce,65536,"Jet Set Willy V2 (Beta 2) (PD) [C]"}, {0xbee5ea3a,65536,"Jet Set Willy V2 (Beta 4) (PD) [C]"}, {0x36a93636,131072,"JetPak DX (Bung) (PD) [C]"}, {0x7bd323e5,131072,"JetPak DX (Bung) (PD) [C][a1]"}, {0xb16d6847,131072,"JetPak DX (PD) [C]"}, {0x879efab2,32768,"JetPak DX V0.05 (PD) [C]"}, {0x183c43a3,32768,"JetPak DX V0.05s (PD) [C]"}, {0xcab120df,32768,"JetPak DX V0.06 (PD) [C]"}, {0x68c7c116,32768,"JetPak DX V0.08 (PD) [C]"}, {0x4a6acade,524288,"Jewel Thief (PD) [C]"}, {0x06adaadb,32768,"Joshua Wise's Demo (Quang2000) (PD) [C]"}, {0xffe6edaa,65536,"Jumpik (Bung V4) (PD) [C]"}, {0x75c8ddf6,32768,"Jumping Jack Color (PD) [C]"}, {0x8df82284,65536,"Jumpman '86 (HimmelHopp) Demo by Par Johannesson (PD) [C]"}, {0x1accf367,65536,"Jumpman '86 (HimmelHopp) Demo by Par Johannesson (PD) [C][a1]"}, {0x46a647c1,131072,"Jumpman '86 by Par Johannesson (PD) [C]"}, {0x313c486a,65536,"Jumpman '86 by Par Johannesson (PD) [C][a1]"}, {0x061346dd,65536,"Jumpman '86 by Par Johannesson Release 2 (PD) [C]"}, {0xd1277eeb,32768,"Kc by Johnny 13 (PD) [C]"}, {0x872e19ab,65536,"Kemuria Adventure (Bung V4) (PD) [C]"}, {0x47ec88e8,32768,"Kenny and the Evil Blob (Bung V4) (PD) [C]"}, {0x29625dd5,32768,"King's Korner by Harold Toler (PD) [C]"}, {0xb5479316,262144,"Kitty Quest by Shen Mansell (Y2kode) (PD) [C]"}, {0x6e5d5d48,32768,"Klondike (Quang2000) (PD) [C]"}, {0x9e7cc0c2,32768,"Klondike (Quang2000) (PD) [C][a1]"}, {0xea451dbd,131072,"KOLOBOK ZOOM 1 (PD) [C]"}, {0x9d51be49,131072,"KOLOBOK ZOOM 2 (PD) [C]"}, {0x01d1395a,32768,"Kournikova (PD) [C]"}, {0xf1ce3058,32768,"Kyn (Bung) (PD) [C]"}, {0x2abcd052,32768,"Lab 3D (Martin5) Demo (Bung V4) (PD) [C]"}, {0xfa795a27,32768,"Laby Mon (Bung) (PD) [C]"}, {0x5dfb4368,16384,"Lake Effect Demo (PD) [C]"}, {0x1368aee2,32768,"Lawn Mover (Bung) (PD) [C]"}, {0xe483a9fa,32768,"Lawn Mover (Bung) (PD) [C][a1]"}, {0x81efcb07,32768,"Lawnboy (Bung) (PD) [C]"}, {0xfb70b00d,32768,"LawnBoy (PD) [C]"}, {0x798b34c1,32768,"LCD Game (Freedom GB Contest 2001) (PD) [C]"}, {0xf2259202,65536,"LEGO Remocon Test (PD) [C]"}, {0xdabd9ca7,65536,"Leisure Suit Nick (PD) [C]"}, {0x29cad87f,32768,"Lemon Player 2 Demo by Lemon Productions (PD) [C]"}, {0x98e42898,65536,"Lemon Tracker Player 2.1 (PD) [C]"}, {0x89c9f6c6,65536,"Lemon Tracker Player V2.95a (GBDK version) (PD) [C]"}, {0x6f83254d,32768,"Lemon Tracker Player V2.95a (RGBDS version) (PD) [C]"}, {0x02d91b28,65536,"Less Is More Demo (PD) [C]"}, {0x4f4c6956,32768,"Link Up Code Sample (PD) [C]"}, {0x7bf27c9a,32768,"Little Fantasy (Quang2000) (PD) [C]"}, {0x04dad7c5,32768,"Little Fantasy (Tomas Rychnovsky) (PD) [C]"}, {0x74d67471,32768,"Little Fantasy Demo (Tomas Rychnovsky) (PD) [C]"}, {0xdcce0b0c,131072,"Little Sound Dj V0.81 Demo by Johan Kotlinski (PD) [C]"}, {0x2aecbad6,131072,"Little Sound Dj V0.82 Demo by Johan Kotlinski (PD) [C]"}, {0xba0cb5ca,131072,"Little Sound Dj V0.83 Demo by Johan Kotlinski (PD) [C]"}, {0x7271246f,131072,"Little Sound Dj V0.90 Demo by Johan Kotlinski (PD) [C]"}, {0xd2037eab,131072,"Little Sound Dj V0.99 Demo by Johan Kotlinski (PD) [C]"}, {0xacb9a1a3,262144,"Little Sound Dj V1.02 Demo by Johan Kotlinski (PD) [C]"}, {0x51c53b39,262144,"Little Sound Dj V1.03 Demo by Johan Kotlinski (PD) [C]"}, {0x92c86839,524288,"Little Sound Dj V1.05 Demo by Johan Kotlinski (PD) [C]"}, {0x64fc9e56,524288,"Little Sound Dj V1.08 Demo by Johan Kotlinski (PD) [C]"}, {0xa75d1d00,131072,"Little Sound Dj V1.0b Demo by Johan Kotlinski (PD) [C]"}, {0x7d67f7a9,524288,"Little Sound Dj V1.21 Demo by Johan Kotlinski (PD) [C]"}, {0xce787872,524288,"Little Sound Dj V1.27 Demo by Johan Kotlinski (PD) [C]"}, {0x639e162e,524288,"Little Sound Dj V1.30b Demo by Johan Kotlinski (PD) [C]"}, {0x7b59df26,524288,"Little Sound Dj V1.31 Demo by Johan Kotlinski (PD) [C]"}, {0x9148f956,524288,"Little Sound Dj V1.32b Demo by Johan Kotlinski (PD) [C]"}, {0xce8797ef,524288,"Little Sound Dj V1.34b Player by Johan Kotlinski (PD) [C]"}, {0x4f842947,524288,"Little Sound Dj V1.35a Player by Johan Kotlinski (PD) [C]"}, {0xf33a054a,524288,"Little Sound Dj V1.35c Player by Johan Kotlinski (PD) [C]"}, {0x7f52da64,524288,"Little Sound Dj V1.35d Player by Johan Kotlinski (PD) [C]"}, {0xafde7a2b,131072,"Little Sound Dj Vx.xx Demo by Johan Kotlinski (PD) [C]"}, {0x184541b0,131072,"Little Sound Dj Vx.xx Demo by Johan Kotlinski (PD) [C][a1]"}, {0x823ea4d9,32768,"Lock (Bung) (PD) [C]"}, {0x4d2c2bd9,32768,"Logo Xmas (PD) [C]"}, {0x07a5d21d,65536,"Love Replica Demo (PD) [C]"}, {0x2bbaba96,131072,"Luigo Scroller (PD) [C]"}, {0x922d6bdd,262144,"Mad Mall (Lik-Sang) (PD) [C]"}, {0x1c605342,65536,"Magic Eye (PD) [C]"}, {0x96c29163,524288,"MainBlow (Bung V4) (PD) [C]"}, {0x83a3558a,524288,"Manga Slideshow (XXX) 1 - Girls, girls, girls... (PD) [C]"}, {0x64b4ba13,262144,"Manga Slideshow (XXX) 2 - More girls (PD) [C]"}, {0xdeddc55f,262144,"Maniac Miner (Bung) (PD) [C]"}, {0x83920b82,65536,"Marcbla 3D Demo (Bung V4) (PD) [C]"}, {0x98005ca0,65536,"Marcbla 3D Demo (PD) [C]"}, {0xf36e5e3d,65536,"Margo (Bung) (PD) [C]"}, {0x062ea71b,65536,"Mario Bob Demo (PD) [C]"}, {0x534e2957,90088,"Mario Bros (NES Conversion) (PD) [C]"}, {0x89ac3e71,65536,"Mario Brothers Demo (PD) [C]"}, {0x5b351f40,32768,"Mario Brothers Demo (V0.2) (PD) [C]"}, {0x6ec85bc5,32768,"Mario Clone (PD) [C]"}, {0x42805666,32768,"MathDrill 2.0 (PD) [C]"}, {0x4ff91daf,32768,"Matrix Hi-Color Demo (PD) [C]"}, {0x1e26866f,32768,"Maximum Body Count (PD) [C]"}, {0xfa8f5cb6,131072,"Maximum Body Count (PD) [C][a1]"}, {0x34fe9510,32768,"Maximum Body Count (PD) [C][a2]"}, {0x35657092,262144,"Maximum Body Count V2.95 (PD) [C]"}, {0x56d00ed1,32768,"Maze (Bung) (PD) [C]"}, {0xf2ec791d,32768,"MAZE (PD) [C]"}, {0xf17ca9e1,32768,"Maze by 'Jason' (PD) [C]"}, {0x6f2691e5,32768,"Maze Runner - Atari-Style Version (Quang2000) (PD) [C]"}, {0x14ce3a8c,32768,"Maze Runner (Quang2000) (PD) [C]"}, {0x74d74241,32768,"Maze V1.01 by Jeff Siebold (PD) [C]"}, {0x002ec1a7,65536,"Mean Mr Mustard (Lik-Sang) (PD) [C]"}, {0x5a929e2e,262144,"Megane Tengoku (J) (PD) [C]"}, {0x6b8c14d5,32768,"Merry XXX-mas Demo (PD) [C]"}, {0x7fb72992,32768,"MG-888 (PD) [C]"}, {0x8fa3aad1,262144,"Mig 21 (Bung) (PD) [C]"}, {0x930cd8fd,262144,"Mig 21 (Bung) (PD) [C][a1]"}, {0xd7c5ef58,262144,"Mig 21 (Bung) (PD) [C][a2]"}, {0x71a0b7a9,32768,"Minefield (Lik-Sang) (PD) [C]"}, {0x80d8dd5c,32768,"Mines (Bung) (PD) [C]"}, {0x3b9ba83e,32768,"Minesweeper for 'Windows' (Quang2000) (PD) [C]"}, {0x10179cf7,65536,"Mini Zork (PD) [C]"}, {0x806fb6d7,2097152,"Mode 7 Demo Kart by Sam Blanchard (PD) [C]"}, {0xfa8ff5ca,131072,"Moon Fighter (Bung V4) (PD) [C]"}, {0x157ab813,32768,"Mouse Trap (PD) [C]"}, {0x83b0e2fa,32768,"Moving Fox (PD) [C]"}, {0xe217a4eb,32768,"MPlay 2 Demo - Easy Driving (PD) [C][a1]"}, {0xe1e36e88,32768,"MPlay 2 Demo - Funky Test (PD) [C][a1]"}, {0x829f8090,32768,"MPlay 2 Demo - Gumby Boy (PD) [C][a1]"}, {0xcbb06737,32768,"MPlay 2 Demo - Room Service (PD) [C][a1]"}, {0x5a772609,32768,"MPlay 2 Demo - Showroom Music (PD) [C][a1]"}, {0x81970269,32768,"MPlay 2 Demo - Silly Song (PD) [C][a1]"}, {0x3afb45f3,32768,"MPlay 2 Demo - Tango Thud (PD) [C][a1]"}, {0x63d2ae19,32768,"MPlay 2 Demo - Yar's Revenge (PD) [C]"}, {0x0269c529,32768,"Mr. Dig (Bung V4) (PD) [C]"}, {0xee31588e,32768,"Music Box 1.3 ISAS-RGBDS Example (PD) [C]"}, {0x0e28ab97,32768,"Music Box 1.3 Tracker (PD) [C]"}, {0x602335e1,32768,"Music Box by BlackBox (PD) [C]"}, {0x77ce47c7,32768,"Music Box Example (PD) [C]"}, {0xe854d894,32768,"My GB is Your GB and Your GB is My GB (PD) [C]"}, {0x2e83da71,32768,"Mygame (Bung) (PD) [C]"}, {0x685052aa,131072,"Nam Attack (PD) [C]"}, {0x46d5f3db,32768,"Neo-Racer (Quang2000) (PD) [C]"}, {0xcc22677a,32768,"Nervous (PD) [C]"}, {0x93e1a6c0,65536,"NES Duck Hunt (PD) [C]"}, {0x8f6c9f17,65536,"NES Hogan's Alley (PD) [C]"}, {0x491bc75b,65536,"NES Popeye (PD) [C]"}, {0x346ab1d7,90088,"NES Tennis (PD) [C]"}, {0x0f02c87d,65536,"NES Urban Champion (PD) [C]"}, {0x0796c34c,65536,"NES Wild Gunman (PD) [C]"}, {0xc0d6b27f,32768,"Nibbler (PD) [C]"}, {0xdb4cd375,131072,"Nightmode (PD) [C]"}, {0xa0668163,32768,"Ninety (PD) [C]"}, {0x2173b4b2,32768,"NiNSslider (Bung) (PD) [C]"}, {0x0c1d0f97,32768,"NiNSslider (PD) [C]"}, {0x682e32be,32768,"NiNSslider (PD) [C][a1]"}, {0x8bcc6090,131072,"Noah's Arkaid (Bung) (PD) [C]"}, {0x14e0f59e,32768,"Noah's Arkaid (PD) [C]"}, {0xb509a1a0,65536,"NoDrop V1.0 (PD) [C]"}, {0x7d5da670,65536,"NoDrop V1.1 (PD) [C]"}, {0x768960ea,65536,"NoDrop V1.2 (PD) [C]"}, {0xa35cf7c3,65536,"NoDrop V1.3 (PD) [C]"}, {0x82dc882a,262144,"NoDrop V1.5 (PD) [C]"}, {0xc9227041,32768,"NTSC Color Test Bars (PD) [C]"}, {0x4871a6a2,32768,"OBGBTC (Tile Creator) (PD) [C]"}, {0x12aab026,32768,"Old School XXX (PD) [C]"}, {0xd1b243e6,32768,"Oxygen Intro (PD) [C]"}, {0xc29219fa,131072,"Oyoyo (Bung) (PD) [C]"}, {0x7b2ac8f0,131072,"Oyoyo (Bung) (PD) [C][a1]"}, {0xf77f700d,32768,"P9 Demo (PD) [C]"}, {0x84efb9f2,32768,"Pacman (Bung) (PD) [C]"}, {0x6e3b4dbf,32768,"Pac-Man (PD) [C]"}, {0xe8f943ce,32768,"Pacman by Jeff Frohwein (PD) [C]"}, {0x9569d52b,32768,"Pac-Man Demo (PD) [C]"}, {0x5d06028a,32768,"Pac-Man Demo 2 (PD) [C]"}, {0x1174fba2,32768,"Pacman Kids (Bung) (PD) [C]"}, {0x0463a42b,65536,"Pakman by Robsoft (PD) [C]"}, {0x47d7acdc,131072,"Pakus (Bung) (PD) [C]"}, {0xda9cb40f,131072,"Paragon 5 Album (PD) [C]"}, {0xda5350c9,32768,"Pattern Demo (PD) [C]"}, {0x146c4eb8,32768,"Perplex Deluxe (Y2kode) (PD) [C]"}, {0x5016fa9b,1048576,"Phoenix [Jim Bagley] (PD) [C]"}, {0xf39c8119,32768,"Pie Crust V1.0 (Quang2000) (PD) [C]"}, {0x7b08312f,131072,"Planet X (Bung) (PD) [C]"}, {0xb41a4800,32768,"Plasma Storm (Blue) (PD) [C]"}, {0x6163f319,32768,"Plum Wars (Bung) (PD) [C]"}, {0x3b42dc53,32768,"Pocket Enigma V1.3 (Bung V4) (PD) [C]"}, {0xe3d05f43,131072,"Pocket Panic (Bung) (PD) [C]"}, {0x2c2ce722,32768,"Pocket Panic (PD) [C]"}, {0x5b9dc17c,32768,"Poke Da Mon (Bung) (PD) [C]"}, {0x7491ce30,32768,"Pokemon Harrier (PD) [C]"}, {0x038165c5,65536,"Pong (Bung) (PD) [C]"}, {0x381cb531,32768,"Pothead Pong (PD) [C]"}, {0xca3753fa,1048576,"Pretty Fly for a White Guy (PD) [C]"}, {0xd727c225,524288,"Princess & the Pauper, The (Freedom GB Contest 2001 - 3rd Place) (PD) [C]"}, {0xf62220bf,32768,"Project XSTREAM (Bung) (PD) [C]"}, {0x4b137fc4,32768,"Project XSTREAM (Bung) (PD) [C][a1]"}, {0x1e61cace,32768,"Proof Demo (PD) [C]"}, {0x82135b73,65536,"Proxima (Freedom GB Contest 2001 - 2nd Place) (PD) [C]"}, {0x3f05f7ef,65536,"Proxima (PD) [C]"}, {0xc6a3b0c5,65536,"Proxima by Alan Obee (PD) [C]"}, {0xbd6e27a4,65536,"PSST (Bung) (PD) [C]"}, {0x365b937c,49152,"Pulsar (Freedom GB Contest 2001) (PD) [C]"}, {0xa39a0a84,131072,"Putty Squad Demo by Thalamus Interactive (PD) [C]"}, {0x722cce9e,131072,"Puzzlex 2 by Par Johannesson (PD) [C]"}, {0x20cbc3fa,32768,"Q-bert Demo (PD) [C]"}, {0xd5685707,32768,"Quizz (PD) [C]"}, {0x3fc85a03,65536,"Red Dreams (Freedom GB Contest 2001) (PD) [C]"}, {0x4e2b2bff,32768,"Red Top by Vodka, DCS & iOPOP (PD) [C]"}, {0x2a34b417,65536,"Remote Control (1) (PD) [C]"}, {0xe3bcb9f3,65536,"Remote Control (2) (PD) [C]"}, {0xb1bb7f0c,65536,"Remote Control (3) (PD) [C]"}, {0x340d2ec2,65536,"Remote Control (4) (PD) [C]"}, {0x94cf907f,32768,"Remote Control 2 (PD) [C]"}, {0xd10a2fba,32768,"Remote Control Detector (PD) [C]"}, {0xdda4c024,32768,"RemoteBoy (PD) [C]"}, {0x9b6326f9,65536,"REM-Scan NEC Format by TeamKNOx (PD) [C]"}, {0x50800f74,65536,"REM-Scan NEC Format by TeamKNOx (PD) [C][a1]"}, {0x2274d67c,65536,"REM-Scan NEC Format by TeamKNOx (PD) [C][a2]"}, {0xf05f689e,65536,"REM-Scan Sony Format by TeamKNOx (PD) [C]"}, {0xd13b97d7,65536,"REM-Scan Sony Format by TeamKNOx (PD) [C][a1]"}, {0x2e36f727,65536,"ReRoCon Infra-Red RC (PD) [C]"}, {0x038181ae,32768,"RGB Grafx Demo (PD) [C]"}, {0xab478c08,32768,"Right! (PD) [C]"}, {0x0123b238,262144,"RoboTech - Exit Planet Dust (Lik-Sang) (PD) [C]"}, {0x8888778f,262144,"RoboTech - Exit Planet Dust with Music (Lik-Sang) (PD) [C]"}, {0x0dc2fbe9,32768,"Rob's Pakman (PD) [C]"}, {0xc97a0132,32768,"Rogue Orange V1.0 (PD) [C]"}, {0x7ecfddf1,32768,"Rogue Orange V1.1 (PD) [C]"}, {0x1f901ba9,32768,"Rogue Orange V1.11 (Bung) (PD) [C]"}, {0xe2bf4b91,32768,"Rogue Orange V1.11 (PD) [C]"}, {0x02f98818,131072,"Romantic Dream (PD) [C]"}, {0x2e42d0b1,65536,"RoReCon (02-20-2000) (PD) [C]"}, {0x4416a41f,32768,"Rotagraph (PD) [C]"}, {0x5fd82320,65536,"Rotating Face Demo (PD) [C]"}, {0x1ed1cc7a,65536,"RPG Demo (Bung V4) (PD) [C]"}, {0x2d65180d,32768,"RS-232 Send-Receive Demo (PD) [C]"}, {0x281ccec5,32768,"Rushed Xmas greetings from Sack (PD) [C]"}, {0x9a5b2789,131072,"S World 2 (Bung V4) (PD) [C]"}, {0x14d4399c,32768,"Sabotage Color Demo (PD) [C]"}, {0xa06362d9,32768,"Same Or Not (PD) [C]"}, {0xb4f50ecc,32768,"Scramble (PD) [C]"}, {0x8b00d803,32768,"Scrolling Blue Demo (PD) [C]"}, {0x6e11eb46,32768,"Serpent Apocalypse V.6 (Quang2000) (PD) [C]"}, {0xca528573,32768,"Shao-lin's Road (PD) [C]"}, {0xa25991e1,65536,"Shape by Sack (PD) [C]"}, {0x38c35811,262144,"Shoot Demo (PD) [C]"}, {0xbd09359c,32768,"Short Little Demo (Y2kode) (PD) [C]"}, {0xbd18f3c4,114688,"SimBurgerKing (Freedom GB Contest 2001) (PD) [C]"}, {0x3cf5de3e,32768,"SIMON Clone (PD) [C]"}, {0x3528aee3,32768,"Ski Style (Bung) (PD) [C]"}, {0x043e461e,32768,"Skoardy (Bung) (PD) [C]"}, {0xacf2fe31,65536,"Slime's Adventure (Bung V4) (PD) [C]"}, {0x5f5158cb,65536,"Slugs (Lik-Sang) (PD) [C]"}, {0xd000237b,524288,"Slugs (PD) [C]"}, {0x8da09e11,32768,"Smooth Colour Fading Demo (PD) [C]"}, {0x68f3a2f0,32768,"SMYGB Demo (PD) [C]"}, {0xe14f741d,32768,"Snake (Bung) (PD) [C]"}, {0xdd99a6f4,32768,"SnakEat (Bung V4) (PD) [C]"}, {0x4dc142da,65536,"Snaps (PD) [C]"}, {0xe2db8996,32768,"Sneaky Snakes (Bung) (PD) [C]"}, {0x7c658476,32768,"Sonic the Hedgehog Demo (PD) [C]"}, {0x140b1684,32768,"Sony IR Keyboard (PD) [C]"}, {0x1ad015d4,131072,"SOS by R-Lab (PD) [C]"}, {0x0632d09b,131072,"South Park Xtreme Demo (PD) [C]"}, {0xb9497145,131072,"South Park Xtreme Demo (PD) [C][a1]"}, {0x4882c3a6,32768,"Southern Dreams - Slideshow (Lik-Sang) (PD) [C]"}, {0xdf590dea,32768,"Southern Dreams - SMART Demo (Quang2000) (PD) [C]"}, {0x28f667d8,32768,"SPA Scroller (PD) [C]"}, {0xbf43c375,65536,"Space (Bung) (PD) [C]"}, {0x4cbeb30e,32768,"Space Debris (Bung) (PD) [C]"}, {0x85e52c97,131072,"Space Faces (Bung V4) (PD) [C]"}, {0x0c0a777e,32768,"Space Fighter (V1.01) (PD) [C]"}, {0x19fa1b8e,262144,"Space Mission DX (Bung V4) (PD) [C]"}, {0x67c714bb,32768,"Splash 360 Demo (PD) [C]"}, {0x953b3019,32768,"Splash Demo (PD) [C]"}, {0xe7e32900,32768,"Spong (Bung) (PD) [C]"}, {0x8c69a793,32768,"Spr4col (Bung) (PD) [C]"}, {0x668ffa73,65536,"SQRXZ Color (V0.95) (PD) [C]"}, {0xc9a51bc4,65536,"SQRXZ Color (V0.96) (PD) [C]"}, {0x927c73b8,65536,"Stadin Brankkari (Party Version) (PD) [C]"}, {0x3c6d8611,65536,"Stadin Brankkari (PD) [C]"}, {0x3be84e3d,65536,"Stalker by Jorge Persiva (Y2kode) (PD) [C]"}, {0x996dbc97,32768,"Star Field Demo (PD) [C]"}, {0x964cfde5,32768,"Star Fighter by Jonathan Waugh (PD) [C]"}, {0xc72e6dfe,1048576,"Star Heritage (final) (Battery) (PD) [C]"}, {0xb39b4532,1048576,"Star Heritage (final) (Password) (PD) [C]"}, {0x23e25ed1,524288,"Star Heritage Demo Version by R-Lab (PD) [C]"}, {0xabcf049b,32768,"Star Tex (Quang2000) (PD) [C]"}, {0x5b47c6e9,32768,"Star Tex (Quang2000) (PD) [C][a1]"}, {0x1775be37,32768,"Starfight (PD) [C]"}, {0xdadb2a9b,32768,"Stereo Demo (PD) [C]"}, {0x93bf7bed,32768,"Stereo Demo (PD) [C][a1]"}, {0xd1ecfda4,65536,"Stoic Software's Tribute to the United States (PD) [C]"}, {0x9ecda78f,32768,"Stomp the Slime (Bung) (PD) [C]"}, {0x52f37f67,32768,"Stopwatch (PD) [C]"}, {0x397a2083,32768,"Stripped by Triad (PD) [C]"}, {0xb20d84c5,65536,"Super Ninja - a TornPocket Production (WIP) (Y2kode) (PD) [C]"}, {0x25f56322,32768,"Sword (pre Beta Alpha) (PD) [C]"}, {0x1a6854e7,32768,"SWorld (Lik-Sang) (PD) [C]"}, {0x6d56daf8,131072,"Tank Rush (Bung) (PD) [C]"}, {0x618f3bb9,131072,"Tanks! (Bung) (PD) [C]"}, {0xf078ba56,32768,"Tertrablox 2000 (Bung) (PD) [C]"}, {0x6b7e2c48,32768,"Tetris (PD) [C]"}, {0x0f5be7b5,65536,"Thrust (V13-02-2000) (PD) [C]"}, {0xff3f7f03,65536,"Thrust DX (PD) [C]"}, {0x3ae4553e,32768,"Tic-Tac-Toe Demo by Johnny13 (PD) [C]"}, {0xb295c08b,32768,"Tiles by Johnny13 (PD) [C]"}, {0x6044ed1b,32768,"Titney High Colour Demo (PD) [C]"}, {0x03516b3e,32768,"Tochi (Quang2000) (PD) [C]"}, {0x6b8e742f,32768,"Tricolore (PD) [C]"}, {0xf36fa8c4,32768,"Trid Ball (Quang2000) (PD) [C]"}, {0x172a77ad,65536,"TrueText Gameboy Text Library V1.0 by Shen Mansell (PD) [C]"}, {0xe2933cb3,32768,"Turret Duty (Bung) (PD) [C]"}, {0xc4655f0a,131072,"Tutti Demo Version (PD) [C]"}, {0x0424452c,32768,"Twist (Bung V4) (PD) [C]"}, {0xa769dcb8,32768,"Two Strange Guys HI-Color Pic (PD) [C]"}, {0x0e7d78d1,65536,"UGB Player Demo by Thalamus Interactive (PD) [C]"}, {0xcc92a0a8,1048576,"Ultima 3 by Sven Carlberg V0.993 (PD) [C]"}, {0x1e0f8c40,1048576,"Ultima 3 by Sven Carlberg V0.995 (PD) [C]"}, {0xf84833b8,1048576,"Ultima 3 by Sven Carlberg V0.99x (PD) [C]"}, {0xbb522d4d,1048576,"Ultima 3 by Sven Carlberg V0.99x (PD) [C][a1]"}, {0x83d560b1,1048576,"Ultima 3 by Sven Carlberg V0.99x (Y2kode) (PD) [C]"}, {0xde649282,131072,"Unholy 2, The by SkyBaby (PD) [C]"}, {0x9befbc6b,32768,"Vectrony Demo (PD) [C]"}, {0x902b6962,32768,"Vertical Mess Demo (PD) [C]"}, {0x599516ee,32768,"Video Poker (Bung) (PD) [C]"}, {0x464bd9b1,131072,"Vila Caldan Color (PD) [C]"}, {0x3aca89d7,32768,"Vila Caldan Color Demo (PD) [C]"}, {0x17d8275c,262144,"Vivian Demo (PD) [C]"}, {0xdb362294,65536,"VXL - Voxel Landscape Example (PD) [C]"}, {0x1bb399f2,1048576,"Walk (Bung) (PD) [C]"}, {0x563989d7,32768,"Wario Craft (PD) [C]"}, {0x6bde313e,65536,"Water Basketball (Bung) (PD) [C]"}, {0x1d9f6f9d,32768,"Water Lake Effect, The (PD) [C]"}, {0xfb8f10e8,32768,"Wave Scrolling Test Demo (PD) [C]"}, {0x92e9990d,32768,"Whackemon (Quang2000) (PD) [C]"}, {0x78fe29d7,32768,"Where's the Chip-Hop (Bung V4) (PD) [C]"}, {0x0ebdf1ed,131072,"Wiedzmin - tom by Andrzej Sapkowski (Polish) (PD) [C]"}, {0x6790b6b9,32768,"Willy Wonderworm (Bung) (PD) [C]"}, {0x5d34dabd,32768,"Willy Wonderworm (Bung) (PD) [C][a1]"}, {0x210bce6a,32768,"Willy Wonderworm (PD) [C]"}, {0xb5c23406,32768,"Willy Wonderworm (PD) [C][a1]"}, {0xa59909c5,32768,"Wings Demo (PD) [C]"}, {0x611e4286,32768,"Wired Demo by R-Lab (bugfixed version) (GBDev'2000 Winner) (PD) [C]"}, {0x01147b24,32768,"Wired Demo by R-Lab (Quang2000) (PD) [C]"}, {0x94ba2eed,32768,"WonderTopia (PD) [C]"}, {0xb7aeb25d,524288,"Work Master v1.00 - Multitask OS for Gameboy (PD) [C]"}, {0xdbbc515a,32768,"XaGoR Demo (Lik-Sang) (PD) [C]"}, {0xfdb44a36,131072,"Xevious Millennium (PD) [C]"}, {0x5ef51075,131072,"Xevious Sample (PD) [C]"}, {0x3be307df,32768,"Xmas Demo by FagEmul (PD) [C]"}, {0xc5e6fa3c,32768,"Xmas Demo for Consolemul by FagEmul (PD) [C]"}, {0x0029d215,32768,"Xmas Demo for Rc-Roms by FagEmul (PD) [C]"}, {0x5e128f90,524288,"Xmas2000 (PD) [C]"}, {0x5585d67c,65536,"XXX Files Part 1 (PD) [C]"}, {0x3cac01d6,131072,"XXX Files Part 2 (PD) [C]"}, {0x48aa7b23,32768,"Yuric Pic (PD) [C]"}, {0xfdb9c5e4,131072,"Ziarno Prawdy - Book by Andrzej Sapkowski (Polish) (PD) [C]"}, {0x03ab6883,131072,"JetPak DX (Bung) (PD) [C][a1][t1]"}, {0x2185de0c,131072,"JetPak DX (Bung) (PD) [C][a1][t2]"}, {0x22186513,262144,"Berlin 50 Levels Playable Preview (PD) [C]"}, {0xf9980176,524288,"Demotronic Final Demo (PD) [C]"}, {0x809b0950,32768,"Doctor GB Menu (PD) [C][a3]"}, {0x03fc3d03,262144,"Elemental Fighter By SkyRank Games (PD) [C]"}, {0x4971c561,65536,"Everyone is an Artist by J. Beuys (PD) [C]"}, {0x99c00a2b,65536,"Friki Race (Bung) (PD) [C][a2]"}, {0xeb37a319,32768,"Frox by Flavour (PD) [C][a1]"}, {0x772e11e8,32768,"FX Hammer Editor v11 by Aleksi Eeben (PD) [C]"}, {0xc72c1c79,32768,"Galaxia (PD) [C]"}, {0x93188935,131072,"Gameboy Book Reader V3.3 (PD) [C]"}, {0xf0acc0b7,131072,"Gameboy Book Reader V4.0 (PD) [C]"}, {0x1b1a7131,131072,"Gameboy Book Reader V4.3 (PD) [C]"}, {0xa72dc76b,65536,"GB Remote (PD) [C][a1]"}, {0x0cdfb20d,1048576,"GBC Intro Collection 2 (PD) [C]"}, {0x751b9626,32768,"GBCam (PD) [C]"}, {0xe1983dfd,262144,"Gear Effect By SkyRank Games (PD) [C]"}, {0x33d12baf,65536,"Grayscale Moving Heart Demo (PD) [C]"}, {0xe768857b,65536,"Grazyna by Adam Mickiewicz (Polish) (PD) [C]"}, {0x3c50d29f,32768,"Gridull Demo (PD) [C]"}, {0x1eee2569,65536,"HiColor Anime Pic (PD) [C]"}, {0xd39f4de0,32768,"HiColor Hiro Pic (PD) [C]"}, {0x22699627,262144,"Horrible Demon IV, The Beta 0.1 (PD) [C]"}, {0xc740b2eb,262144,"Horrible Demon IV, The Beta 0.1 (PD) [C][a1]"}, {0x2be91413,32768,"ISO Blast Demo (PD) [C]"}, {0x3aef87c7,524288,"Kodeks drogowy by Sejm III RP (Polish) (PD) [C]"}, {0xde476e57,131072,"Konrad Wallenrod by Adam Mickiewicz (Polish) (PD) [C]"}, {0xf9b0552d,1048576,"Korsarz z Saint-Malo by Claude Farree (Polish) (PD) [C]"}, {0x8d9bbaed,524288,"Kostnica by Graham Masterton (Polish) (PD) [C]"}, {0x6ca95d9b,524288,"Krolewicz i Zebrak by Mark Twain (Polish) (PD) [C]"}, {0x5e2fae49,131072,"LAWSON Loppi NP Menu (PD) [C]"}, {0x8019c6f5,262144,"LAWSON Loppi PMA 1 (PD) [C]"}, {0x9c932f0d,262144,"LAWSON Loppi PMA 3 (PD) [C]"}, {0xac77c6bb,262144,"LAWSON Loppi PMB 3 (PD) [C]"}, {0xfe020203,131345,"Little Sound Dj V1.00 Demo by Johan Kotlinski (PD) [C]"}, {0x0994fbef,524288,"Little Sound Dj V1.41b Player by Johan Kotlinski (PD) [C]"}, {0x537e80cd,32768,"MacGB Demo by DarkFader (PD) [C]"}, {0xe1addc57,524288,"Magiczne przygody Kubusia Puchatka (Polish) (PD) [C][a1]"}, {0xcf6ddedd,131072,"Medaliony by Zofia Nalkowska (Polish) (PD) [C]"}, {0xa5407b6c,131072,"Moralnosc pani Dulskiej by Gabriela Zapolska (Polish) (PD) [C]"}, {0x0126640c,65536,"Mouse Game (PD) [C]"}, {0xd6325bae,32768,"MPlay - PlayTest (PD) [C]"}, {0xfc090c02,32768,"MPlay - Puzzled (PD) [C]"}, {0xa687d05b,32768,"MPlay - Test01 (PD) [C]"}, {0x00881ef7,32768,"MPlay - Test02 (PD) [C]"}, {0x40e019d1,32768,"MPlay 2 Demo - Bugs (PD) [C]"}, {0x97c8b491,32768,"MPlay 2 Demo - Calypso Bar (PD) [C]"}, {0x0fa9dfc6,32768,"MPlay 2 Demo - China Nostalgia (PD) [C]"}, {0x14656b98,32768,"MPlay 2 Demo - Easy Driving (PD) [C]"}, {0xafd6430f,32768,"MPlay 2 Demo - Funky Test (PD) [C]"}, {0xdb779192,32768,"MPlay 2 Demo - Funny (PD) [C]"}, {0xb3b88c0b,32768,"MPlay 2 Demo - Girl (PD) [C]"}, {0x394143e8,32768,"MPlay 2 Demo - Gumby Boy (PD) [C]"}, {0x3c96388b,32768,"MPlay 2 Demo - Hard Day's Night, A (PD) [C]"}, {0xb64caf3d,32768,"MPlay 2 Demo - Level32 (PD) [C]"}, {0xc1d7c976,32768,"MPlay 2 Demo - Lost Dance (PD) [C]"}, {0xe0d79c84,32768,"MPlay 2 Demo - Room Service (PD) [C]"}, {0x1e741c2d,32768,"MPlay 2 Demo - Showroom Music (PD) [C]"}, {0x57764d8e,32768,"MPlay 2 Demo - Silly Song (PD) [C]"}, {0x996331d6,32768,"MPlay 2 Demo - Spookville (PD) [C]"}, {0x0dc14763,32768,"MPlay 2 Demo - Tango Thud (PD) [C]"}, {0x97071714,32768,"MPlay 2 Demo - Thing (PD) [C]"}, {0x699018d4,32768,"MPlay 2 Demo - Yar's Revenge (PD) [C][a1]"}, {0x393d8aeb,2097152,"Nad Niemnem by Eliza Orzeszkowa (Polish) (PD) [C]"}, {0x43e70163,131072,"Natsu Kanon Demo (PD) [C]"}, {0xd3b1e2e8,32768,"Netbox IR Keyboard by DarkFader (PD) [C]"}, {0x15b90432,524288,"Nie-Boska komedia by Zygmunt Krasinski (Polish) (PD) [C]"}, {0xceb32ab4,1048576,"Ogniem i Mieczem tom II Powiesc by Henryka Sienkiewicza (PD) [C]"}, {0xd98182c4,32768,"Open Source Pokemon Game, The Demo Release V0.1 (PD) [C]"}, {0x66134343,2097152,"Open Source Pokemon Game, The Demo Release V0.1.1 (PD) [C]"}, {0x67576288,1048576,"Pan Samochodzik 5 - Nowe Przygody Pana Samochodzika (PD) [C]"}, {0x952b0028,262144,"PaZeek By SkyRank Games (PD) [C]"}, {0x1a31f8c4,32768,"Pdroms.com Re-Opening Demo (PD) [C]"}, {0x2f264126,262144,"Pickpocket by iNKA and Psychad (Party Version) (PD) [C]"}, {0xf65c7c61,262144,"Pickpocket by iNKA and Psychad (PD) [C]"}, {0x7d4a8de7,262144,"Pierscien i roza by William Mekepeace Thackeray (Polish) (PD) [C]"}, {0x4fab2df0,524288,"Piesn o Rolandzie (Polish) (PD) [C]"}, {0xca39d902,524288,"Pietnastoletni Kapitan by Jules Verne (Polish) (PD) [C]"}, {0xfde35ffa,524288,"Podroze Pana Kleksa by Jan Brzechwa (Polish) (PD) [C]"}, {0xa67eff34,524288,"Popioly tom 1 by Stefan Zeromski (Polish) (PD) [C]"}, {0xd277e738,1048576,"Popioly tom 2 by Stefan Zeromski (Polish) (PD) [C]"}, {0xa81604f2,1048576,"Popioly tom 3 by Stefan Zeromski (Polish) (PD) [C]"}, {0xbda9b40b,1048576,"Potop tom 1 by Henryk Sienkiewicz (Polish) (PD) [C]"}, {0x8d9d38a9,2097152,"Potop tom 2 by Henryk Sienkiewicz (Polish) (PD) [C]"}, {0x6e455e13,1048576,"Potop tom 3 by Henryk Sienkiewicz (Polish) (PD) [C]"}, {0x29f47c95,1048576,"Powrot krola by J.R.R. Tolkien (Polish) (PD) [C]"}, {0x9a5a8e6a,32768,"Predetor Pic (PD) [C]"}, {0x2881b79b,32768,"Project F-19 Stealth (PD) [C]"}, {0x57b060e2,524288,"Przygody Piotrusia Pana by James Matthew Barrie (Polish) (PD) [C]"}, {0x9d5135f1,262144,"RPG Intro (PD) [C]"}, {0x4400496d,131072,"Rumble & Tumble By SkyRank Games (PD) [C]"}, {0x333855e1,32768,"Rumble Test by DarkFader (PD) [C]"}, {0x9ff8a690,65536,"Scroll Test Dungeon (PD) [C]"}, {0xb465c309,65536,"Scroll Test Garden (PD) [C]"}, {0x80579771,524288,"Shawshank Redemption, The by Stephan King (Polish) (PD) [C]"}, {0x62e6b647,65536,"SimBurgerKing Alpha 1 by Joshua Wise (PD) [C]"}, {0x0ea362ed,114688,"SimBurgerKing Alpha 2 by Joshua Wise (PD) [C]"}, {0x8e13269f,32768,"Sinewave Using All Available Tiles by Darkfader (PD) [C]"}, {0x997c2cd0,524288,"Sklepy cynamonowe by Bruno Schulz (Polish) (PD) [C]"}, {0xb245ff36,262144,"Sluby panienskie by Aleksander Fredro (Polish) (PD) [C]"}, {0xa32af3b9,65536,"Snoopy Puzzle (PD) [C]"}, {0xac56a2e0,1048576,"Stara basn by Jozef Ignacy Kraszewski (Polish) (PD) [C]"}, {0xc75b4c44,32768,"Subport Logo by Titney (PD) [C]"}, {0xef9cf4e1,32768,"Titantic 2000 Demo (PD) [C]"}, {0x28f23b56,131072,"Top Shelf Challenge (PD) [C]"}, {0xfca46d8d,524288,"Tryumf Pana Kleksa by Jan Brzechwa (Polish) (PD) [C]"}, {0xa4af78ea,32768,"Vertical Split Screen Test by DarkFader (PD) [C]"}, {0x213a6337,32768,"Walking Man (PD) [C]"}, {0x16fad54e,524288,"War Of The Worlds, The by H.G. Wells (V3.1) (PD) [C]"}, {0x2a1fc052,32768,"Watch Demo for GBC (PD) [C]"}, {0x404ab20f,32768,"Where's the Chip-Hop by Oyd11 (PD) [C]"}, {0x19c15e87,524288,"Wierna rzeka by Stefan Zeromski (Polish) (PD) [C]"}, {0xb5066d33,2097152,"Winnetou by Karol May (Polish) (PD) [C]"}, {0x29b66194,32768,"Work Master BIOS 2.2 (PD) [C]"}, {0xb1c349d5,32768,"Work Master BIOS 2.2R (PD) [C]"}, {0xe7ea920c,1048576,"Ziemia obiecana tom 1 by Wladyslaw Stanislaw Reymont (Polish) (PD) [C]"}, {0x78cd5c6b,1048576,"Ziemia obiecana tom 2 by Wladyslaw Stanislaw Reymont (Polish) (PD) [C]"}, {0x377fd091,65536,"16 Threads Demo by DarkFader (PD) [C]"}, {0xefe02c57,32768,"3D Red Rotating Cube by DarkFader (PD) [C]"}, {0xdece8739,32768,"40x18 Text Demo (Flickering) by DarkFader (PD) [C]"}, {0x78883874,32768,"40x24 Text Demo by DarkFader (PD) [C][a1]"}, {0x9c92f372,262144,"AIR Pocket Demo (PD) [C]"}, {0x632bbc71,262144,"AIR Pocket Sound (PD) [C]"}, {0x9bfeb3f3,524288,"Akademia Pana Kleksa by Jan Brzechwa (Polish) (PD) [C]"}, {0xc2dc4d96,32768,"Akino Hitoshi Demo (PD) [C]"}, {0x0bdb010d,65536,"Alien Planet (PD) [C][a1]"}, {0x43dc8a4a,131072,"Ballgame DX Demo (Oxyd clone) (PD) [C]"}, {0x1bf91884,2097152,"AIR Pocket OP Demo (PD) [C]"}, {0x5c10cbe5,1048576,"Ben Hur (Polish) (PD) [C]"}, {0xd931dc93,1048576,"Bible, The - Old Testament Books 09-18 (Polish) (PD) [C]"}, {0x8adcb56d,1048576,"Bible, The - Old Testament Books 19-23 (Polish) (PD) [C]"}, {0xd7cb1539,1048576,"Bible, The - Old Testament Books 24-39 (Polish) (PD) [C]"}, {0x1e67c48f,32768,"Boulder Dash DX by DarkFader (PD) [C]"}, {0x22835ce5,32768,"Britany Spears - Shammock by Titney (PD) [C]"}, {0x76bd47d7,32768,"Britany Spears Graphics by Titney (PD) [C]"}, {0x49349a65,32768,"Britany Spears Sitting by Titney (PD) [C]"}, {0x949eab23,32768,"Britany Spears Sultry by Titney (PD) [C]"}, {0xf5e32d4d,524288,"Carmen (Polish) (PD) [C]"}, {0x39ae76d9,32768,"CNCD Alt'02 Demo (PD) [C]"}, {0x63984872,524288,"Chlopi tom 1 by Chlopi Wladyslaw Stanislaw Reymont (PD) [C]"}, {0x33cc501a,524288,"Chlopi tom 2 by Chlopi Wladyslaw Stanislaw Reymont (PD) [C]"}, {0x00cd53f5,1048576,"Chlopi tom 3 by Chlopi Wladyslaw Stanislaw Reymont (PD) [C]"}, {0x2d6790a2,524288,"Chlopi tom 4 by Chlopi Wladyslaw Stanislaw Reymont (PD) [C]"}, {0xe9f5ea83,1048576,"Bible, The - Old Testament Books 01-08 (Polish) (PD) [C]"}, {0xb7e6c04e,131072,"Cud mniemany, czyli Krakowiacy i Gorale by Wojciech Boguslawski (Polish) (PD) [C]"}, {0x3d05bc36,1048576,"Don Quixote by Miguel Cervantes (Polish) (PD) [C]"}, {0xad00134b,2097152,"Druzyna pierscienia by J.R.R. Tolkien (Polish) (PD) [C]"}, {0x9a90c3c6,2097152,"Dwie wieze by J.R.R. Tolkien (Polish) (PD) [C]"}, {0x3bcb8a08,1048576,"Hamlet, King Lear, MacBeth, Othello, Romeo & Juliet (Polish) (PD) [C]"}, {0xa30ad68d,262144,"LAWSON Loppi PMA 2 (PD) [C]"}, {0xf25e5801,524288,"M5 Movie (PD) [C]"}, {0x7795b43b,262144,"LAWSON Loppi PMB 1 (PD) [C]"}, {0xa4b8d805,262144,"LAWSON Loppi PMB 2 (PD) [C]"}, {0xa24272cc,524288,"Little Sound Dj V1.40 Player by Johan Kotlinski (PD) [C]"}, {0xd31fb4a0,524288,"Little Sound Dj V1.43 Demo by Johan Kotlinski (PD) [C]"}, {0x1c9afdd4,524288,"Little Sound Dj V1.51b Player by Johan Kotlinski (PD) [C]"}, {0xa45f4f83,1048576,"Mistrz i Malgorzata by Michail Bulhakow (Polish) (PD) [C]"}, {0xb3f36d9d,1048576,"Nana by Emil Zola (Polish) (PD) [C]"}, {0xb87c881a,1048576,"Nedznicy tom 1 by Victor Hugo (Polish) (PD) [C]"}, {0x660dcc98,2097152,"Nedznicy tom 2 by Victor Hugo (Polish) (PD) [C]"}, {0xf0817ce4,1048576,"Ogniem i Mieczem tom I Powiesc by Henryka Sienkiewicza (PD) [C]"}, {0x7fcdf6a6,262144,"Pan Jowialski by Aleksander Fredro (Polish) (PD) [C]"}, {0xddeca6fa,524288,"Uncle Tom's Cabin by Harriet Beecher Stowe (Polish) (PD) [C]"}, {0x971fc9a0,1048576,"1942 (U) [C][t1]"}, {0xf0c5145d,1048576,"Action Man (U) [C][t1]"}, {0x0c6a7f43,1048576,"Action Man (U) [C][t2]"}, {0x26e83563,1048576,"Adventures of the Smurfs, The (M6) (E) [C][t1]"}, {0xbd3f0283,1048576,"Air Force Delta (U) [C][t1]"}, {0xc4930980,1048576,"Alfred's Adventure (E) (M5) [C][t1]"}, {0xc5604091,524288,"Antz (E) (M6) [C][t1]"}, {0x5afb5ff7,1048576,"Army Men (U) [C][t1]"}, {0x0aca1a27,1048576,"Asterix - Search for Dogmatix (E) (M6) [C][t1]"}, {0x8620f590,1048576,"Babe and Friends (U) [C][t1]"}, {0x6b5eebbf,524288,"Ballistic (U) [C][t1]"}, {0x8ca09928,1048576,"Batman - Chaos in Gotham (E) (M6) [C][t1]"}, {0x04489b6e,1048576,"Batman Beyond - Return of the Joker (U) [C][t1]"}, {0xc81aa335,1048576,"Battle Tanx (U) [C][t1]"}, {0xd05db7c8,2097152,"Bionic Commando - Elite Forces (U) [C][t1]"}, {0xf841422b,262144,"Blades of Steel (U) [C][t1]"}, {0xf979bf5f,2097152,"Bomberman Max - Blue Champion (U) [C][t1]"}, {0xfde24060,2097152,"Bomberman Max - Hero of Light (J) [C][t1]"}, {0xc0f08210,2097152,"Bomberman Max - Red Challenger (U) [C][t1]"}, {0x15673e18,2097152,"Bomberman Max - Shadow of Darkness (J) [C][t1]"}, {0xd34c537a,1048576,"Bubble Bobble (E) [C][t1]"}, {0x490ae005,1048576,"Bugs Bunny - Crazy Castle 3 (J) [C][t1]"}, {0xfdc1483a,1048576,"Bugs Bunny - Crazy Castle 3 (J) [C][t2]"}, {0xaa61915c,1048576,"Bugs Bunny - Crazy Castle 3 (J) [C][t3]"}, {0xae098af9,1048576,"Bugs Bunny - Crazy Castle 3 (U) [C][t1]"}, {0x6248673c,1048576,"Bugs Bunny - Crazy Castle 4 (E) [C][t1]"}, {0x9dd780a3,1048576,"Bugs Bunny - Crazy Castle 4 (J) [C][t1]"}, {0xd751102f,524288,"Bugs Bunny - Operation Carrots (E) (M6) [C][t1]"}, {0x5d25439b,1048576,"Bug's Life, A (E) [C][t1]"}, {0x5a2e6978,1048576,"Bug's Life, A (U) [C][t1]"}, {0x341f41c7,262144,"Burai Fighter (J) [C][t1]"}, {0x4fb49efc,524288,"Bust-a-Move 4 (UE) [C][t1]"}, {0x4e27d0fd,524288,"Buzz Lightyear of Star Command (U) [C][t1]"}, {0x12482228,4194304,"Cannon Fodder (E) (M5) [C][t1]"}, {0x956345bf,1048576,"Catwoman (E) [C][t1]"}, {0x490ed039,1048576,"Chase HQ - Secret Police (U) [C][t1]"}, {0x67b3e04e,1048576,"Chicken Run (U) (M5) [C][t1]"}, {0x09aeebc2,1048576,"Commander Keen (U) [C][t1]"}, {0x28fbedd8,1048576,"Commander Keen (U) [C][t2]"}, {0x9481ddb2,2097152,"Conker's Pocket Tales (U) (M3) [C][t1]"}, {0x4d1dc2ba,1048576,"Croc (UE) [C][t1]"}, {0xcc700170,1048576,"Croc 2 (U) [C][t1]"}, {0x1163e6f7,1048576,"Croc 2 (U) [C][t2]"}, {0x742ef649,1048576,"Daffy Duck - Fowl Play (U) [C][t1]"}, {0x60b52abd,1048576,"Dexter's Laboratory - Robot Rampage (U) [C][t1]"}, {0x57ece087,1048576,"Die Maus (E) (M4) [C][t1]"}, {0xf826ed3d,524288,"Die Maus (E) (M4) [C][t2]"}, {0x5f42b08f,1048576,"Die Original Moorhuhn Jagd (G) [C][t1]"}, {0xc75dec33,4194304,"Donald Duck (E) (M5) [C][t1]"}, {0x58870880,4194304,"Donkey Kong Country (Mag Demo) (UE) (M5) [C][t1]"}, {0x041815ab,4194304,"Donkey Kong Country (UE) (M5) [C][t1]"}, {0x5c61a104,1048576,"Donkey Kong GB - Dinky Kong and Dixie Kong (J) [C][t1]"}, {0x8cb25d16,1048576,"Doraemon Walking Labyrinth (J) [C][t1]"}, {0x0f4e4d4a,4194304,"Dragon's Lair (U) (M6) [C][t1]"}, {0x6c5f3220,1048576,"Driver - You Are The Wheelman (U) (M5) [C][t1]"}, {0x61841a19,262144,"Dropzone (U) [C][t1]"}, {0xd678aead,131072,"Dropzone (U) [C][t1][b1]"}, {0xf3ef4486,1048576,"Duke Nukem (E) (M5) [C][t1]"}, {0x6c55b6dd,1048576,"Earthworm Jim - Menace 2 the Galaxy (U) [C][t1]"}, {0xfb311a03,1048576,"Elevator Action EX (E) (M5) [C][t1]"}, {0x037e39ab,1048576,"Elevator Action EX (J) [C][t1]"}, {0x7d21cb40,262144,"Elmo in Grouchland (U) [C][t1]"}, {0x08c70e71,2097152,"Emperor's New Groove, The (U) [C][t1]"}, {0x0d55e1a8,2097152,"Evel Knievel (E) (M7) [C][t1]"}, {0x603a8bb8,1048576,"Fix & Foxi (E) (M3) [C][t1]"}, {0x54a1c5ac,1048576,"Flintstones, The - Burgertime in Bedrock (E) (M6) [C][t1]"}, {0x74130987,1048576,"Flintstones, The - Burgertime in Bedrock (E) (M6) [C][t1][b1]"}, {0x041eaf27,1048576,"Flipper & Lopaka (E) (M10) [C][t1]"}, {0x6c8672c8,131072,"Frogger (U) [C][t1]"}, {0x8818f73a,1048576,"Frogger 2 (U) [C][t1]"}, {0xe1fda06b,1048576,"Front Line - The Next Mission (J) [C][t1]"}, {0xb7ee72d4,1048576,"Game & Watch Gallery 3 (U) [C][t1]"}, {0xfa8e84de,1048576,"Gameboy Gallery 3 (J) [C][t1]"}, {0x29e3089b,1048576,"Gameboy Gallery 3 (U) [C][t1]"}, {0xf54e2de8,1048576,"Ganbare Goemon - Hoshizorashi Dynamites Arawaru!! (J) [C][t1]"}, {0x7a7564b1,1048576,"Gex - Enter the Gecko (U) [C][t1]"}, {0xd2d596fa,2097152,"Gex 3 - Deep Pocket Gecko (U) [C][t1]"}, {0xfad0d74a,524288,"Ghosts 'N Goblins (U) [C][t1]"}, {0x83929792,1048576,"Gift (E) [C][t1]"}, {0x3a0ee34a,1048576,"Gift (E) [C][t2]"}, {0x8b9d7dae,1048576,"Godzilla - The Series (E) (M3) [C][t1]"}, {0xc2eb3a0b,1048576,"Gold and Glory - The Road to El Dorado (U) [C][t1]"}, {0x8a9ed3fa,1048576,"Gold and Glory - The Road to El Dorado (U) [C][t2]"}, {0x89711982,4194304,"Grand Theft Auto (E) (M5) [C][t1]"}, {0x4d0b8b60,1048576,"Grinch, The (E) (M3) [C][t1]"}, {0x8e786bd4,1048576,"Grinch, The (U) [C][t1]"}, {0x1e2ed3d4,1048576,"Halloween Racer (E) (M6) [C][t1]"}, {0xaa7cd2c4,262144,"Hexcite (U) [C][t1]"}, {0x2988a075,131072,"Highway Racing, The (J) [C][t1]"}, {0x02377081,1048576,"Hollywood Pinball (UE) (M4) [C][t1]"}, {0x609e3045,524288,"Holy Magic Century (E) (M3) [C][t1]"}, {0xe7154078,262144,"Hugo 2.5 (G) [C][t1]"}, {0x8b6b8a52,1048576,"Indiana Jones and the Infernal Machine (U) [C][t1]"}, {0x0a667d73,1048576,"Inspector Gadget (E) (M6) [C][t1]"}, {0x5ecacff9,1048576,"Jeff Gordon XS Racing (U) [C][t1]"}, {0xf1a9a747,2097152,"Jim Henson's Muppets (E) (M7) [C][t1]"}, {0x7e5d13dc,2097152,"Jim Henson's Muppets (U) [C][t1]"}, {0x4bd67664,1048576,"Joust & Defender (U) [C][t1]"}, {0x93d61d06,4194304,"Jungle Book, The - Mowgli's Wild Adventure (U) (M5) [C][t1]"}, {0x1a7933cd,1048576,"Kaept'n Blaubaer - Die verrueckte Schatzsuche (G) [C][t1]"}, {0x2849ec29,1048576,"Kaept'n Blaubaer - Die verrueckte Schatzsuche (G) [C][t2]"}, {0xfbd9ae6a,1048576,"Kaept'n Blaubaer - Die verrueckte Schatzsuche (G) [C][t3]"}, {0xfff15e39,262144,"Karate Joe (E) [C][t1]"}, {0xd555d0ee,1048576,"Klax (U) [C][t1]"}, {0xa41857c1,1048576,"Klax (U) [C][t1][b1]"}, {0xd49fdf05,1048576,"Klax (U) [C][t2]"}, {0x047b7ae1,1048576,"Konami GB Collection Volume 1 (E) [C][t1]"}, {0x98f81c22,1048576,"Konami GB Collection Volume 2 (E) [C][t1]"}, {0x30588202,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.0) (U) [C][t1]"}, {0xf5b0ed65,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.0) (U) [C][t2]"}, {0xc2b89e2e,1048576,"Lion King, The - Simba's Mighty Adventure (U) [C][t1]"}, {0x61e35773,524288,"Little Magic (J) [C][t1]"}, {0xcbd4cf5f,131072,"Logical (U) (Sunsoft) [C][t1]"}, {0xab05be47,131072,"Logical (U) (THQ) [C][t1]"}, {0xbe4a3f33,1048576,"Looney Tunes (U) [C][t1]"}, {0xabd1d59d,1048576,"Lucky Luke - Desperado Train (E) (M6) [C][t1]"}, {0xa2f16b80,524288,"Lucky Luke (E) (M4) [C][t1]"}, {0x1fd73f4c,1048576,"M&M's Minis Madness (U) [C][t1]"}, {0x4ac94a23,1048576,"Marble Madness (U) [C][t1]"}, {0x3ac1fbc6,2097152,"Mario Golf (J) [C][t1]"}, {0x9da5915e,1048576,"Mary-Kate & Ashley - Get a Clue (U) [C][t1]"}, {0xd0d1e12e,1048576,"Mask of Zorro, The (U) [C][t1]"}, {0x7d29f5d3,524288,"Maya the Bee and Her Friends (E) (M3) [C][t1]"}, {0x7b48c9cc,1048576,"Mega Man Xtreme (U) [C][t1]"}, {0x8f354f24,1048576,"Men In Black 2 (U) (M3) [C][t1]"}, {0xee5140c2,1048576,"Merlin (E) (M6) [C][t1]"}, {0x5ca5506a,1048576,"Meta Fight (J) [C][t1]"}, {0xcd265c1f,524288,"Missile Command (U) [C][t1]"}, {0x9531ed78,524288,"Mission Impossible (E) (M5) [C][t1]"}, {0xb2ef233d,1048576,"Monster Rancher Explorer (U) [C][t1]"}, {0x279847c1,524288,"Montezuma's Return (U) (M2) [C][t1]"}, {0x84ac58d9,524288,"Montezuma's Return (E) (M5) [C][t1]"}, {0xb8f1ce20,1048576,"Moon Patrol & Spy Hunter (U) [C][t1]"}, {0xffeeb24f,1048576,"Moon Patrol & Spy Hunter (U) [C][t2]"}, {0x3033ff1f,1048576,"Motocross Maniacs 2 (U) [C][t1]"}, {0xe39b1d11,1048576,"Mr. Driller (E) (M5) [C][t1]"}, {0x6edd524c,1048576,"Mr. Driller (J) [C][t1]"}, {0x63d5a88b,1048576,"Mr. Nutz (E) (M6) [C][t1]"}, {0x98be20bb,1048576,"Mr. Nutz (E) (M6) [C][t2]"}, {0x134d1f96,524288,"Ms. Pac-Man & Pac-Man SCE (U) (Namco) [C][t1]"}, {0x71415564,1048576,"NASCAR Racers (U) [C][t1]"}, {0x90f4e61b,1048576,"New Adventures of Mary-Kate and Ashley, The (U) [C][t1]"}, {0xd709cd38,1048576,"Obelix (E) (M4) [C][t1]"}, {0xda048ae3,1048576,"Obelix (E) (M4) [C][t1][BF]"}, {0x8b8385df,262144,"Ohasta Yamachan & Reimondo (J) [C][t1]"}, {0xbeb4db56,1048576,"Ottifanten - Kommando Stoertebecker (G) [C][t1]"}, {0x605214ef,1048576,"Ottifanten - Kommando Stoertebecker (G) [C][t1][b1]"}, {0x85b99dc4,262144,"Pac-Man & Pac-Attack SCE (U) (Namco) [C][t1]"}, {0x091a480a,262144,"Pac-Man & Pac-Attack SCE (U) (Namco) [C][t2]"}, {0x37a3a579,262144,"Pac-Man & Pac-Attack SCE (U) (Namco) [C][t3]"}, {0x23d2c5c6,262144,"Painter (E) [C][t1]"}, {0x1df58d30,1048576,"Paperboy (U) [C][t1]"}, {0x2f951e91,1048576,"Papyrus (E) (M6) [C][t1]"}, {0x76ab2993,524288,"Pitfall - Beyond the Jungle (U) [C][t1]"}, {0x52960140,1048576,"Pitfall - Beyond the Jungle (U) [C][t2]"}, {0x6ef43f1c,524288,"Pocket Bomberman (U) [C][t1]"}, {0x014b40ce,1048576,"Pocket Bomberman (U) [C][t2]"}, {0x6967c49f,131072,"Pocket Color Block (J) [C][t1]"}, {0x8aee382a,131072,"Pocket Color Block (J) [C][t2]"}, {0xdb1509da,131072,"Pocket Color Block (J) [C][t3]"}, {0x372e4242,1048576,"Pocket Monsters Pinball (J) [C][t1]"}, {0x29122b5d,1048576,"Pocket Monsters Pinball (J) [C][t2]"}, {0x488fe0da,1048576,"Pocket Monsters Pinball (J) [C][t3]"}, {0x458d4765,1048576,"Pokemon Gelb (Yellow) (Trainer by Filb) (G) [C][t1]"}, {0x86232c62,1048576,"Pokemon Gelb (Yellow) (Trainer V1.6 by Filb) (G) [C][t1]"}, {0x80bdcaec,1048576,"Pokemon Pinball (U) [C][t1]"}, {0x78e2ff9c,1048576,"Pokemon Pinball (U) [C][t2]"}, {0x4f44840e,1048576,"Polaris SnoCross (U) [C][t1]"}, {0xee25fe8b,2097152,"Powerpuff Girls, The - Bad Mojo Jojo (U) [C][t1]"}, {0xb8961fe4,2097152,"Powerpuff Girls, The - Battle Him (U) [C][t1]"}, {0x1b07d84f,2097152,"Powerpuff Girls, The - Battle Him (U) [C][t2]"}, {0x6e2348e6,524288,"Prince of Persia (E) (M5) [C][t1]"}, {0xd95aedf8,524288,"Prince of Persia (E) (M5) [C][t2]"}, {0xcb3fd64d,524288,"Prince of Persia (E) (M5) [C][t3]"}, {0x6c5ebc4c,524288,"Project S-11 (U) [C][t1]"}, {0xd69952f7,1048576,"Puzzled (E) (M3) [C][t1]"}, {0xb707c473,1048576,"Qix Adventure (J) [C][t1]"}, {0xfc02b771,524288,"Quest - Fantasy Challenge (U) [C][t1]"}, {0xbb145171,524288,"Rats! (UE) (M2) [C][t1]"}, {0x87bd2419,4194304,"Rayman (E) [C][t1]"}, {0xae2ca38e,4194304,"Rayman (U) [C][t1]"}, {0xaef08e25,524288,"Reservoir Rats (E) (M5) [C][t1]"}, {0x176e1b37,1048576,"Rhino Rumble (U) [C][t1]"}, {0xc592d35d,131072,"Roadsters '98 (U) [C][t1]"}, {0xe95743d9,1048576,"Robin Hood (E) (M6) [C][t1]"}, {0x8cf71992,1048576,"Robin Hood (E) (M6) [C][t2]"}, {0x0b2b40d1,1048576,"Robocop (U) (M6) [C][t1]"}, {0x02bedec2,262144,"Rox (J) [C][t1]"}, {0xd38a8f12,1048576,"R-Type DX (U) [C][t1]"}, {0xec69c663,1048576,"R-Type DX (U) [C][t2]"}, {0x382ad2b3,1048576,"Rugrats - Time Travelers (U) [C][t1]"}, {0x27f304b1,1048576,"Rugrats Movie, The (U) [C][t1]"}, {0xfd2f06d5,2097152,"Sabrina - The Animated Series - Zapped! (U) [C][t1]"}, {0x354e3581,2097152,"Sabrina - The Animated Series - Zapped! (U) [C][t2]"}, {0x76a4c206,1048576,"SD Hiryu Ex (J) [C][t1]"}, {0xcafe030b,1048576,"Sgt. Rock - On The Front Line (U) [C][t1]"}, {0x9838f871,1048576,"Shamus (U) [C][t1]"}, {0x77557b6f,2097152,"Shrek Fairy Tale Freakdown (U) (M6) [C][t1]"}, {0x711d581a,1048576,"Simpsons, The - Night of the Living Treehouse of Horror (U) [C][t1]"}, {0xdf4ede58,262144,"Smurfs Nightmare, The (E) (M4) [C][t1]"}, {0xcfcf73f6,1048576,"Smurfs Nightmare, The (E) (M4) [C][t2]"}, {0x380897a5,1048576,"Space Invaders (U) [C][t1]"}, {0xf5a14631,262144,"Space Invaders (U) [C][t1][h1]"}, {0x96e794fc,1048576,"Space Invaders X (J) [C][t1]"}, {0x6676d766,131072,"Space Invasion (Rocket Games) (E) [C][t1]"}, {0x49e345cd,2097152,"Space Station Silicon Valley (E) (M7) [C][t1]"}, {0x518754ac,2097152,"Spawn (U) [C][t1]"}, {0x0bcea97d,2097152,"Spawn (U) [C][t1][BF]"}, {0x84514686,1048576,"Speedy Gonzales - Aztec Adventure (U) [C][t1]"}, {0xc17a6300,1048576,"Spider-Man (U) [C][t1]"}, {0xdee4f003,1048576,"Spirou La Panque Mecanique (E) (M7) [C][t1]"}, {0x4f4c1727,1048576,"Spy vs Spy (U) [C][t1]"}, {0x562bea64,1048576,"Star Wars Episode 1 - Obi-Wan's Adventures (E) (M5) [C][t1]"}, {0xf1f2a994,1048576,"Star Wars Episode 1 - Obi-Wan's Adventures (U) [C][t1]"}, {0xddc4aeac,2097152,"Star Wars Episode I Racer (UE) [C][t1]"}, {0xddafecee,1048576,"Street Fighter Alpha (E) [C][t1]"}, {0xf218d8f9,131072,"Super Breakout! (U) [C][t1]"}, {0xb03b01f0,1048576,"Super Mario Bros. DX (V1.0) (U) [C][t1]"}, {0x7de247e3,1048576,"Super Mario Bros. DX (V1.0) (U) [C][t2]"}, {0x7eeec30b,2097152,"Super Robot Pinball (J) [C][t1]"}, {0xa4bd4355,1048576,"Survival Kids (U) [C][t1]"}, {0x22a44173,1048576,"SWiNG (G) [C][t1]"}, {0xb808e8e5,1048576,"SWIV (E) (M5) [C][t1]"}, {0x8e63c8d5,2097152,"Tarzan (U) [C][t1]"}, {0x13236def,1048576,"Taxi 2 (F) [C][t1]"}, {0xebfebbda,1048576,"Tazmanian Devil - Munching Madness (E) (M5) [C][t1]"}, {0xe9add057,1048576,"Tazmanian Devil - Munching Madness (U) (M5) [C][t1]"}, {0x75a72120,262144,"Thunder Blast Man (J) [C][t1]"}, {0x6c8f17a9,1048576,"Titus the Fox (E) [C][t1]"}, {0xd9766dd9,1048576,"Tom & Jerry - Mouse Hunt (E) (M5) [C][t1]"}, {0xeb403878,524288,"Tom & Jerry (U) [C][t1]"}, {0x08d34ae6,2097152,"Tom & Jerry in Mouse Attacks! (E) (M7) [C][t1]"}, {0xd8370414,4194304,"Tomb Raider (UE) (M5) (Beta) [C][t1]"}, {0x9c669707,1048576,"Tonic Trouble (E) (M6) [C][t1]"}, {0xcb7f2bdf,1048576,"Tonka Raceway (E) [C][t1]"}, {0xc35be4d4,1048576,"Tonka Raceway (U) [C][t1]"}, {0xf8243df0,1048576,"Toobin' (U) [C][t1]"}, {0x93f75ff7,1048576,"Top Gear Pocket (U) [C][t1]"}, {0x1b031a95,1048576,"Top Gear Pocket 2 (J) (Kemco) [C][t1]"}, {0xc68ac950,1048576,"Top Gear Pocket 2 (U) (Vadical) [C][t1]"}, {0x0f0bca62,1048576,"Turok - Rage Wars (E) (M4) [C][t1]"}, {0xf73e58ad,1048576,"Turok 2 - Seeds of Evil (E) [C][t1]"}, {0x9c37f8da,1048576,"Tweety's Highflying Adventures (E) (M3) [C][t1]"}, {0x35bc8d18,524288,"Ultra 3D Pinball - Thrillride (U) [C][t1]"}, {0x2a1edd5f,1048576,"Vigilante 8 (U) [C][t1]"}, {0x8b8b36ff,1048576,"VIP (E) (M5) [C][t1]"}, {0x47d4a3db,524288,"V-Rally - Championship Edition (E) (M3) [C][t1][b1]"}, {0xcd9a6887,524288,"V-Rally - Championship Edition (E) (M4) [C][t1]"}, {0x36541c0f,4194304,"VS Lemmings (J) [C][t1]"}, {0x10703b05,1048576,"Wings of Fury (E) (M3) [C][t1]"}, {0x6978b1ee,524288,"Wings of Fury (U) [C][t1]"}, {0x988fd9b5,1048576,"Wings of Fury (U) [C][t2]"}, {0x2f78497b,1048576,"World Destruction League Thunder Tanks (U) [C][t1]"}, {0xbf7e169d,1048576,"Worms Armageddon (E) (M6) [C][t1]"}, {0x2018422a,1048576,"WWF Betrayal (U) [C][t1]"}, {0x392c2d33,1048576,"WWF Betrayal (U) [C][t1][b1]"}, {0xb5158d53,1048576,"X-Men - Mutant Wars (U) [C][t1]"}, {0x7f16b357,1048576,"Yar's Revenge - The Quotile Ultimatum (U) [C][t1]"}, {0xf54c8aea,1048576,"Yoda Stories (U) [C][t1]"}, {0xd4b8041a,1048576,"Zoboomafoo - Playtime In Zobooland (U) [C][t1]"}, {0x0a5a6830,1048576,"TinTin - Le Temple du Soleil (E) (M3) [C][t1][T-Polish_aRPi]"}, {0xb1a8ba45,1048576,"Kirikou (E) (M6) [C][t1]"}, {0xf49f6aad,1048576,"Adventures of Arle, The (J) [C][T-Eng0.1_DBTrans]"}, {0x12866706,1048576,"Adventures of Arle, The (J) [C][T-Eng1.0_Vida]"}, {0x3c2cdea0,1048576,"Batman Beyond - Return of The Joker (E) (M4) [C][T-Polish]"}, {0xe732e9c4,1048576,"Beast Wars (J) [C][T-Eng0.1]"}, {0x563774f9,2097152,"Bokujo Monogatari GB 2 (J) [C][T-Eng0.1]"}, {0x66df0ddd,4194304,"Donald Duck (E) (M5) [C][T-Polish_aRPi]"}, {0x86d3c2ad,1048576,"Driver - You Are The Wheelman (U) (M5) [C][T-Polish_aRPi]"}, {0xa72b9677,1048576,"Driver - You Are The Wheelman (U) (M5) [C][T-Polish1.1]"}, {0xdd4d1e78,1048576,"Gameboy Wars 2 (J) [C][T-Eng1]"}, {0xda9dd634,1048576,"Gameboy Wars 2 (J) [C][T-Eng2]"}, {0x3eaeeb02,1048576,"Gameboy Wars 2 (J) [C][T-Eng3]"}, {0x4065ae9e,1048576,"Hello Kitty Magical Museum (J) [C][T-Eng1.0_dokidoki]"}, {0xfbb4479b,1048576,"International Superstar Soccer 99 (U) [C][T-Port1.3_CBT]"}, {0x57cf3714,1048576,"International Superstar Soccer 99 (U) [C][T-Port1.3_CBT][a1]"}, {0x060861ad,1048576,"Legend of Zelda, The - Link's Awakening DX (U) [C][T-Port]"}, {0x3b82beef,1048576,"Legend of Zelda, The - Link's Awakening DX (U) [C][T-Spa]"}, {0x3262ffa4,1048576,"Legend of Zelda, The - Link's Awakening DX (U) [C][T-Spa][a1]"}, {0x069e5e61,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.0) (U) [C][T-Polish1]"}, {0xb5be8f00,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.0) (U) [C][T-Swedish0.3]"}, {0x64bccce8,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.1) (U) [C][T-Swedish0.3]"}, {0xf1ea3f69,1048576,"Little Magic (J) [C][T-Eng1.0_SGST]"}, {0xa1e0e54f,1048576,"Magical Chase (J) [C][T-Eng1.00_Gaijin Productions]"}, {0xbe2d6156,1048576,"Ottifanten - Kommando Stoertebecker (G) [C][T-Eng1.0_Matrix_Arcade_Divison]"}, {0xe7b6eea6,262144,"Pac-Man & Pac-Attack SCE (U) [C][T-Spa0.4_PaladinKnightsTrans]"}, {0x8fc9c42a,4194304,"Perfect Dark (U) (M5) [C][T-Polish]"}, {0xda775616,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Eng_Neo_Trans.]"}, {0x039080fc,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Eng0.1_M.C.P.C]"}, {0x951827ef,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Eng0.2_M.C.P.C]"}, {0xf0721425,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Eng0.3_M.C.P.C]"}, {0x0ef3a4a8,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Eng1.6_Team Trans.]"}, {0x601d644c,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Eng0.12_Kakkoii Translations]"}, {0xafb94110,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Spa0.4_GBT]"}, {0x74966dae,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.3_PR]"}, {0x254abd0e,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.4_PR]"}, {0x1052726a,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.8_PR]"}, {0xbb810d9f,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng_partial1]"}, {0x93247486,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng_partial2]"}, {0x471a2e84,1048579,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng_partial3]"}, {0xbc070d2a,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng_partial4]"}, {0xc14bcf98,2097152,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng_partial5]"}, {0xa059027d,1839395,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.0_Filb]"}, {0x26885111,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.35_PR]"}, {0x0578893e,1048578,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.6]"}, {0x2107b348,1048579,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.65_PR]"}, {0x04b2b943,1048579,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.8_PR]"}, {0x95f723b8,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.90_PR]"}, {0x9f867f08,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.91_PR]"}, {0x6d8decbd,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.92_PR]"}, {0xa4076056,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.94_PR]"}, {0x3a32754d,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.95_PR]"}, {0x48dafbdd,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.96_PR]"}, {0x30cac426,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.97_PR]"}, {0xf230b9e0,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng1.99_PR]"}, {0x670c289e,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng10%]"}, {0xbc4fc168,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.00_PR]"}, {0x8b159561,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.1_PR]"}, {0x0db4a2d4,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.15_PR]"}, {0xa291c854,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.2_PR]"}, {0x4d5a1d85,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.5_PR]"}, {0x47e13b6a,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.6_PR]"}, {0xa9eee750,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng2.70_PR]"}, {0xe8a93980,1048579,"Pocket Monsters Gold (V1.0) (J) [C][T-Eng25%_Chris]"}, {0x69ccbc6d,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Fre0.01]"}, {0xa093182d,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Ger]"}, {0x7195de64,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Port]"}, {0xbda95b4a,1839395,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.0_Filb]"}, {0x0ebf6177,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.35_PR]"}, {0x0aa6970e,1048579,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.65_PR]"}, {0x2f139d05,1048579,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.80_PR]"}, {0xbdc013de,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.9_PR]"}, {0xb7b14f6e,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.91_PR]"}, {0x45badcdb,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.92_PR]"}, {0x2d49fbe6,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.94_PR]"}, {0xb37ceefd,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.95_PR]"}, {0xc194606d,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.96_PR]"}, {0xb9845f96,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.97_PR]"}, {0x7b7e2250,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng1.99_PR]"}, {0x35015ad8,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.00_PR]"}, {0x6442f1fa,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.10_PR]"}, {0xe2e3c64f,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.15_PR]"}, {0x4dc6accf,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.20_PR]"}, {0x9bc10935,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.30_PR]"}, {0xca1dd995,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.40_PR]"}, {0xa20d791e,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.50_PR]"}, {0xa8b65ff1,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.60_PR]"}, {0x88e98ac9,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.70_PR]"}, {0x31551ff3,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Eng2.80_PR]"}, {0xa4404bd9,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Engx.xx_PR][a1]"}, {0xaf07fb77,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Fre0.01]"}, {0x29dd839d,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger1.0]"}, {0x4c511ae8,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger1.8_Filb]"}, {0x3fab4b42,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger1.85_Filb]"}, {0x8ee61997,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger1.9_Filb]"}, {0xba9a547f,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.00_Filb]"}, {0xe8ab5863,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.05_Filb]"}, {0x76a794e9,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.06_Filb]"}, {0xc82fdda9,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.1_Filb]"}, {0x7a6de1e8,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.2_Filb]"}, {0x31702b3b,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.21_Filb]"}, {0x0389797b,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.3_Filb]"}, {0x4526d525,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.4_Filb]"}, {0xdd5e3350,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.5_Filb]"}, {0x7f6e72e5,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Ger2.6_Filb]"}, {0xb2325ee7,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Port]"}, {0x25ae8157,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Spa1.5_GBT]"}, {0x44c590e4,1048576,"Pocket Monsters Pinball (J) [C][T-Eng]"}, {0x84e49edf,1048576,"Pocket Monsters Silver (J) [C][T-Eng]"}, {0x12ff5791,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng_partial1]"}, {0xa6172b27,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng_partial2]"}, {0xff564b71,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng_partial3]"}, {0x1cff5da1,2097152,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng_partial4]"}, {0x846c05ec,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng_PRTrans]"}, {0xa7b4fc44,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng0.1]"}, {0xdee78ca5,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng0.99_Vida][BF]"}, {0xcd38556a,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng1.08_Vida]"}, {0xd518d17b,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng1.08_Vida][BF]"}, {0x4d15bdf2,1048576,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng95%]"}, {0x6b18c238,1048576,"Pocket Monsters Silver (V1.1) (J) [C][T-Eng0.1_Matrix]"}, {0xa0ef3bd9,1048576,"Pocket Monsters Silver (V1.1) (J) [C][T-Eng0.99_Vida]"}, {0x70d68a00,1048576,"Pocket Monsters Silver (V1.1) (J) [C][T-Eng1.08_Vida]"}, {0xd8d76d50,1048576,"Pocket Monsters Trading Card Game (J) [C][T-Eng]"}, {0x54ece68a,1048576,"Pocket Monsters Trading Card Game (J) [C][T-Eng_partial]"}, {0x87bebb61,1048576,"Pocket Monsters Yellow (V1.0) (J) [C][T-Eng_partial]"}, {0x2c106b71,2097152,"Pokemon Crystal (U) [C][T-Ger1.0_Filb&JamesR]"}, {0x4cadabad,2097152,"Pokemon Gold (U) [C][T-Ger1.0_Filb]"}, {0x5a6e3d3e,2097152,"Pokemon Gold (U) [C][T-Ger1.1_Filb]"}, {0xfb3571dd,2097152,"Pokemon Gold (U) [C][T-Ger1.2_Filb]"}, {0x07097503,2097152,"Pokemon Gold (U) [C][T-Ger1.3_Filb]"}, {0xb59cd280,2097152,"Pokemon Gold (U) [C][T-Spa0.6_GBT]"}, {0x21c5e9a3,1048576,"Pokemon Pinball (U) [C][T-Spa_partial]"}, {0xe335c86e,1048576,"Pokemon Pinball (U) [C][T-Spa1.0_GBT]"}, {0xedd361ed,1048576,"Pokemon Trading Card Game (U) [C][T-Ger0.50_Domino]"}, {0x1725ffb0,1048576,"Pokemon Trading Card Game (U) [C][T-Ger0.70_Domino]"}, {0xd19f066c,1048576,"Pokemon Trading Card Game (U) [C][T-Ger1.00_Domino]"}, {0xf98082ca,1048576,"Pokemon Trading Card Game (U) [C][T-Spa4.0_GBT]"}, {0x697f8d9b,1048576,"Pokemon Trading Card Game (U) [C][T-Spa5.0_GBT]"}, {0x08776cb0,1048576,"Pokemon Yellow (U) [C][T-Chinese]"}, {0xfdcf148c,1048576,"Pokemon Yellow (U) [C][T-Fre]"}, {0x1e809db7,1048576,"Pokemon Yellow (U) [C][T-Fre_Sky2048]"}, {0x3c246a55,1048576,"Pokemon Yellow (U) [C][T-Fre0.1]"}, {0x98af35fa,1048576,"Pokemon Yellow (U) [C][T-Frex.x_Sky2048]"}, {0x4603468f,1048576,"Pokemon Yellow (U) [C][T-Ger_Blackmail]"}, {0xeb4e1204,1048576,"Pokemon Yellow (U) [C][T-Ger1.0_Filb]"}, {0x51eb689b,1048576,"Pokemon Yellow (U) [C][T-Greek_GTI_Badge]"}, {0x227375ff,1048576,"Pokemon Yellow (U) [C][T-Greek_partial_Badge]"}, {0x0c244a3b,1048576,"Pokemon Yellow (U) [C][T-Port]"}, {0x53bc79ef,1048576,"Pokemon Yellow (U) [C][T-Spa]"}, {0x6ed9b44e,1048576,"Pokemon Yellow (U) [C][T-Spa0.41_Paladin Knights Translations]"}, {0x9cf68153,2097152,"Quest RPG (U) [C][T-Spa1.0_Paladin Knights Translations]"}, {0x7a7361ba,1048576,"Revelations - The Demon Slayer (U) [C][T-Polish]"}, {0xa8be32f6,2097152,"RPG Maker (J) [C][T-Eng0.25_Magecraft]"}, {0x6ef77aea,2097152,"RPG Maker (J) [C][T-Eng0.35_Magecraft]"}, {0xfebcac84,2097152,"RPG Maker (J) [C][T-Eng0.40_Magecraft]"}, {0x33438bdc,2097152,"RPG Maker (J) [C][T-Eng0.60_Magecraft]"}, {0x3c451e20,2097152,"RPG Maker (J) [C][T-Eng0.85_Magecraft]"}, {0xa518cb06,1048576,"Sangokushi 2 (J) [C][T-Chinese][p1]"}, {0x21934252,1048576,"Sanrio Timenet Past (J) [C][T-Eng0.8_Katalyst]"}, {0x8d9c11ae,2097152,"Soul Getter (J) [C][T-Eng0.1_Magecraft]"}, {0x5fcd6938,1048576,"Super Chinese Fighter EX (J) [C][T-Eng_Opus]"}, {0x99fb1903,1048576,"Super Chinese Fighter EX (J) [C][T-Eng_v0.99_SGST]"}, {0x3fdc2fd8,1048576,"Super Mario Bros. DX (V1.0) (U) [C][T-Spa0.99_PalKnightTrans]"}, {0x9fdd6156,1048576,"Super Mario Bros. DX (V1.1) (U) [C][T-Spa0.99_PalKnightTrans]"}, {0xdc8afc22,1048576,"Super Robot Wars Link Battler (J) [C][T-Chinese]"}, {0x11577833,524288,"Tetris DX (JU) [C][T-Spa0.9_Paladin Knights Translations]"}, {0x77926580,2097152,"Warioland 3 (J) (M2) [C][T-Spa_GBT]"}, {0xd1d3a32a,1048576,"Who Wants to Be a Millionaire - 2nd Edition (U) [C][T-Polish]"}, {0xa940a605,1048576,"Wings of Fury (E) (M3) [C][T-Polish_aRPi]"}, {0x079226d5,1048576,"Wizardry Empire (V1.0) (J) [C][T-Eng0.5_Magecraft]"}, {0x8561da9d,1048576,"Wizardry I - Proving Grounds of the Mad Overlord (J) [C][T-Eng_Opus]"}, {0x3ba7cb56,1048576,"Wizardry II - Legacy of Llylgamyn (J) [C][T-Eng_Opus]"}, {0xce3786ad,1048576,"Wizardry III - Knights of Diamonds (J) [C][T-Eng_Opus]"}, {0x37ad1808,1048576,"Worms Armageddon (E) (M6) [C][T-Polish]"}, {0xc30d7e03,2097152,"Legend of Zelda, The - Link's Awakening DX (J) [C][p1][T-Chinese][!]"}, {0xedaa8478,1048576,"Gameboy Wars 2 (J) [C][T-Eng4][h1]"}, {0xef87527c,1048576,"Pocket Monsters Gold (V1.0) (J) [C][T-Port][h1] (Sonic)"}, {0x8be20ab6,1048576,"Pokemon Yellow (U) [C][T-German1.0_Filb][h1]"}, {0x78414dea,1048576,"Dexter's Laboratory - Robot Rampage (U) [C][T-Fre99%_YF06]"}, {0x4f784793,2097152,"Digital Devil Story - Black Children (J) [C][T-Chinese]"}, {0x8f6af7b4,2097152,"Dragon Quest Monsters (J) [C][T-Chinese]"}, {0x8506d949,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.1) (U) [C][T-Norwegian0.01]"}, {0xd6f7fb77,1048576,"Pocket Monsters Gold (V1.1) (J) [C][T-Engx.xx_PR][a2]"}, {0x712a7ebe,2097152,"Pokemon Puzzle Challenge (U) [C][T-Swedish0.35]"}, {0x1d505ada,2097152,"Telefang - Power Version (J) [C][T-Chinese]"}, {0xa10e0b26,1048576,"Tintin in Tibet (E) (M7) [C][T-Polish_aRPi]"}, {0xfc8b8ea9,1048576,"Top Gear Rally 2 (E) [C][T-Polish_aRPi]"}, {0x3aafe7e0,1048576,"Yu-Gi-Oh! - Capsule (J) [C][T-Eng_metranslations]"}, {0x1fb12dc3,1048576,"Yu-Gi-Oh! - Capsule (J) [C][T-Eng_metranslations][a1]"}, {0x692e2bb4,1048576,"Mega Man Xtreme (U) [C][T-Swedish0.07]"}, {0x10dad9b7,1048576,"Mega Man Xtreme (U) [C][T-Swedish0.20]"}, {0x3e9064a3,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Eng]"}, {0x644ffc4d,1048579,"Pocket Monsters Silver (V1.0) (J) [C][T-Eng_partial5]"}, {0x37623ecd,2097152,"Pocket Monsters Trading Card GB 2 - Team Great Rocket Visit! (J) [C][T-Eng_metranslations]"}, {0xae453cc6,4194304,"Yu-Gi-Oh! - Dark Duel Stories II - Duel Monsters (J) [C][T-Eng30%_metranslations]"}, {0x1d7b435f,2097152,"AIR Pocket Sound Demo (PD) [C]"}, {0xc09a5c21,1048576,"Bible, The - New Testament Books (Polish) (PD) [C]"}, {0xd0019fe5,2097152,"Ksiega tysiaca i jednej nocy (Polish) (PD) [C]"}, {0x7fd127d4,524288,"Kordian by Juliusz Slowacki (Polish) (PD) [C]"}, {0xbf00e808,524288,"Homer's Iliad (Polish) (PD) [C]"}, {0x5bafbad0,262144,"King Lear by Shakespeare (Polish) (PD) [C]"}, {0x2aea0cfd,1048576,"Homer's Odyessy (Polish) (PD) [C]"}, {0x322d2d0a,2097152,"Pocket Monsters Crystal Glass (J) [C][T-Eng][a1]"}, {0xa998fa50,1048576,"Ultima 3 by Sven Carlberg V0.99x (PD) [C][a2]"}, {0x349c0d7a,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.0) (U) [C][T-Polish2]"}, {0x1ed2bb17,4194304,"Yu-Gi-Oh! - Dark Duel Stories II - Duel Monsters (J) [C][T-Eng30%_metranslations][a1]"}, {0xf046c458,2097152,"Dune by Frank Herbert (Polish) (PD) [C]"}, {0xc23d88c4,1048576,"Legend of Zelda, The - Link's Awakening DX (V1.2) (U) [C][T-Norwegian0.01]"}, {0xd97dc94d,524288,"Pocket Voice V2.0 Demo 1c (Unl) [C]"}, {0x733f71c9,524288,"Pocket Voice V2.0 Demo 4c (Unl) [C]"}, {0x62d758ed,1048576,"Pokemon Pinball (U) [C][T-Fre99%_YF06]"}, {0x3d281735,131072,"Antygona by Sofokles (PD)[C]"}, {0x2b5f3af5,3112960,"Donald Duck (E) (M5) [C][b1]"}, {0x7daf8dae,2840233,"Metal Gear - Ghost Babel (J) [C][b1]"}, {0xb19ae3db,2785280,"Yu-Gi-Oh! 4 - Yugi Deck (J) [C][b1]"}, {0xe7378f57,1050975,"Woody Woodpecker - Escape from Buzz Buzzard's Park (E) (M5) [C][b1]"}, {0x979a78f3,1048576,"V-Rally - Championship Edition (J) [C][b1]"}, {0x791f8c86,262144,"Super Mario Special 3 (Unl) [C][b2]"}, {0x18fd445d,2097152,"Super Mario Special 3 (Unl) [C][b1]"}, {0x637c5538,46516,"Spider-Man (U) [C][b1]"}, {0xa47c9638,1048576,"Polaris SnoCross (U) [C][b1]"}, //GB!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! {0x75664f91,65536,"16-in-1 Super Card (Unl) [b1]"}, {0x0fc62a50,65536,"16-in-1 Super Card (Unl) [b2]"}, {0x6c03e738,65536,"16-in-1 Super Card (Unl) [b3]"}, {0x2e0c6df7,262144,"Ace Striker (J) [b1]"}, {0xe6a136db,131072,"Ace Striker (J) [b2]"}, {0xcac3ae13,131072,"Ace Striker (J) [b3]"}, {0xbd107861,131072,"Ace Striker (J) [b4]"}, {0x9b28a120,131072,"Addams Family, The - Pugsley's Scavenger Hunt (U) [b1]"}, {0xaf7bb8b6,131072,"Addams Family, The - Pugsley's Scavenger Hunt (U) [b2]"}, {0x55bfd1e4,72148,"Adventure Island (U) [b1]"}, {0x099dd9cb,262144,"Adventure Island 2 (UE) [b1]"}, {0x37d31930,262144,"Adventure Island 2 (UE) [b2]"}, {0x040cce7a,131072,"Adventures of Rocky and Bullwinkle, The (U) [b1]"}, {0x38762263,131072,"Adventures of Star Saver, The (U) [b1]"}, {0x1b6406b1,131072,"Adventures of Star Saver, The (U) [b2]"}, {0xafb2e11c,131072,"Adventures of Star Saver, The (U) [b3]"}, {0xdfd9efd6,131072,"Aero Star (J) [b1]"}, {0x265f6c6b,131072,"Aero Star (J) [b2]"}, {0x0bbf9ed4,97664,"Aguri Suzuki F-1 Super Driving (J) [b1]"}, {0xaaaac5c2,262144,"Aguri Suzuki F-1 Super Driving (J) [b2]"}, {0x4947447f,131584,"Aladdin (U) [S][b1]"}, {0x3b2b904a,131072,"Alfred Chicken (U) [a1][b1]"}, {0x651f5a15,131072,"Alfred Chicken (U) [a1][b2]"}, {0xed65978c,131072,"Alfred Chicken (U) [a1][b3]"}, {0xae31a96c,131072,"Alien 3 (U) [b1]"}, {0x8362d3de,131072,"Alien 3 (U) [b2]"}, {0xcbe62a55,131072,"Alien 3 (U) [b3]"}, {0x0fbc8ffa,33280,"Alien 3 (U) [b4]"}, {0x7c2dc542,131072,"Alien 3 (U) [b5]"}, {0x1b7c8697,131072,"Alien Olympics 2044 AD (U) [b1]"}, {0x8f0843e6,131072,"Altered Space (U) [b1]"}, {0x972851b6,131072,"Altered Space (U) [b2]"}, {0xeb21316d,65536,"Amazing Spider-Man, The (UE) [b1]"}, {0x5f376393,65536,"Amazing Spider-Man, The (UE) [b2]"}, {0x947f1bfc,65536,"Amazing Spider-Man, The (UE) [b3]"}, {0x9776eae0,262144,"America Oudan Ultra Quiz (J) [b1]"}, {0xabbf328e,262144,"America Oudan Ultra Quiz (J) [b2]"}, {0xfdbce9aa,524288,"Animal Breeder 2 (J) [S][b1]"}, {0x0ede19c4,262144,"Animaniacs (U) [S][b1]"}, {0x1a6684bb,262144,"Animaniacs (U) [S][b2]"}, {0x877cc25c,262144,"Aretha 3 (J) [b1]"}, {0x62e97fea,262144,"Aretha 3 (J) [b2]"}, {0x987670bc,21900,"Aretha 3 (J) [b3]"}, {0x19f29b16,131072,"Asterix (UE) (M5) [b1]"}, {0x8bc985b5,131072,"Asteroids & Missile Command (U) [S][b1]"}, {0x200b5bab,32768,"Asteroids (U) [b1]"}, {0xbabb1435,131072,"Atomic Punk (U) [b1]"}, {0x98857787,131072,"Atomic Punk (U) [b2]"}, {0x886576af,131072,"Atomic Punk (U) [b3]"}, {0x8181d148,131072,"Atomic Punk (U) [b4]"}, {0xfc4ec3bf,7300,"Atomic Punk (U) [b5]"}, {0xdea09dc2,262144,"Avenging Spirit (U) [b1]"}, {0x4de76498,65536,"Ayakashi no Siro (J) [b1]"}, {0x9668044b,131072,"Baby T-Rex (U) [b1]"}, {0x056bed49,32768,"Balloon Kid (JUE) [b1]"}, {0xaec344e3,131072,"Barbie - Game Girl (U) [b1]"}, {0x19be9379,131072,"Barbie - Game Girl (U) [b2]"}, {0x0372d188,131072,"Barbie - Game Girl (U) [b3]"}, {0xc97289e7,131072,"Baseball Kids (J) [b1]"}, {0xd5d07589,131072,"Baseball Kids (J) [b2]"}, {0x389fb124,131072,"Bases Loaded (U) [b1]"}, {0xc8efa182,131072,"Bases Loaded (U) [b2]"}, {0x813c7f92,131072,"Batman - Return of the Joker (J) [b1]"}, {0x67459dbd,131072,"Batman - Return of the Joker (J) [b2]"}, {0x52460827,131072,"Batman (JU) [b1]"}, {0xc28a5a03,131072,"Batman (JU) [b2]"}, {0x1104d414,262144,"Batman Forever (U) [b1]"}, {0x37657cd4,262144,"Batman Forever (U) [b2]"}, {0x608463fd,131072,"Battle Bull (J) [b1]"}, {0xa33361a8,262144,"Battle Crusher (J) [S][b1]"}, {0x3125ecd5,262144,"Battle Crusher (J) [S][b2]"}, {0xec92a790,262144,"Battle Crusher (J) [S][b3]"}, {0x238961ca,131072,"Battle of Kingdom (J) [b1]"}, {0xb360c651,262144,"Battle of Olympus, The (UE) (M5) [b1]"}, {0x67cac174,262144,"Battle of Olympus, The (UE) (M5) [b2]"}, {0x2dc9be3a,262144,"Battle of Olympus, The (UE) (M5) [b3]"}, {0x01a8538f,131072,"Battle Unit Zeoth (U) [b1]"}, {0xbecce184,262144,"Battletoads & Double Dragon (U) (Sony Imagesoft) [b1]"}, {0xbf4f8a98,262144,"Battletoads & Double Dragon (U) (Sony Imagesoft) [b2]"}, {0xcca3f6b2,262144,"Battletoads & Double Dragon (U) (Sony Imagesoft) [b3]"}, {0x06c9a7f6,262144,"BC Kid 2 (J) [S][b1]"}, {0x3d8925a0,262144,"BC Kid 2 (J) [S][b2]"}, {0x9334b633,262144,"Beach Volleyball (J) [S][b1]"}, {0x5cad60af,262144,"Beach Volleyball (J) [S][b2]"}, {0x2cc6cf1c,131072,"Beethoven's 2nd (U) [S][b1]"}, {0x0fd4ebce,131072,"Beethoven's 2nd (U) [S][b2]"}, {0x7bd9022f,131072,"Beetlejuice (U) [b1]"}, {0xf3929d6f,131072,"Beetlejuice (U) [b2]"}, {0x4651529e,262144,"Best of the Best - Championship Karate (U) [b1]"}, {0xb90d4e25,262144,"Best of the Best - Championship Karate (U) [b2]"}, {0xa1e31fc3,131072,"Bill and Ted's Excellent GB Adventure (UE) [b1]"}, {0xd39122d1,131072,"Bill and Ted's Excellent GB Adventure (UE) [b2]"}, {0x35e8c0fe,131072,"Bill and Ted's Excellent GB Adventure (UE) [b3]"}, {0x38707b29,262144,"Bionic Commando (J) [b1]"}, {0x7333b1dd,262144,"Bionic Commando (U) [b1]"}, {0xd1446c9b,262144,"Bionic Commando (U) [b2]"}, {0x75f32d85,262144,"Bionic Commando (U) [b3]"}, {0xff8094d2,262144,"Bionic Commando (U) [b4]"}, {0xdb814191,262144,"Bionic Commando (U) [b5]"}, {0xfde0e951,262144,"Bionic Commando (U) [b6]"}, {0x7979525c,262144,"Bionic Commando (U) [b7]"}, {0x8ddb7197,262144,"Bionic Commando (U) [b8]"}, {0xaa5c93c4,262133,"Bionic Commando (U) [b9]"}, {0x8bc43996,131072,"Blades of Steel (U) (GB) [b1]"}, {0x3a49852f,131072,"Blaster Master Boy (U) [b1]"}, {0x4be4603d,65536,"Blodia (J) [b1]"}, {0x235b8262,65536,"Blodia (J) [b2]"}, {0xdb132ae2,131072,"Blues Brothers, The (U) [b1]"}, {0xf8010e30,131072,"Blues Brothers, The (U) [b2]"}, {0x31f2406f,262144,"Boku Drakura Kun (J) [b1]"}, {0x3ca4a7cb,262144,"Boku Drakura Kun 3 (CV Legends) (Akumajo Dracula) (J) [S][b1]"}, {0xad6bbc46,262144,"Boku Drakura Kun 3 (CV Legends) (Akumajo Dracula) (J) [S][b2]"}, {0xfae86abb,32768,"Bomb Jack (U) [b1]"}, {0x709f7695,32769,"Bomb Jack (U) [b2]"}, {0xdd0087f3,131072,"Bomber Boy (J) [b1]"}, {0x239fad04,131070,"Bomber Boy (J) [b2]"}, {0xf6146642,131072,"Bomber Boy (J) [b3]"}, {0xd8f54c63,131072,"Bomber Boy (J) [b4]"}, {0x9fc54005,131072,"Bomber King - Scenario 2 (J) [b1]"}, {0x3d6d317b,131072,"Bomber King - Scenario 2 (J) [b2]"}, {0x44b852e1,131069,"Bomber King - Scenario 2 (J) [b3]"}, {0x1e7f15a9,131072,"Bomber King - Scenario 2 (J) [b4]"}, {0x98571d78,262146,"Bomberman GB (J) [S][b1]"}, {0x414859b0,147456,"Bomberman GB (J) [S][b2]"}, {0x989013ed,262146,"Bomberman GB (J) [S][b3]"}, {0x01e203d1,262144,"Bomberman GB (J) [S][b4]"}, {0x068be073,262144,"Bomberman GB (U) [S][b1]"}, {0x77545764,262144,"Bomberman GB (U) [S][b2]"}, {0x240a5d60,262144,"Bomberman GB (U) [S][b3]"}, {0x80b998fe,262144,"Bomberman GB (U) [S][b4]"}, {0xdfb65408,262144,"Bomberman GB (U) [S][b5]"}, {0x5a08409d,262144,"Bomberman GB 2 (J) [S][b1]"}, {0x61faa1d6,262144,"Bomberman GB 3 (J) [S][b1]"}, {0x6557a5ae,262144,"Bonk's Adventure (U) [b1]"}, {0xa4f891b3,262144,"Bonk's Adventure (U) [b2]"}, {0x3a67c02e,65536,"Bonk's Adventure (U) [b3]"}, {0x89557ad8,262144,"Booby Boys (J) [b1]"}, {0xadba5a98,262144,"Booby Boys (J) [b2]"}, {0x52e64623,262144,"Booby Boys (J) [b3]"}, {0x0ab92375,65536,"Boomer's Adventure in ASMIK World (J) [b1]"}, {0xec12f8f7,65536,"Boomer's Adventure in ASMIK World (U) [b1]"}, {0xc03cb58d,65534,"Boomer's Adventure in ASMIK World (U) [b2]"}, {0x0409c5c0,65536,"Boulder Dash (U) [b1]"}, {0x827f2bd5,32768,"Bounce by Jarvik7 (Bung) (PD) [b1]"}, {0x3a4555d5,65536,"Boxing (JU) [b1]"}, {0x19b6b44a,65536,"Boxing (JU) [b2]"}, {0x84b29b65,65536,"Boy and His Blob, A - Rescue of Princess Blobette (E)(Img)[b1]"}, {0x0bd281ca,131072,"Break Thru! (U) [b1]"}, {0x58632891,131072,"Bubble Bobble (J) [b1]"}, {0x92025049,131072,"Bubble Bobble Jr. (J) [b1]"}, {0xda0a4378,40068,"Bubble Bobble Part 2 (U) [b1]"}, {0xbff5cf6c,251600,"Bubsy 2 (U) [b1]"}, {0x87358c44,131072,"Bugs Bunny - Crazy Castle II (U) [b1]"}, {0x368d6c64,65536,"Bugs Bunny (U) [b1]"}, {0x20f7ae99,65536,"Bugs Bunny (U) [b2]"}, {0x2ab7d408,65536,"Bugs Bunny (U) [b3]"}, {0xfa9042b4,65536,"Burger Time Deluxe (JU) [b1]"}, {0x57fa2beb,65536,"Ca Da (J) [b1]"}, {0x29ebfb17,65536,"Ca Da (J) [b2]"}, {0xaa02a95b,65536,"Ca Da (J) [b3]"}, {0xaf33b851,131072,"Caesar's Palace (J) [b1]"}, {0x676e3556,131072,"Caesar's Palace (U) [b1]"}, {0x7a81b7c0,524288,"Captain Tsubasa (J) [S][b1]"}, {0x61e58eea,524288,"Captain Tsubasa (J) [S][b2]"}, {0x180d4d1e,524288,"Captain Tsubasa (J) [S][b3]"}, {0x6b79e13e,262144,"Captain Tsubasa VS (J) [b1]"}, {0x42685621,131072,"Casino Funpak (U) [b1]"}, {0x24e86ffa,131072,"Casper (U) [b1]"}, {0x93b593b9,131072,"Castle Quest (U) [b1]"}, {0x1cc553dc,131072,"Castle Quest (U) [b2]"}, {0xeb94f43e,131072,"Castle Quest (U) [b3]"}, {0xd35b8d2c,65536,"Castlevania - Legends (G) [S][b1]"}, {0x75bc70ac,262144,"Castlevania - Legends (U) [S][b1]"}, {0x43a9c0ca,262144,"Castlevania - Legends (U) [S][b2]"}, {0xb6196715,65536,"Castlevania - Legends (U) [S][b3]"}, {0xeb8bb03e,131072,"Castlevania 2 - Belmont's Revenge (U) [b1]"}, {0x41860004,65536,"Castlevania Adventure, The ('89) (U) [b1]"}, {0x32fb842f,65536,"Castlevania Adventure, The ('91) (UE) [b1]"}, {0xa698eee6,131072,"Chase HQ (V1.1) (U) [b1]"}, {0x988750f8,131072,"Chase HQ (V1.1) (U) [b2]"}, {0x5441bbea,65536,"Chessmaster, The (V1.1) (UE) [b1]"}, {0x66ab9c61,262144,"Chiki Race (J) [b1]"}, {0x1e3b8f10,262144,"Chiki Race (J) [b2]"}, {0xddfd5dee,262144,"Chiki Race (J) [b3]"}, {0x3947d66e,260733,"Chiki Race (J) [b4]"}, {0x42db76d1,1048576,"Chinese Fighter (J) [S][b1]"}, {0x8c48b657,131072,"Choplifter 2 (U) (LucasArts - Broderbund) [b1]"}, {0x6568b344,65536,"Contra - The Alien Wars (J) [b1]"}, {0x483f515f,131072,"Cool Spot (U) [b1]"}, {0xd61d7fbf,131072,"Cool Spot (U) [b2]"}, {0x7b07ff18,131072,"Cool World (U) [b1]"}, {0x18f9e21b,131072,"Cool World (U) [b2]"}, {0x709081b2,131072,"Cool World (U) [b3]"}, {0xc4ca32c2,131072,"Crayon Shin Chan 4 (J) [S][b1]"}, {0xe7d81610,131072,"Crayon Shin Chan 4 (J) [S][b2]"}, {0xc6879317,131072,"Crayon Shin Chan 4 (J) [S][b3]"}, {0x38dcb9b6,32768,"Crystal Quest (U) [b1]"}, {0x264b8f90,262144,"Cutthroat Island (U) [b1]"}, {0x8875f72a,262144,"Cutthroat Island (U) [b2]"}, {0xaf11a4ac,131072,"Cyber Formula GPX (J) [b1]"}, {0xebea5ea8,131072,"Cyber Formula GPX (J) [b2]"}, {0x898c648c,131072,"Cyber Formula GPX (J) [b3]"}, {0xed66688f,65536,"Cyraid (U) [b1]"}, {0xc53d6ef6,262144,"Daffy Duck - The Marvin Missions (J) [S][b1]"}, {0xf9b6dcc7,131072,"Daffy Duck - The Marvin Missions (UE) [b1]"}, {0xcb68d748,131072,"Daffy Duck - The Marvin Missions (UE) [b2]"}, {0x66c04bea,131072,"Daffy Duck - The Marvin Missions (UE) [b3]"}, {0x2b7fe439,131072,"Daffy Duck - The Marvin Missions (UE) [b4]"}, {0xeebe6e2a,131072,"Darkman (U) [b1]"}, {0x37aa82d9,131072,"Darkwing Duck (U) [b1]"}, {0xe402f5d5,131072,"Darkwing Duck (U) [b2]"}, {0x9df5195b,65536,"Daruman Busters (J) [b1]"}, {0x8aecaa33,131072,"Days of Thunder (U) [b1]"}, {0x579f2a98,65536,"Dead Heat Scramble (J) [b1]"}, {0x143731d2,65536,"Dead Heat Scramble (J) [b2]"}, {0xd044ffe9,131072,"Dennis the Menace (U) [b1]"}, {0x7330dc7d,262144,"Desert Strike - Return to the Gulf (E) (Ocean) [S][b1]"}, {0x99b24690,262144,"Desert Strike - Return to the Gulf (E) (Ocean) [S][b2]"}, {0x38fd17cb,131072,"Dick Tracy (U) [b1]"}, {0xc17fbacd,131072,"Dick Tracy (U) [b2]"}, {0x59358491,262144,"Die Maus (E) (M4) [b1]"}, {0x97612fda,131072,"Dig Dug (U) [b1]"}, {0x3fff5167,57880,"Dino Breeder 2 (J) [S][b1]"}, {0x0799d80d,524288,"Disney's Mulan (U) [S][b1]"}, {0xd0cd573d,131072,"Dodge Ball (J) [b1]"}, {0x0163f270,131072,"Dodge Boy (J) [b1]"}, {0x63e6b4ac,262144,"Dodge Danpei (J) [b1]"}, {0x64749e6a,262144,"Dodge Danpei (J) [b2]"}, {0xdbad3014,524288,"Donkey Kong (V1.0) (JU) [S][b1]"}, {0x534f2762,524288,"Donkey Kong (V1.0) (JU) [S][b2]"}, {0x9264756e,524288,"Donkey Kong (V1.0) (JU) [S][b3]"}, {0x317caf13,524288,"Donkey Kong Land (U) [S][b1]"}, {0xb6147de4,327680,"Donkey Kong Land (U) [S][b2]"}, {0xc9cc1cba,524288,"Donkey Kong Land 2 (UE) [S][b1]"}, {0x7deec62c,524288,"Donkey Kong Land 2 (UE) [S][b2]"}, {0x771965c0,524288,"Donkey Kong Land 3 (U) [S][b1]"}, {0xa094c6e9,131072,"Doraemon (J) [b1]"}, {0xc3909c44,32768,"Doraemon 2 (J) [b1]"}, {0x4b909c75,65536,"Dorakyura Densetsu (Castlevania Adventure) (J) [b1]"}, {0x0218aa35,65536,"Dorakyura Densetsu (Castlevania Adventure) (J) [b2]"}, {0x4b9ed30a,131072,"Double Dragon (U) [b1]"}, {0x1fa8aa9b,131072,"Double Dragon 3 (U) [b1]"}, {0x8c20be3f,131072,"Double Dragon 3 (U) [b2]"}, {0xce05b04c,131072,"Dr. Franken (U) [b1]"}, {0x337f9c04,262144,"Dr. Franken II (UE) (M7) [b1]"}, {0x93a30e18,262144,"Dr. Franken II (UE) (M7) [b2]"}, {0x3c659613,262144,"Dragon Ball Z - Goku Hishouden (J) [S][b1]"}, {0x68a71925,524288,"Dragon Ball Z - Goku Hishouden (J) [S][b2]"}, {0xdb49d135,262144,"Dragon Heart (U) [b1]"}, {0x48d61aba,262144,"Dragon Heart (U) [b2]"}, {0xd5261a21,524288,"Dragon Heart (U) [b3]"}, {0xdbaf18ff,524288,"Dragon Heart (U) [b4]"}, {0x2bb7aa37,131072,"Dragon Tail (J) [b1]"}, {0x0d5923d6,131072,"Dragon Tail (J) [b2]"}, {0xf2e79a99,131072,"Dragon's Lair - The Legend (E) (Elite Systems) [b1]"}, {0xb0699d09,131072,"Dragon's Lair - The Legend (E) (Elite Systems) [b2]"}, {0x9e1945de,131072,"Dungeonland (J) [b1]"}, {0x7318e16a,262144,"Earthworm Jim (U) [b1]"}, {0x41449e72,262144,"Earthworm Jim (U) [b2]"}, {0xa890d021,262144,"Earthworm Jim (U) [b3]"}, {0x54276292,65536,"Elevator Action (U) [b1]"}, {0xb63e9593,65538,"Elevator Action (U) [b2]"}, {0x93943e28,131072,"Elite Soccer (U) [S][b1]"}, {0x3578b6e9,65536,"F-1 Boy (J) [b1]"}, {0x56e9f82b,131072,"F-1 Race (V1.1) (JUE) [b1]"}, {0xa2c15a8f,131072,"F-15 Strike Eagle (U) [b1]"}, {0xea393b08,131072,"F-15 Strike Eagle (U) [b2]"}, {0x50ba447c,131072,"Faceball 2000 (U) [b1]"}, {0x394dd7c0,131072,"Fastest Lap (JU) [b1]"}, {0x089d4062,262144,"Fastest Lap (JU) [b2]"}, {0x7d3a83ad,262144,"Fastest Lap (JU) [b3]"}, {0x5ea05583,131072,"Felix the Cat (U) [b1]"}, {0xb0f27d2e,262144,"Fidgetts, The (J) [b1]"}, {0x86e105f4,262144,"Fidgetts, The (UE) (M7) [b1]"}, {0x2f41afa1,524288,"FIFA International Soccer (U) [S][b1]"}, {0x2d175825,524288,"FIFA Soccer '98 (U) [S][b1]"}, {0x1ba4ed54,524288,"FIFA Soccer '98 (U) [S][b2]"}, {0xa12d7f34,131072,"Fighbird GB (J) [a1][b1]"}, {0x4804161c,131072,"Fighting Simulator 2-in-1 (Flying Warriors) (U) [b1]"}, {0x662ef8db,262144,"Final Fantasy Adventure (U) [b1]"}, {0x1cb4e265,131072,"Final Fantasy Legend (Sa-Ga) (U) [b1]"}, {0x7e6f8849,262144,"Final Fantasy Legend II (Sa-Ga 2) (U) [b1]"}, {0x2e01afee,131072,"Final Fantasy Legend II (Sa-Ga 2) (U) [b2]"}, {0x3cb3afba,131072,"Fire Fighter (U) [b1]"}, {0xd9e8737f,139264,"Fire Fighter (U) [b2]"}, {0xecf09565,131072,"Flash, The (U) [b1]"}, {0x0b5f5353,262144,"Flintstones, The (U) [b1]"}, {0x61fdaa13,262144,"Flintstones, The (U) [b2]"}, {0xdc43203c,262144,"Flintstones, The (U) [b3]"}, {0xb40225a5,131072,"Football International (U) [b1]"}, {0xc7e38c86,131072,"Football International (U) [b2]"}, {0x94a0be14,131072,"Fortified Zone (Ikari no Yousai) (U) [b1]"}, {0x54b108c1,524288,"Frank Thomas' Big Hurt Baseball (U) [b1]"}, {0xfc43515a,65536,"Frommer's Personal Organizer (U) [b1]"}, {0x6d620ed5,65536,"Funny Field (J) [b1]"}, {0xe3baad2a,65536,"Funny Field (J) [b2]"}, {0xf0fd3a23,131072,"Funpack 4-in-1 Vol. 2 (JU) [b1]"}, {0x5d06adb3,131072,"Galaga & Galaxian (J) [S][b1]"}, {0xfbca00dd,131072,"Galaga & Galaxian (U) [S][b1]"}, {0x2fb7f65c,262144,"Game & Watch Gallery (V1.0) (U) [S][b1]"}, {0xc020c640,524288,"Game & Watch Gallery 2 (J) [S][b1]"}, {0xafe39006,1048576,"Gameboy Camera (UEA) [S][b1]"}, {0xd060f23d,131072,"Gameboy Gallery (U) [S][b1]"}, {0xbe02bcc1,131072,"Gameboy Gallery (U) [S][b2]"}, {0x90a6b2b6,524288,"Gameboy Wars Turbo (J) [S][b1]"}, {0xa7242f65,262144,"Gamera - Daikai Jukutyu Kessen (J) [S][b1]"}, {0x54007525,262144,"Gamera - Daikai Jukutyu Kessen (J) [S][b2]"}, {0xf1e1a916,262144,"Ganbare Goemon 2 (J) [S][b1]"}, {0x90b3ff10,262144,"Ganbare Goemon 2 (J) [S][b2]"}, {0xc6275e24,262144,"Gauntlet 2 (U) [b1]"}, {0xe4d4cd0e,262144,"Gauntlet 2 (U) [b2]"}, {0x5d35f60b,131072,"GB Basketball (Tip-Off) (J) [b1]"}, {0xc6fba21d,262144,"GB Genjin (Bonk) (J) [b1]"}, {0x4507c0ac,262144,"GB Genjin (Bonk) (J) [b2]"}, {0xbb6cd59c,262144,"GB Genjin 2 (Bonk's Revenge) (J) [S][b1]"}, {0x3265051c,262144,"GB Genjin 2 (Bonk's Revenge) (J) [S][b2]"}, {0x262368cd,262144,"GB Genjin 2 (Bonk's Revenge) (J) [S][b3]"}, {0x1ef971ad,262144,"GB Genjin 2 (Bonk's Revenge) (J) [S][b4]"}, {0x387f8c2c,25144,"GB Quiz for Kids (PD) [b1]"}, {0x414f38b5,32805,"GB Tic-Tac-Toe (PD) [b1]"}, {0x3c4fcf0f,131072,"Gear Works (U) [b1]"}, {0x4d69fb25,131072,"Gear Works (U) [b2]"}, {0x6fa74958,262144,"Gensan 2 (J) [b1]"}, {0x3230ed1c,262144,"Getaway, The (U) [b1]"}, {0xe7237f8a,262144,"Getaway, The (U) [b2]"}, {0x1fc87ebd,262144,"Getaway, The (U) [b3]"}, {0x7a31b42c,131614,"Ghostbusters 2 (J) [b1]"}, {0xcc7c50c6,131072,"Ghostbusters 2 (UE) [b1]"}, {0x6bc3fe7e,65536,"Ginga (J) [b1]"}, {0xef446dc6,262144,"Go Go Ackman (J) [S][b1]"}, {0xbd8c4b66,262144,"God Medicine (J) [b1]"}, {0xb786508f,262144,"God Medicine (J) [b2]"}, {0xcdc0f10e,131072,"Godzilla (U) [b1]"}, {0x3a300148,131072,"Godzilla (U) [b2]"}, {0x65e8cafe,262144,"Gojira (GB Godzilla) (J) [b1]"}, {0x771212ca,262144,"Gojira (GB Godzilla) (J) [b2]"}, {0x181f5154,262144,"Gojira (GB Godzilla) (J) [b3]"}, {0x19209ec6,262144,"Golf Classic (U) [S][b1]"}, {0x9310ccd0,475136,"Golf Classic (U) [S][b2]"}, {0x3cec1f4a,262144,"Gradius - The Interstellar Assault (U) [b1]"}, {0x7f3dc242,262144,"Gradius - The Interstellar Assault (U) [b2]"}, {0x5ecbb229,524288,"Gradius - The Interstellar Assault (U) [b3]"}, {0xc8e0f04f,270336,"Gradius - The Interstellar Assault (U) [b4]"}, {0x4405f351,65536,"Grand Prix (Sunsoft) (UE) [b1]"}, {0x900dcbff,196608,"Great Greed (U) [b1]"}, {0xf900a557,131072,"Gremlins 2 (JUE) [b1]"}, {0x0dc5d021,131072,"Gremlins 2 (JUE) [b2]"}, {0x1a63fe7b,262144,"Gurander Musashi RV (J) [S][b1]"}, {0x4aac2660,131072,"Hal Wrestling (U) [b1]"}, {0x47dc8b8e,131072,"Hal Wrestling (U) [b2]"}, {0x24b07fc0,262144,"Hammerin' Harry - Ghost Building Company (Gensan) (J) [b1]"}, {0xeed0c406,262144,"Hammerin' Harry - Ghost Building Company (Gensan) (J) [b2]"}, {0x0f8f946e,262144,"Hammerin' Harry - Ghost Building Company (Gensan) (J) [b3]"}, {0x8a99ff21,262144,"Hammerin' Harry - Ghost Building Company (U) [b1]"}, {0x3a8ccbe7,262144,"Hammerin' Harry - Ghost Building Company (U) [b2]"}, {0x980deb3a,524288,"Harvest Moon GB (U) [S][b1]"}, {0xbb2a6b85,524288,"Harvest Moon GB (U) [S][b2]"}, {0x10b15de4,65536,"Hatris (U) [b1]"}, {0x5ba718af,65536,"Hatris (U) [b2]"}, {0x30b77dad,32768,"Heiankyo Alien (J) [b1]"}, {0xbb9b73c6,524288,"Hercules (U) [S][b1]"}, {0xd9838459,524288,"Hercules (U) [S][b2]"}, {0x83fd2a07,262144,"Hercules Eikou (J) [b1]"}, {0x60ce3129,262144,"Hercules Eikou (J) [b2]"}, {0xd5073a03,131072,"High Stakes Gambling (U) [b1]"}, {0xf81e9bb4,131072,"Home Alone (U) [b1]"}, {0xe99789dd,131072,"Home Alone (U) [b2]"}, {0x8c0c9508,131072,"Home Alone 2 (U) [b1]"}, {0x108f7a04,131072,"Home Alone 2 (U) [b2]"}, {0xac3f4fdb,131072,"Hook (E) (Ocean) [b1]"}, {0x9756697b,131072,"Hudson Hawk (U) [b1]"}, {0x7431b6e4,524288,"Humans, The (U) [b1]"}, {0x15eaaad0,270336,"Humans, The (U) [b2]"}, {0x24dea638,262144,"Humans, The (U) [b3]"}, {0x90fdad7d,524288,"Hunchback of Notre Dame, The - Topsy Turvy Games (U) [S][b1]"}, {0x24d8629a,131072,"Hunt for Red October, The (J) [b1]"}, {0x79645a2b,64003,"Hybrid GBPlot (PD) [b1]"}, {0x08407b1b,262144,"Hyper Black Bass (J) [b1]"}, {0x02460313,131072,"Hyper Dunk (U) [b1]"}, {0x7fcd9b96,131072,"Hyper Dunk (U) [b2]"}, {0xa1205f6c,131072,"Hyper Dunk (U) [b3]"}, {0x8f9a13a6,131072,"Incredible Crash Dummies, The (U) [b1]"}, {0xc54a4386,131072,"Incredible Crash Dummies, The (U) [b2]"}, {0xc1500312,131072,"Indiana Jones and the Last Crusade (J) [b1]"}, {0xda5c1fa8,262144,"International Superstar Soccer (U) [S][b1]"}, {0x48fa3ea4,262144,"Irem Fighter (J) [b1]"}, {0x396d0bc3,131072,"Iron League (Strong Wind Chapter One) (J) [b1]"}, {0x760e383f,65536,"Ishido (U) [b1]"}, {0x1297ede4,131072,"Itchy & Scratchy - Minature Golf Madness (U) [b1]"}, {0xd0ffebe3,131072,"J. Cup Soccer (J) [b1]"}, {0x03e121db,131072,"J. League Fighting Soccer (J) [b1]"}, {0x1ea84494,131072,"Jack Nicklaus Golf (U) [b1]"}, {0x48f00909,524288,"James Bond 007 (U) [S][b1]"}, {0x7483f9ff,65536,"Jankenman (J) [b1]"}, {0x22c907fc,131072,"Jeep Jamboree (U) [b1]"}, {0xdbc9f4d6,131072,"Jeep Jamboree (U) [b2]"}, {0xd1817dc9,262144,"Jelly Boy (U) [b1]"}, {0x184cce25,262144,"Jelly Boy (U) [b2]"}, {0xbfb8c3c9,262144,"Jelly Boy (U) [b3]"}, {0x3dae0128,262144,"Jida Igeki (J) [b1]"}, {0x93740c1e,262144,"Jida Igeki (J) [b2]"}, {0x0901419d,65536,"Jimmy Connors Tennis (J) [b1]"}, {0x066b2acd,65536,"Jimmy Connors Tennis (J) [b2]"}, {0x7293c7c4,65536,"Jimmy Connors Tennis (J) [b3]"}, {0x050bbade,65536,"Jimmy Connors Tennis (U) [b1]"}, {0xdb1423d5,65536,"Jimmy Connors Tennis (U) [b2]"}, {0x4b2088e9,65536,"Jordan vs Bird (U) [b1]"}, {0xd7d430b1,229376,"Judge Dredd (U) [b1]"}, {0x3741dc77,262144,"Jungle Strike (U) [b1]"}, {0x991886dd,262144,"Jungle Strike (U) [b2]"}, {0x7ad106f3,262144,"Jungle Wars (J) [b1]"}, {0x6868594e,262144,"Jungle Wars (J) [b2]"}, {0x9b83e88c,524288,"Jurassic Park - Lost World, The (U) [S][b1]"}, {0xaf3adae4,524288,"Jurassic Park - Lost World, The (U) [S][b2]"}, {0x286f6727,262144,"Jurassic Park (E) (M5) [b1][h1]"}, {0x8eacab08,270336,"Jurassic Park (U) [b1]"}, {0xabdbdbe9,262144,"Jurassic Park (U) [b2]"}, {0x1caf7b9a,65536,"Jurassic Park (U) [b3]"}, {0x2bc552a9,262144,"Jurassic Park 2 - The Chaos Continues (UE) [S][b1]"}, {0x613b41ca,262144,"Jurassic Park 2 - The Chaos Continues (UE) [S][b2]"}, {0xb24f637a,524288,"Kaeruno Tameni (J) [b1]"}, {0xc278ff82,524288,"Kaeruno Tameni (J) [b2]"}, {0xb976d4f5,393216,"Kanjiro (J) [S][b1]"}, {0xe597f82e,458752,"Kanjiro (J) [S][b2]"}, {0x8aea0a36,524288,"Ken Griffey Jr. Presents Major League Baseball (U) [S][b1]"}, {0xb0081f49,524288,"Ken Griffey Jr. Presents Major League Baseball (U) [S][b2]"}, {0xf633f50d,131072,"Kid Icarus - Of Myths and Monsters (UE) [b1]"}, {0xed213f95,131072,"Kid Icarus - Of Myths and Monsters (UE) [b1][BF]"}, {0xd6f2a2c2,131072,"Kid Icarus - Of Myths and Monsters (UE) [b2]"}, {0x0fc865c6,131072,"Kid Icarus - Of Myths and Monsters (UE) [b3]"}, {0x7b30dfda,131072,"Kid Icarus - Of Myths and Monsters (UE) [b4]"}, {0x43503c0f,131072,"Kid Icarus - Of Myths and Monsters (UE) [b5]"}, {0xf2eddeb9,524288,"Killer Instinct (U) [S][b1]"}, {0xf7487285,163840,"Killer Instinct (U) [S][b2]"}, {0x6210eda6,524288,"Killer Instinct (U) [S][b3]"}, {0xd6ec97c9,524288,"King of Fighters '95, The (U) [S][b1]"}, {0x1ebbace1,65536,"King of the Zoo (J) [b1]"}, {0xc2c28ce6,524288,"Kirby 2 - Hoshinoka 2 (J) [S][b1]"}, {0x69d99d1d,524288,"Kirby's Block Ball (U) [S][b1]"}, {0xb7b3ee11,524288,"Kirby's Block Ball (U) [S][b2]"}, {0x5f20f345,262144,"Kirby's Dream Land (U) [b1]"}, {0x775ecdef,262144,"Kirby's Hoshinoka-Bi (Dream Land) (V1.0) (J) [b1]"}, {0x5d3003b8,262144,"Kirby's Pinball Land (J) [b1]"}, {0x4aaab286,262144,"Kirby's Pinball Land (U) [b1]"}, {0x17871990,262144,"Kirby's Pinball Land (U) [b2]"}, {0x676f2107,262144,"Kirby's Star Stacker (U) [S][b1]"}, {0xe5b6bd07,262144,"Kirby's Star Stacker (U) [S][b2]"}, {0xc304e4cc,65536,"Klax (U) (GB) [b1]"}, {0xa2dc86b1,524288,"Konami Collection 1 (J) [S][b1]"}, {0x3aaa2ede,131072,"Konami Golf (E) [b1]"}, {0x6c5f5714,32768,"Konami Golf (E) [b2]"}, {0x60439cc9,131072,"Konami Sports (J) [b1]"}, {0x53d4d0f6,131072,"Konami Sports (J) [b2]"}, {0x4c63aafd,32768,"Kwirk (UA) [b1]"}, {0xf6adcda4,32768,"Kwirk (UA) [b2]"}, {0xab4480f2,131072,"Lamborghini American Challenge (U) [b1]"}, {0xbbd2b370,131072,"Lamborghini American Challenge (U) [b2]"}, {0x9af32fce,131072,"Lamborghini American Challenge (U) [b3]"}, {0x331e646b,131072,"Lamborghini American Challenge (U) [b4]"}, {0x36c5651b,131072,"Last Action Hero (U) [b1]"}, {0x46b0b834,262144,"Last Bible (J) [b1]"}, {0x0fda3a78,262144,"Last Bible (J) [b2]"}, {0x5240349a,131072,"Lawnmower Man, The (U) [b1]"}, {0x2464c582,131072,"Lawnmower Man, The (U) [b2]"}, {0x0ff52620,131072,"Lawnmower Man, The (U) [b3]"}, {0xb0c1ce37,131072,"Lawnmower Man, The (U) [b4]"}, {0xb7494145,131072,"Lawnmower Man, The (U) [b5]"}, {0xe35138da,32768,"Lazlos' Leap (U) [b1]"}, {0x13881924,32768,"Lazlos' Leap (U) [b2]"}, {0xfa89219f,65536,"Lazlos' Leap (U) [b3]"}, {0x22c8becf,524288,"Legend of the River King (U) [S][b1]"}, {0xd8b2b04c,401976,"Legend of Zelda, The - Link Gets Laid (P3 hack) (1) [h1][b1]"}, {0x3e097fc8,509302,"Legend of Zelda, The - Link's Awakening (F) [b1]"}, {0xc52bf8b9,524288,"Legend of Zelda, The - Link's Awakening (J) [b1]"}, {0xe2d2bdd9,524119,"Legend of Zelda, The - Link's Awakening (J) [b2]"}, {0xc71e73f3,524288,"Legend of Zelda, The - Link's Awakening (V1.0) (U) [b1]"}, {0x6c30b480,131072,"Lemmings (E) [b1]"}, {0x90d437dd,131072,"Lemmings (E) [b2]"}, {0x8b81b476,131072,"Lemmings (E) [b3]"}, {0x7d304282,524288,"Lemmings 2, The Tribes (U) [b1]"}, {0xbb5d779f,524288,"Lemmings 2, The Tribes (U) [b2]"}, {0x9524466e,28570,"Lemmings 2, The Tribes (U) [b3]"}, {0x4cb3e7fe,524288,"Lion King, The (Disney Classics) (U) [b1]"}, {0xdae8b049,524288,"Lion King, The (Virgin) (U) [b1]"}, {0xee772051,262144,"Little Master (J) [b1]"}, {0x1972ba95,131072,"Lolo (J) [b1]"}, {0x991861c9,262144,"Lucky Luke (E) (M4) [b1]"}, {0x9474296b,65536,"Lucky Monkey (J) [b1]"}, {0x0f63038f,524288,"Lucle (J) [b1]"}, {0x90d6c3eb,524288,"Lucle (J) [b2]"}, {0x506b8126,458752,"Madden '95 (U) [S][b1]"}, {0x3ce2d89c,524288,"Madden '95 (U) [S][b2]"}, {0x77a30719,524288,"Madden '96 (U) [S][b1]"}, {0x22ce673d,524288,"Madden '96 (U) [S][b2]"}, {0x315923c5,131072,"Magical Talulutokun - Raiba Zone Panic (J) [b1]"}, {0x58434d57,54060,"Magnetic Soccer (U) [b1]"}, {0x6512d4a9,131072,"Magnetic Soccer (U) [b2]"}, {0xa37388bb,262144,"Mahoujin Guru Guru (J) [S][b1]"}, {0x3de54e33,262144,"Marble Madness (U) [b1]"}, {0xfb028049,262144,"Marble Madness (U) [b2]"}, {0x1ba9bd15,262144,"Marble Madness (U) [b3]"}, {0x4ed15a48,262144,"Mario's Picross (UE) [S][b1]"}, {0xc18ec1fd,262144,"Mario's Picross (UE) [S][b2]"}, {0xc4c158bd,524288,"Mario's Picross 2 (J) [S][b1]"}, {0xf0eb003a,524288,"Mario's Picross 2 (J) [S][b2]"}, {0x303823ef,131072,"Maru's Mission (U) [b1]"}, {0xbcd834ac,131072,"McDonaldland (U) [b1]"}, {0x483b3075,524288,"Medarot Kuwagata (V1.0) (J) [S][b1]"}, {0x6bd968d0,262144,"Mega Man (U) [b1]"}, {0x4e619361,262144,"Mega Man (U) [b2]"}, {0x55afca76,262144,"Mega Man 2 (E) [b1]"}, {0x93dfa971,262144,"Mega Man 2 (E) [b2]"}, {0x42de2ff7,262144,"Mega Man 3 (U) [b1]"}, {0x34cd6521,262144,"Mega Man 3 (U) [b2]"}, {0x060b89e6,524288,"Mega Man 4 (E) [b1]"}, {0x5461c39e,526833,"Mega Man 4 (E) [b2]"}, {0x837c542e,524288,"Mega Man 5 (U) [S][b1]"}, {0x896fa4a4,65536,"Megalit (U) [b1]"}, {0x7c38c1ad,65536,"Megalit (U) [b2]"}, {0x988717e6,131072,"Mercenary Force (UE) [b1]"}, {0x1566b21c,131072,"Metal Jack (J) [b1]"}, {0xf31f5033,131072,"Metal Jack (J) [b2]"}, {0xac2383a9,262144,"Metroid 2 - Return of Samus (UA) [b1]"}, {0x7eba88de,524288,"Mickey Mouse - Tokyo Disneyland (J) [S][b1]"}, {0xe9e93624,524288,"Mickey Mouse - Tokyo Disneyland (J) [S][b2]"}, {0xbcd4a226,131072,"Mickey Mouse II (J) [b1]"}, {0xa5d7cb10,229376,"Micro Machines (U) [b1]"}, {0xdb89f46f,450000,"Micro Machines (U) [b2]"}, {0xfb6921fc,524288,"Micro Machines (U) [b3]"}, {0x8d12481c,262144,"Midorin Omaki Baoo (J) [S][b1]"}, {0xf6681992,262144,"Mighty Morphin Power Rangers - The Movie (U) [S][b1]"}, {0x2d5ab1cc,262144,"Mighty Morphin Power Rangers (U) [S][b1]"}, {0xe039879c,262144,"Mighty Morphin Power Rangers (U) [S][b2]"}, {0x9e59f78a,262144,"Mighty Morphin Power Rangers (U) [S][b3]"}, {0x1b2b2dcd,131072,"Millipede - Centipede (UE) [S][b1]"}, {0xd4ac182d,131072,"Milon's Secret Castle (U) [b1]"}, {0xb1adfacd,131072,"Milon's Secret Castle (U) [b2]"}, {0xfb445d67,65536,"Miner 2049er (U) [b1]"}, {0x8012d0fe,524288,"Mini 4 Boy (J) [S][b1]"}, {0x355b3a6d,524288,"Mini 4 Boy (J) [S][b2]"}, {0xa040a439,131072,"Miracle Adventure of Esparks (J) [b1]"}, {0xc1cf869c,16384,"MMX MegAnime (PD) [b1]"}, {0x924e08ce,524288,"Mole Mania (Moguranya) (U) [S][b1]"}, {0xff504417,524288,"Mole Mania (Moguranya) (U) [S][b2]"}, {0xf49df990,262144,"Momotaro Dengeki (J) [b1]"}, {0xa239e66b,524288,"Momotaro Dengeki 2 (J) [S][b1]"}, {0xe542d957,524288,"Momotaro Dengeki 2 (J) [S][b2]"}, {0xa7fb3d45,524278,"Momotaro Dengeki 2 (J) [S][b3]"}, {0xe9bb57db,524288,"Momotaro Dengeki 2 (J) [S][b4]"}, {0xc1bfc156,262144,"Momotetu (J) [b1]"}, {0x3a7efad6,262144,"Momotetu (J) [b2]"}, {0xbc2eacbf,262144,"Monopoly (J) [b1]"}, {0xab7aeea1,262144,"Monopoly (J) [b2]"}, {0x8d2db1bf,262144,"Monster Maker 2 (J) [b1]"}, {0x1bdaa982,262144,"Monster Max (U) [b1]"}, {0x6f6010c1,262144,"Monster Max (U) [b2]"}, {0xf1f46638,131072,"Monster Truck Wars (U) [S][b1]"}, {0xdfb1e455,262144,"Mortal Kombat (U) [b1]"}, {0x5175f8e6,257029,"Mortal Kombat (U) [b1][BF]"}, {0x29099e8a,262144,"Mortal Kombat (U) [b2]"}, {0x1fecb73e,524288,"Mortal Kombat 3 (U) [b1]"}, {0x35946095,262144,"Mortal Kombat II (U) [S][b1]"}, {0x4fc1a2e1,262144,"Mortal Kombat II (U) [S][b2]"}, {0x9965f0ad,262144,"Mr. Nutz (U) [b1]"}, {0x75d77322,262144,"Mr. Nutz (U) [b2]"}, {0x7ec7284b,131072,"Musashi Road (J) [b1]"}, {0x9b346678,131072,"Musashi Road (J) [b2]"}, {0xc1f8008c,131072,"Mysterium (U) [b1]"}, {0xa0ba780d,262144,"Mystic Quest (G) [b1]"}, {0x8e4c736d,235122,"Mystic Quest (G) [b2]"}, {0xc735b09b,262144,"Mystic Quest (G) [b3]"}, {0x899f46ab,124416,"Mystic Quest (U) [b1]"}, {0xe8b0d952,262144,"Mystic Quest (U) [b2]"}, {0xc4c7f381,9216,"Mystical Ninja (U) [S][b1]"}, {0x05952688,131072,"Nail'N Scale (U) [b1]"}, {0x78a7ac6b,524288,"Namco Gallery Volume 2 (J) [S][b1]"}, {0xd704a0cf,32768,"NanoSynth (PD) [b1]"}, {0x7a8998ae,131072,"Navy Blue '90 (J) [b1]"}, {0xf2d06e69,131072,"Navy Blue '90 (J) [b2]"}, {0xbe9bfb0c,262144,"Navy Blue '98 (J) [b1]"}, {0x9a01d0cf,131072,"Navy Seals (U) [b1]"}, {0x2ddeb95b,131072,"Navy Seals (U) [b2]"}, {0x8ceed472,131072,"Navy Seals (U) [b3]"}, {0x5437ff0c,65536,"NBA All Star Challenge (U) [b1]"}, {0x642f6059,131072,"NBA All Star Challenge 2 (U) [b1]"}, {0xd35677ae,131072,"NBA All Star Challenge 2 (U) [b2]"}, {0xf044537c,131072,"NBA All Star Challenge 2 (U) [b3]"}, {0x52364e56,131072,"NBA All Star Challenge 2 (U) [b4]"}, {0x5d4d1b5d,131072,"NBA All Star Challenge 2 (U) [b5]"}, {0xd52f6a5c,262144,"NBA Jam (U) [b1]"}, {0xe2d7b440,262144,"NBA Jam (U) [b2]"}, {0x1204e6f3,524288,"Nectaris (J) [S][b1]"}, {0x58c58f62,524288,"Nectaris (J) [S][b1][BF]"}, {0x75f9200c,524800,"Nectaris (J) [S][b2]"}, {0xb7779925,524800,"Nectaris (J) [S][b2][T-Eng_transBRC]"}, {0x22fa3a83,262144,"Nekojara (J) [b1]"}, {0xefd5d9d0,131072,"Nemesis (J) [b1]"}, {0x18b2f1b8,131072,"Nemesis (J) [b2]"}, {0x46f286c4,262144,"Nemesis 2 (J) [b1]"}, {0x316cb13f,201860,"Nettou Garou 2 (J) [S][b1]"}, {0xc3f4caf9,524288,"Nettou King of Fighters '95 (J) [S][b1]"}, {0xd4bd2bdf,524288,"Nettou King of Fighters '95 (J) [S][b2]"}, {0x72903af2,524288,"Nettou King of Fighters '96 (J) [S][b1]"}, {0x9da35ed6,524288,"Nettou King of Fighters '96 (J) [S][b2]"}, {0x4b7b309f,524288,"Nettou World Heroes 2 Jet (J) [S][b1]"}, {0x42123f65,524288,"Nettou World Heroes 2 Jet (J) [S][b2]"}, {0x81aa419d,262144,"New SD Gundam (J) [S][b1]"}, {0xd85c55d6,229376,"New SD Gundam (J) [S][b2]"}, {0x73832911,262144,"New SD Gundam (J) [S][b3]"}, {0x78450fd2,262144,"New SD Gundam (J) [S][b4]"}, {0x5742455d,262144,"NFL Quarterback Club '96 (U) [b1]"}, {0xe735ee44,262144,"NFL Quarterback Club '96 (U) [b2]"}, {0x5ab90151,262144,"NFL Quarterback Club '96 (U) [b3]"}, {0x083efb78,131072,"Nigel Mansell's World Championship '92 (E) [b1]"}, {0x0b5874c2,131072,"Nigel Mansell's World Championship '92 (U) [b1]"}, {0x09e6b707,131072,"Nigel Mansell's World Championship '92 (U) [b2]"}, {0x852d266a,131072,"Nigel Mansell's World Championship '92 (U) [b3]"}, {0xbb1b1347,131072,"Nigel Mansell's World Championship '92 (U) [b4]"}, {0x59bf6170,131072,"Ninja Ryukenden (Ninja Gaiden) (J) [b1]"}, {0x22324538,131072,"Ninja Ryukenden (Ninja Gaiden) (J) [b2]"}, {0xa6537d16,229376,"Obelix (E) (M2) (Fre-Ger) [S][b1]"}, {0x33b19f36,524288,"Oddworld Adventures (UE) [b1]"}, {0x4d4bfb81,131072,"Oira Jajamaru Sekaidai Boken (J) [b1]"}, {0xe6758f56,131072,"Oira Jajamaru Sekaidai Boken (J) [b2]"}, {0x416f3ce8,131072,"On the Tiles - Franky, Joe & Dirk (E) [b1]"}, {0x4f06e5e6,131072,"Oni (J) [b1]"}, {0x47c704e0,131072,"Oni (J) [b2]"}, {0xf2b20a59,13140,"Oni Gashima Pachinko Ten (J) [b1]"}, {0x14754dd5,32768,"Othello (J) [b1]"}, {0x7e5e2c0e,131072,"Otoko Jyuku (J) [b1]"}, {0x5d4c08dc,131072,"Otoko Jyuku (J) [b2]"}, {0xa4ff402c,131072,"Otoko Jyuku (J) [b3]"}, {0x14b65e56,131072,"Out of Gas (U) [b1]"}, {0x6e0e1a28,131072,"Out to Lunch (U) [b1]"}, {0xe9d63962,524288,"Pachinko Data Card - Chou Ataru Kun (J) [S][b1]"}, {0xb7c7ea01,262144,"Pachislot Kids 3 (J) [b1]"}, {0x3aaacce9,65536,"Pac-Man (U) (Namco Hometek) [b1]"}, {0x426c6bf0,131072,"Pac-Panic (J) [S][b1]"}, {0xcc0c7dae,131072,"Pac-Panic (J) [S][b2]"}, {0x3c3665ba,262144,"Pagemaster, The (U) [S][b1]"}, {0xa5ea6f3e,65536,"Painter Momo Pie (J) [b1]"}, {0xae46b801,32768,"Palamedes (J) [b1]"}, {0xcdf6e3ad,262144,"Paperboy 2 (U) [b1]"}, {0x59cd568d,131072,"Parasol Stars (UE) [b1]"}, {0x37bf874b,262144,"Parodius Da! (J) [b1]"}, {0x7a063ed7,262144,"Parodius Da! (J) [b2]"}, {0x7755d559,131072,"Peetan (J) [b1]"}, {0x21d6f060,131072,"Peetan (J) [b2]"}, {0x12acb674,65536,"Penguin Kun Wars VS (J) [b1]"}, {0x278c29e6,524288,"PGA European Tour (U) [S][b1]"}, {0x8420b6cc,524288,"PGA European Tour (U) [S][b2]"}, {0xc188e57f,65536,"Pinball - Revenge of the Gator (U) [b1]"}, {0x34cc8d14,65536,"Pinball - Revenge of the Gator (U) [b2]"}, {0x5c5c3ce4,262144,"Pinball Deluxe (U) [b1]"}, {0x33d02ebf,131072,"Pinball Dreams (UE) [b1]"}, {0xf3665f99,131072,"Pinball Dreams (UE) [b2]"}, {0xee9faec4,262144,"Pinball Mania (U) [b1]"}, {0x78545be5,262080,"Pinocchio (U) (Black Pearl 1996) [b1]"}, {0xada98d0f,262144,"Pit Fighter (U) [b1]"}, {0x79fc1e7e,262144,"Pit Fighter (U) [b2]"}, {0xfbdd7e0b,131072,"Play Action Football (U) [b1]"}, {0x05be004e,458752,"Pocket Bomberman (J) [S][b1]"}, {0xcc65ed55,491520,"Pocket Bomberman (J) [S][b2]"}, {0xd189f2db,524288,"Pocket Bomberman (U) [S][b1]"}, {0x005284e6,524288,"Pocket Jockey (J) [S][b1]"}, {0x450f0f59,242470,"Pocket Kyorochan (J) [S][b1]"}, {0xed0f533b,360448,"Pocket Monsters Blue (J) [S][b1]"}, {0xdd94307f,163840,"Pocket Monsters Blue (J) [S][b1][BF]"}, {0x9f3a1668,524412,"Pocket Monsters Blue (J) [S][b1][T-Eng_partial]"}, {0x208f58f8,196608,"Pocket Monsters Red (V1.1) (J) [S][b1][BF]"}, {0x905db6d8,1048576,"Pocket Monsters Yellow (V1.0) (J) [S][b1]"}, {0xe75e7d8d,1048576,"Pokemon Blue (UA) [S][BF][b1]"}, {0x8f5e91af,1048576,"Pokemon Blue (UA) [S][h1][b1]"}, {0x4b51bff4,131072,"Popeye 2 (J) [b1]"}, {0x245cce0d,131072,"Popeye 2 (U) [b1]"}, {0x21462c75,131072,"Populous (UE) [b1]"}, {0x9cc61e36,131072,"Populous (UE) [b2]"}, {0x395d6ae3,131072,"Power Mission (U) [b1]"}, {0x54506550,131072,"Prehistorik Man (U) [b1]"}, {0x77424182,131072,"Prehistorik Man (U) [b2]"}, {0xa0abea74,65536,"Pri Pri (J) [b1]"}, {0xf9622a4b,262144,"Primal Rage (U) [b1]"}, {0x73148ea4,262144,"Primal Rage (U) [b2]"}, {0x07811739,131072,"Prince of Persia (U) [b1]"}, {0xa9d7f4fc,131072,"Prince of Persia (U) [b2]"}, {0x1e089d68,131072,"Prince of Persia (U) [b3]"}, {0x45ae0758,131072,"Prince of Persia (U) [b4]"}, {0xd091456b,131072,"Pro Soccer (J) [b1]"}, {0xd9308401,131072,"Probotector (E) [b1]"}, {0xf1f7b5e4,131072,"Probotector (E) [b2]"}, {0x165cf361,131072,"Probotector 2 (E) [S][b1]"}, {0x416ae3cf,524288,"Purikura Pocket (J) [S][b1]"}, {0x0a5fdd7c,262144,"Puyo Puyo (J) [S][b1]"}, {0x5a726cb4,262144,"Puyo Puyo (J) [S][b2]"}, {0xfe2a915b,65536,"Puzzle Boy 2 (J) [b1]"}, {0x36054aad,34816,"Puzznic (J) [b1]"}, {0xf4ac4db5,65536,"Puzznic (J) [b2]"}, {0x1910922a,32768,"Q Billion (J) [b1]"}, {0xbfacb932,229376,"Race Days (Dirty Racing & 4 Wheel Drive) (U) [b1]"}, {0x63fdc566,262144,"Race Days (Dirty Racing & 4 Wheel Drive) (U) [b2]"}, {0x3ac9c3d7,131072,"Race Drivin' (U) [b1]"}, {0xdec8a990,131072,"Race Drivin' (U) [b2]"}, {0xa99ddeb0,524288,"Racing Mini 4WD (J) [S][b1]"}, {0x3097d5f0,262144,"Raging Fighter (UE) [b1]"}, {0xaa20b7fc,262144,"Raging Fighter (UE) [b2]"}, {0x67cb864e,131072,"Rampart (U) [b1]"}, {0xedb6c6e2,262144,"Ranma Nibun no Ichi - Part 2 (J) [b1]"}, {0x348b7299,262144,"Ranma Nibun no Ichi - Part 2 (J) [b2]"}, {0x3975073b,262144,"Ranma Nibun no Ichi - Part 2 (J) [b3]"}, {0x8928a0c2,524288,"Real Bout Special (Fatal Fury) (J) [S][b1]"}, {0xcbfdba8a,32768,"Rei 3D Pyramid Demo (PD) [b1]"}, {0x9b5e2fa7,131072,"Robocop (J) [b1]"}, {0xda1e635e,131072,"Robocop (J) [b2]"}, {0x522878fd,131072,"Robocop 2 (U) [b1]"}, {0xdf76103d,131072,"Robocop 2 (U) [b2]"}, {0x6dc338af,524288,"Rock 'N Monster (J) [S][b1]"}, {0xcc131a94,262144,"Rockman 8 (Hong Kong) [p1][b1]"}, {0xeba09288,524288,"Rockman World 4 (J) [b1]"}, {0xbcf4928f,524288,"Rockman World 4 (J) [b2]"}, {0xa6152604,65536,"Rodland (J) [b1]"}, {0x7901dbb9,131072,"Rolan's Curse 2 (U) [b1]"}, {0x4d4f4d4e,131072,"Rolan's Curse 2 (U) [b2]"}, {0xca40c5f6,32768,"RPN Calculator (PD) [b1]"}, {0xbe0daa86,32768,"RPN Calculator (PD) [b2]"}, {0x6a573454,32768,"RPN Calculator (PD) [b3]"}, {0xd3e36e87,32768,"RPN Calculator (PD) [b4]"}, {0x5271ead2,131072,"Rubble Saver (J) [b1]"}, {0x4ae44e31,131072,"Rubble Saver (J) [b2]"}, {0x9f1867ae,32768,"Runtime - Test Rom (PD) [b1]"}, {0x98baf420,120288,"Sa-Ga (Final Fantasy Legend) (V1.1) (J) [b1]"}, {0x5c29cf84,262144,"Sa-Ga (Final Fantasy Legend) (V1.1) (J) [b2]"}, {0x46a38613,131072,"Sagaia (J) [b1]"}, {0x9a26b633,131072,"Sagaia (J) [b2]"}, {0x5d2baa52,262144,"Sailor Moon R (J) [b1]"}, {0x9a72d5c4,262144,"Sailor Moon R (J) [b2]"}, {0x85c9217e,524288,"Samurai Shodown (U) [S][b1]"}, {0xc04c9f7b,229376,"Samurai Shodown (U) [S][b2]"}, {0x07e06c42,524289,"Samurai Shodown (U) [S][b3]"}, {0xdd3db494,524288,"Samurai Shodown (U) [S][b4]"}, {0x0ea66791,262144,"Sangokushi (J) [b1]"}, {0xcc0a8a92,262144,"Sangokushi (J) [b2]"}, {0xd53389fa,65536,"Sanrio Carnival (J) [b1]"}, {0x18e269dc,262144,"Satoru Nakajima - F-1 Hero - The Graded Driver '92 (J) [b1]"}, {0x73b4201d,131072,"SD Command Gundam - G-Arms (J) [b1]"}, {0x0899b914,262144,"SD Gundam Gaiden - Lacroan Heroes (J) [b1]"}, {0x929fdc5c,524288,"SD Hiryu no Ken Gaiden (J) [S][b1]"}, {0xebd0a0e8,524288,"SD Hiryu no Ken Gaiden (J) [S][b2]"}, {0x72d0c744,524288,"SD Hiryu no Ken Gaiden (J) [S][b3]"}, {0x22aa9ca5,65536,"SD Lupin the Third (J) [b1]"}, {0x71a80d5b,262144,"SD Saint Seiya Paradise (J) [b1]"}, {0xfe541679,262144,"SeaQuest DSV (U) [S][b1]"}, {0x2769a202,262144,"SeaQuest DSV (U) [S][b2]"}, {0x5e17e782,262144,"SeaQuest DSV (U) [S][b3]"}, {0x90b8e2cc,262144,"SeaQuest DSV (U) [S][b4]"}, {0x08b3b1bc,10240,"Seiken Densetsu (J) [b1]"}, {0xdf921fb4,262144,"Sengoku Ninjakun - Ninja Taro (J) [b1]"}, {0x8ff389b5,131072,"Sensible Soccer (U) [b1]"}, {0x8d2c64d7,131072,"Sensible Soccer (U) [b2]"}, {0xea9ed812,32768,"Shanghai (J) [b1]"}, {0x6bcbfe54,32768,"Shi Sensyo - Match-Mania (J) [b1]"}, {0xe7948383,32768,"Shi Sensyo - Match-Mania (J) [b2]"}, {0x89102010,89600,"Simpsons, The - Bart & the Beanstalk (U) [b1]"}, {0x5676b41d,131072,"Simpsons, The - Bart & the Beanstalk (U) [b2]"}, {0xada89ebd,131072,"Simpsons, The - Escape from Camp Deadly (U) [b1]"}, {0x7910f1ae,131841,"Simpsons, The - Krusty's Funhouse (U) [b1]"}, {0xff9a8fb5,131072,"Simpsons, The - Krusty's Funhouse (U) [b2]"}, {0xa3710303,131072,"Simpsons, The - Krusty's Funhouse (U) [b3]"}, {0x2c42e03a,131072,"Simpsons, The - Krusty's Funhouse (U) [b4]"}, {0xf44cd1d0,131072,"Skate or Die - Bad 'N Rad (U) [b1]"}, {0xb7ff32a6,131072,"Skate or Die - Tour de Thrash (U) [b1]"}, {0x5a7558a6,262144,"Slam Dunk - Gakeppuchi no Kesshou League (J) [S][b1]"}, {0xd5f9e016,524288,"Slam Dunk 2 - Zengoku he no TIPOFF (J) [S][b1]"}, {0xe246bdff,524288,"Small Soldiers (U) [S][b1]"}, {0xabba681d,262144,"Smurfs 3, The (UE) [b1]"}, {0x60eee11f,131072,"Sneaky Snakes (UE) [b1]"}, {0x654c92bd,65536,"Snoopy - Magic Show (U) [b1]"}, {0xed6f83db,131072,"Snow Bros Jr. (U) [b1]"}, {0x26e20d19,131072,"Snow Bros Jr. (U) [b2]"}, {0xb0eec08b,131072,"Snow Bros Jr. (U) [b3]"}, {0x2fd47c30,131072,"Soccer (E) (M3) [S][b1]"}, {0xdf8ef44d,524288,"Sonic 6 (Unl) [b1]"}, {0x98da5726,32768,"Sound Demo (PD) [b1]"}, {0x64b238cc,32769,"South Pong (PD) [a1][b1]"}, {0xd6fa7c3f,32768,"South Pong (PD) [b1]"}, {0xe2001204,524288,"Space Invaders '94 (U) [S][b1]"}, {0xa2502b99,524288,"Space Invaders '94 (U) [S][b2]"}, {0x4390d8b2,262144,"Space Invaders '94 (U) [S][b3]"}, {0x38f7e468,65536,"Spartan X (Kung-Fu Master) (J) [b1]"}, {0xf05832fb,65536,"Spartan X (Kung-Fu Master) (J) [b2]"}, {0xf2d754ca,131072,"Speed Ball 2 - Brutal Deluxe (U) [b1]"}, {0x3e04034a,262144,"Speedy Gonzales (U) [b1]"}, {0xb6d4f546,262144,"Speedy Gonzales (U) [b2]"}, {0x11d6579f,262144,"Spirou (U) (M4) [S][b2]"}, {0xc7117b50,65536,"Splitz (U) [b1]"}, {0x53b98079,262144,"Sports Illustrated for Kids - Ultimate Triple Dare! (U) [b1]"}, {0x5c6d6609,32768,"Spot (U) [b1]"}, {0xd53ecbd6,32768,"Sprite Demo (PD) [b1]"}, {0x21c1ba20,32768,"Sprite Demo (PD) [b2]"}, {0x57e954ec,32768,"Sprite Demo 2 (PD) [b1]"}, {0x41b29bf8,65536,"Square Deal - The Game of Two Dimensional Poker (U) [b1]"}, {0xccaeb3aa,131072,"Star Hawk (U) [b1]"}, {0xbe45d85e,131072,"Star Hawk (U) [b2]"}, {0xb3257951,131072,"Star Hawk (U) [b3]"}, {0x11269559,262144,"Star Sweep (J) [S][b1]"}, {0x95db7756,262144,"Star Sweep (J) [S][b2]"}, {0xd0c694cc,131072,"Star Trek - Generations - Beyond the Nexus (E) [S][b1]"}, {0xf3d4b01e,131072,"Star Trek - Generations - Beyond the Nexus (E) [S][b2]"}, {0x6c5c2f70,131072,"Star Trek - Generations - Beyond the Nexus (E) [S][b3]"}, {0xd3c1fd29,131072,"Star Trek (U) [b1]"}, {0x02fbf442,524288,"Star Wars - Super Return of the Jedi (U) [S][b1]"}, {0xb742c032,524800,"Star Wars - Super Return of the Jedi (U) [S][b2]"}, {0x858819cc,370840,"Star Wars - Super Return of the Jedi (U) [S][b3]"}, {0x0a995162,524288,"Star Wars - Super Return of the Jedi (U) [S][b4]"}, {0xfb0bfe30,139264,"Star Wars - The Empire Strikes Back (U) (Capcom) [b1]"}, {0x6e5b375f,131072,"Star Wars - The Empire Strikes Back (U) (Capcom) [b2]"}, {0x42c2fa03,131072,"Star Wars (U) (Capcom) [b1]"}, {0x61d0ded1,131072,"Star Wars (U) (Capcom) [b2]"}, {0xc51be738,131072,"Star Wars (U) (Capcom) [b3]"}, {0xe4cda867,131072,"Stargate (U) [b1]"}, {0x6081943f,524288,"Street Fighter II (J) [S][b1]"}, {0xf433dc0e,524288,"Super 139-in-1 (Unl) [b1]"}, {0xe8ae796b,524288,"Super 139-in-1 (Unl) [b2]"}, {0xc9702c1e,524288,"Super 14-in-1 (partial dump) [p1][b1]"}, {0x54c8ca20,32768,"Super 51-in-1 (Unl) [b1]"}, {0x4f17eac7,2097152,"Super 51-in-1 (Unl) [b2]"}, {0x554c6336,262144,"Super 8-in-1 (Unl) [b1]"}, {0x73e4a8b0,262144,"Super Bikkuri (J) [b1]"}, {0xc4cd765e,12288,"Super Black Bass Pocket 2 (J) [S][b1]"}, {0x1a304de2,524288,"Super Bombliss (J) [S][b1]"}, {0xcd2110f3,229376,"Super Chinese Land 3 (J) [S][b1]"}, {0x4a319922,131072,"Super Hunchback (J) [b1]"}, {0xd32d9c2a,131072,"Super Hunchback (U) [b1]"}, {0x798d0742,131072,"Super James Pond (U) [b1]"}, {0xf1b0764e,131072,"Super James Pond (U) [b2]"}, {0xde34c723,131072,"Super Kick Off (U) [b2]"}, {0xe285d5b8,65536,"Super Mario Land (V1.0) (JUA) [b1]"}, {0xb3a2a6c3,65536,"Super Mario Land (V1.0) (JUA) [b2]"}, {0x3295f12e,524288,"Super Mario Land 2 - 6 Golden Coins (V1.0) (UE) [b1]"}, {0x08e3c2cd,195072,"Super Mario Land 3 - Wario Land (JUE) [b1]"}, {0xc03058c9,524288,"Super Mario Land 3 - Wario Land (JUE) [b2]"}, {0xc8784e23,131072,"Super Off Road (U) [b1]"}, {0xfd65d0f8,65536,"Super Pachinko Wars (J) [S][b1]"}, {0x56053590,129980,"Super RC Pro-Am (UE) [b1]"}, {0x193e0f77,524288,"Super Robot War 2G (J) [S][b1]"}, {0x2b826641,38592,"Super Robot War 2G (J) [S][p1][b1]"}, {0xd81cd41b,131072,"Super Street Basketball 2 (J) [S][b1]"}, {0xbf108ad1,131072,"Swamp Thing (U) [b1]"}, {0x6a912289,131072,"Swamp Thing (U) [b2]"}, {0x45af3832,131072,"T2 - The Arcade Game (U) [b1]"}, {0xf53f28fb,131072,"T2 - The Arcade Game (U) [b2]"}, {0x3cbbffc8,131072,"T2 - The Arcade Game (U) [b3]"}, {0xda329f74,491520,"Tamagotchi (J) [S][b1]"}, {0x18a2565e,524288,"Tamagotchi 2 (J) [S][b1]"}, {0x4a2141b8,524288,"Tamagotchi 3 (J) [S][b1]"}, {0x88a39f10,32768,"Tasmania Story (J) [b1]"}, {0xbbcc7dc8,262144,"Taz-Mania (U) [b1]"}, {0xa3436cfd,262144,"Tecmo Bowl (U) [b1]"}, {0xc8c88536,262144,"Tecmo Bowl (U) [b2]"}, {0x0fb442bc,262144,"Teenage Mutant Hero Turtles - Back from the Sewers (E) [b1]"}, {0x0e53dcf5,262144,"Teenage Mutant Ninja Turtles - Back From the Sewers (U) [b1]"}, {0xc1889040,131072,"Teenage Mutant Ninja Turtles - Fall of the Foot Clan (U) [b1]"}, {0x861bb6ae,131072,"Teenage Mutant Ninja Turtles - Fall of the Foot Clan (U) [b2]"}, {0xe7cc69a5,131072,"Teenage Mutant Ninja Turtles (J) [b1]"}, {0x6d41e49e,262144,"Teenage Mutant Ninja Turtles 2 (J) [b1]"}, {0x490f63e5,131072,"Teenage Mutant Ninja Turtles III - Radical Rescue (U) [b1]"}, {0xbe8ed909,17688,"Tenchi Wokurau (J) [p1][T-Chinese][b1]"}, {0xc43d8a0a,131072,"Tenjin Kaisen - Mercenary Force (J) [b1]"}, {0x65da91e8,131072,"Tenjin Kaisen - Mercenary Force (J) [b2]"}, {0xfbb9856e,131072,"Terminator 2 - Judgment Day (UE) [b1]"}, {0x4cca7913,131649,"Terminator 2 - Judgment Day (UE) [b2]"}, {0x08561201,131072,"Terminator 2 - Judgment Day (UE) [b3]"}, {0x4f7a5468,131072,"Terminator 2 - Judgment Day (UE) [b4]"}, {0x3809953c,524288,"Tetris Attack (V1.1) (U) [S][b1]"}, {0x90180167,131072,"Tetris Blast (U) [S][b1]"}, {0xeff98bef,131072,"Tetris Flash (J) [S][b1]"}, {0x9c1822cc,131072,"Tetris Flash (J) [S][b2]"}, {0x0412c153,262144,"Tetris Plus (U) [S][b1]"}, {0xa51918ca,262144,"TinTin in Tibet (U) [S][b1]"}, {0x741653be,131072,"Tiny Toon Adventures 2 - Montana's Movie Madness (U) [b1]"}, {0x2b0f2fe5,131072,"Tiny Toon Adventures 2 - Montana's Movie Madness (U) [b2]"}, {0x31ed9f67,262144,"Titus the Fox (U) [b1]"}, {0x97c94251,262144,"Titus the Fox (U) [b2]"}, {0x6665b84b,262144,"Titus the Fox (U) [b3]"}, {0xd02b4eb1,131072,"Top Gun 2 (U) [b1]"}, {0x3c4e29b4,262144,"Top Ranking Tennis (U) [b1]"}, {0x1eb53866,262144,"Top Ranking Tennis (U) [b2]"}, {0xa8bf149b,262144,"Top Ranking Tennis (U) [b3]"}, {0x35f9f6af,131072,"Total Carnage (U) [h1][b1]"}, {0xb7ffd053,131072,"Toxic Crusaders (U) [b1]"}, {0x760215c4,131072,"Toxic Crusaders (U) [b2]"}, {0x18ba4e41,524288,"Toy Story (U) [S][b1]"}, {0xd23f5878,131072,"Track Meet (U) [b1]"}, {0xf12d7caa,131072,"Track Meet (U) [b2]"}, {0xef62ce17,131072,"Trappers Tengoku (J) [b1]"}, {0x16ae7ce3,131072,"Trax (U) [b1]"}, {0x35bc5831,131072,"Trax (U) [b2]"}, {0xa949a611,262144,"True Lies (U) [b1]"}, {0x5a6dfc51,262144,"True Lies (U) [b2]"}, {0x793a6925,229220,"True Lies (U) [b3]"}, {0xc33342ee,131072,"Turn & Burn (U) [b1]"}, {0x6bb430c1,131072,"Turrican (UE) [b1]"}, {0xc0ea387a,131072,"Turrican (UE) [b2]"}, {0x2413acaa,131072,"Twin (J) [b1]"}, {0xd8c64fda,131072,"Twin (J) [b2]"}, {0xf76abc91,262144,"Uchuu Senkan Yamato (J) [b1]"}, {0x69047717,262144,"Uchuu Senkan Yamato (J) [b2]"}, {0x8e0f77a3,131072,"Ultima - Runes of Virtue (J) [b1]"}, {0xf658649e,131072,"Ultima - Runes of Virtue (J) [b2]"}, {0x1a10bf8a,262144,"Ultima - Runes of Virtue 2 (J) [b1]"}, {0xe8092061,131072,"Ultra Golf (U) [b1]"}, {0x3bdfd160,131072,"Ultra Golf (U) [b2]"}, {0x27984a3f,131072,"Ultraman (J) [b1]"}, {0xeafed9fa,262144,"Ultraman Gekiden (J) [S][b1]"}, {0x8bd00e25,262144,"Ultraman Gekiden (J) [S][b2]"}, {0xeb3d7e53,262144,"Undercover Cops (J) [b1]"}, {0x71c68c45,262144,"Undoukai (J) [b1]"}, {0x1f9f4669,262144,"Undoukai (J) [b2]"}, {0x61171087,262144,"Undoukai (J) [b3]"}, {0x19edfd96,262144,"Undoukai (J) [b4]"}, {0xeff37c83,131072,"Uno 2 - Small World (J) [S][b1]"}, {0x51181cc1,131072,"Vattle Guice (J) [b1]"}, {0x416c86e1,262144,"Velious II (J) [b1]"}, {0xef327af9,262144,"Velious II (J) [b2]"}, {0x350f459d,131072,"Versus Hero (J) [b1]"}, {0x0a6ae533,196608,"Viking Child (U) [b1]"}, {0x81b9841d,32768,"Volley Fire (J) [b1]"}, {0x6ef82dd3,262144,"V-Rally - Championship Edition (E) (M3) [b1]"}, {0xb27cab4e,262144,"Wario Blast (U) [S][b1]"}, {0xcbe2515e,1048576,"Warioland 2 (UE) [S][b1] (MBC1 hack)"}, {0xc7778b77,1048576,"Warioland 2 (UE) [S][b1]"}, {0xb89343ae,131072,"Wave Race (UE) [b1]"}, {0x3e196f11,98304,"Wayne's World (U) [b1]"}, {0xe8126d0c,262144,"Wayne's World (U) [b2]"}, {0xc4459071,262144,"Wayne's World (U) [b3]"}, {0xb6c5582b,131072,"Wheel of Fortune (Gluecksrad) (G) [b1]"}, {0xd5d2333d,131072,"Wheel of Fortune (Gluecksrad) (G) [b2]"}, {0x1be6cbb3,131072,"Wheel of Fortune (U) [b1]"}, {0x7fe9b63d,131072,"Who Framed Roger Rabbit (U) [b1]"}, {0xbba7e6e8,262144,"Wizardry Gaiden 1 - Suffering of the Queen (J) [b1]"}, {0xd8e5f348,262144,"Wizardry Gaiden 1 - Suffering of the Queen (J) [b2]"}, {0xb54274a3,131072,"World Beach Volleyball 1991 GB Cup (J) [b1]"}, {0x7427e4a3,131072,"World Circuit Series (U) [b1]"}, {0xf98f0b68,131072,"World Cup (J) [b1]"}, {0xeed443b5,131072,"World Cup (J) [b2]"}, {0x25778e71,262144,"World Cup USA '94 (UE) [b1]"}, {0x8f9bc273,524288,"World Heroes 2 Jet (U) [S][b1]"}, {0xb2560f55,524288,"World Heroes 2 Jet (U) [S][b2]"}, {0x83872104,524288,"World Heroes 2 Jet (U) [S][b3]"}, {0x6100426d,285795,"World Heroes 2 Jet (U) [S][b4]"}, {0x32417ec5,262144,"Worms (U) [b1]"}, {0x7151cea7,262144,"Worms (U) [b2]"}, {0x8e1b4a13,32768,"WOW Super Gameboy Peep-Show (PD) [b1]"}, {0x8eea057a,262144,"WWF Raw (U) [b1]"}, {0xae0c85fc,131072,"WWF Superstars (UE) [b1]"}, {0xf34e35e6,131072,"WWF Superstars (UE) [b2]"}, {0xc7eeb57a,262144,"WWF Warzone (U) [b1]"}, {0xe9dd3cc5,262144,"Yaiba (J) [b1]"}, {0x5a7471d1,262144,"Yaiba (J) [b2]"}, {0x4c09ab1d,262144,"Yaiba (J) [b3]"}, {0x7873454e,131072,"Yogi Bear in Yogi Bear's Goldrush (E) [b1]"}, {0xc3ee1a4c,131072,"Yogi Bear in Yogi Bear's Goldrush (E) [b2]"}, {0xf5568b8c,131072,"Yogi Bear in Yogi Bear's Goldrush (E) [b3]"}, {0xb2694517,131072,"Yogi Bear in Yogi Bear's Goldrush (E) [b4]"}, {0x988b5ab7,65536,"Yoshi (U) [b1]"}, {0xb2151edc,131072,"Yoshi's Cookie (U) [b1]"}, {0x6f365098,262144,"Yuuyuu 1 (J) [b1]"}, {0x6b0ae80d,524288,"Z - Miracle of the Zone, The (J) [S][b1]"}, {0x2625b02b,524288,"Z - Miracle of the Zone, The (J) [S][b2]"}, {0x49d44022,131072,"Zen Intergalactic Ninja (E) [b1]"}, {0x0157060b,65536,"Zoop (U) [b1]"}, {0x6e844f2b,262144,"Pac-In-Time (U) [S][b1]"}, {0xef791197,131072,"Alien vs Predator - The Last of His Clan (U) [b1]"}, {0x75cdd7e3,131072,"Brain Drain (E) [S][b1]"}, {0x9cede622,262144,"Hammerin' Harry - Ghost Building Company (U) [b3]"}, {0x85df6bd8,131072,"Itchy & Scratchy - Minature Golf Madness (U) [b2]"}, {0x84589266,524288,"Legend of the River King (U) [S][b2]"}, {0xcacfe686,131072,"Maru's Mission (U) [b2]"}, {0x56189fe1,524288,"Nectaris (J) [S][b1][T-Eng_transBRC]"}, {0xc2726f3f,262144,"Puro Stadium '91 (Pro Yakyu Stadium '91) (J) [b1]"}, {0xe5eaebb5,262144,"Spirou (U) (M4) [S][b1]"}, {0x03cf9702,131072,"Super Kick Off (U) [b1]"}, {0x905e8cb7,131072,"Tensai Bakabon (J) [b1]"}, {0x26b8cd85,131072,"WCW Main Event (U) [b1]"}, {0x351a8615,262144,"Mortal Kombat 3 (U) [b2]"}, {0x1eae0e10,524288,"Harvest Moon GB (U) [S][!]"}, {0xe0cd811a,32768,"128-in-1 Menu (1993) (Unl) [a1]"}, {0x11c6229f,131072,"128-in-1 Menu (1993) (Unl)"}, {0x1d0f279c,131072,"2nd Space (Game 2 of Sachen 4-in-1 Volume 6) (Unl) [!]"}, {0xb61cd120,131072,"3 Choume no Tama - Tama & Friends (J)"}, {0xcafe0d2b,65536,"3 Pun Yosou - Umaban Club (J)"}, {0x0e0216e6,131072,"4-in-1 Funpak (UE) [!]"}, {0x75004583,32768,"55 Game HK (Unl) [p1]"}, {0xe3c8b0c0,524288,"8-in-1 (Sachen) (Unl)"}, {0x7ff546df,262144,"Ace Striker (J)"}, {0x28fa451e,131072,"Addams Family, The (E) (M3) [!]"}, {0x4c749c14,131072,"Addams Family, The (J) [!]"}, {0xc170a732,131072,"Addams Family, The (U)"}, {0x64f4fa44,131072,"Adventure Island (U)"}, {0xf1071e08,131072,"Adventure Island 2 - Bikkuri Nekketou (J)"}, {0x783066cf,262144,"Adventure Island 2 (UE) [!]"}, {0x176d2eeb,262144,"Adventures of Lolo (U) [S][!]"}, {0x0b9de1dc,65536,"Adventures of Pinocchio, The (U)"}, {0xdafdee3c,131072,"Adventures of Rocky and Bullwinkle, The (U) (Beta1)"}, {0x362c841c,131072,"Adventures of Rocky and Bullwinkle, The (U) (Beta2)"}, {0x74c700a4,131072,"Adventures of Rocky and Bullwinkle, The (U)"}, {0x5d461374,131072,"Adventures of Star Saver, The (U) [!]"}, {0xdfa3b28a,131072,"Aero Star (J) [!]"}, {0xf6fd275e,131072,"Aero Star (U) [!]"}, {0x776d03dc,65536,"A-Force (Game 4 of Sachen 4-in-1 Volume 6) (Unl) [!]"}, {0xc0049d77,65536,"After Burst (J)"}, {0xe82692d9,262144,"Aguri Suzuki F-1 Super Driving (J)"}, {0x5bffcc28,131072,"Ah Harimanada (J) [!]"}, {0x898609b4,262144,"Akazukin Cha-Cha (J) [S]"}, {0xaf6bdc50,262144,"Aladdin (U) [S][!]"}, {0x283c58b7,262144,"Aladdin (U) [S][a1]"}, {0x1089098f,262144,"Alfred Chicken (J) [S]"}, {0x3b9c3bc6,131072,"Alfred Chicken (U) [!]"}, {0xe59049b2,131072,"Alien 3 (J) [!]"}, {0xeffb960b,131072,"Alien 3 (U)"}, {0x583c0e4e,131072,"Alien Olympics 2044 AD (U)"}, {0xe884682b,131072,"Alien vs Predator - The Last of His Clan (J)"}, {0x4bbcf652,131072,"Alien vs Predator - The Last of His Clan (U) [!]"}, {0x5cc01586,32768,"Alleyway (JUA) [!]"}, {0x24d5f785,131072,"Altered Space (E) [!]"}, {0xce36e36e,131072,"Altered Space (J)"}, {0x141675d3,131072,"Altered Space (U)"}, {0x3011d5ca,65536,"Amazing Penguin (U) [!]"}, {0x13dd233f,131072,"Amazing Spider-Man 2, The (UE) [!]"}, {0xcbb2f22c,131072,"Amazing Spider-Man 3, The - Invasion of the Spider-Slayers (U) [!]"}, {0x2a4eafe4,65536,"Amazing Spider-Man, The (UE) [!]"}, {0xd229ac62,65536,"Amazing Tater (U)"}, {0x3be275cd,262144,"America Oudan Ultra Quiz (J) [!]"}, {0x1b3231c8,262144,"America Oudan Ultra Quiz 2 (J) [!]"}, {0x80cac37c,262144,"America Oudan Ultra Quiz 3 (J) [!]"}, {0xa76043c8,262144,"America Oudan Ultra Quiz 4 (J) [!]"}, {0x60128aa8,32768,"Amida (J)"}, {0x1132c6bb,262144,"Angel Marlowe (J)"}, {0xc2eec22f,524288,"Animal Breeder (J) [S]"}, {0x8d573f37,524288,"Animal Breeder 2 (J) [S]"}, {0x673c815d,262144,"Animaniacs (U) [S][!]"}, {0x4a486435,524288,"Another Bible (J) [S]"}, {0xb4a5936e,131072,"Ant Soldiers (Sachen) (Unl) [!]"}, {0x08727760,262144,"Aoki Densetsu Shoot (J) [S][!]"}, {0x1db65649,131072,"Aretha (J)"}, {0x086e4fc5,262144,"Aretha 2 (J)"}, {0x430d3d6b,262144,"Aretha 3 (J)"}, {0xeefe1001,32768,"Artic Zone (Game 1 of Sachen 4-in-1 Volume 5) (Unl) [!]"}, {0x097ffe2c,131072,"Asterix (UE) (M5) [!]"}, {0x8259ac54,131072,"Asteroids & Missile Command (U) [S][!]"}, {0xc1f88833,32768,"Asteroids (U)"}, {0x61e48eef,65536,"Astro Rabby (J)"}, {0x471c237b,262144,"Athena no Hatena (J)"}, {0xc4720897,131072,"Atomic Punk (U) [!]"}, {0x23068679,131072,"Attack of the Killer Tomatoes (J)"}, {0xb5b38860,131072,"Attack of the Killer Tomatoes (U) [!]"}, {0xcf2ba5f7,262144,"Avenging Spirit (U)"}, {0xda90f5fc,65536,"Ayakashi no Siro (J) [!]"}, {0x84de5363,524288,"Ayanama Discovery SlideShow (V1.1) (Unl)"}, {0xd1c3f371,131072,"Bakenoh TV (J) [S]"}, {0x4e2fffe5,131072,"Bakenoh V3 (J)"}, {0xd4b655ec,131072,"Balloon Kid (JUE) [!]"}, {0xca0ba8e6,131072,"Balloon Kid (JUE) [BF]"}, {0x1b713de0,131072,"Bamse (E) (Swedish)"}, {0x3d13ec6a,131072,"Banishing Racer (J)"}, {0x94c26cdf,131072,"Barbie - Game Girl (U)"}, {0x6eea2526,65536,"Baseball (JU) [!]"}, {0xa503cb07,131072,"Baseball Kids (J)"}, {0xd37a2fdf,131072,"Bases Loaded (U) [!]"}, {0xde459a47,131072,"Batman - Return of the Joker (J)"}, {0x5124bbec,131072,"Batman - Return of the Joker (U) [!]"}, {0x77cd0351,131072,"Batman - The Animated Series (U) [BF]"}, {0xc8e578bf,131072,"Batman - The Animated Series (U)"}, {0x6c41d3cd,131072,"Batman (JU) [!]"}, {0xc2fd6244,262144,"Batman Forever (J)"}, {0xef3592cc,262144,"Batman Forever (U) [!]"}, {0xce34cca4,524288,"Battle Arena Toshinden (E) [S]"}, {0xdde161a5,524288,"Battle Arena Toshinden (J) [S]"}, {0x2d0c1073,524288,"Battle Arena Toshinden (U) [S][!]"}, {0xd4d1aea2,131072,"Battle Bull (E) [!]"}, {0x5c69e449,131072,"Battle Bull (J)"}, {0xea4eb1a1,262144,"Battle Crusher (J) [S]"}, {0xa99242c0,131072,"Battle Dodge Ball (J)"}, {0x35914deb,131072,"Battle of Kingdom (J)"}, {0xca450e93,262144,"Battle of Olympus, The (UE) (M5)"}, {0x7c787bc4,65536,"Battle Pingpong (J)"}, {0xa828fd4f,65536,"Battle Space (J)"}, {0xa1a1fe77,131072,"Battle Unit Zeoth (J)"}, {0xe67a92b3,131072,"Battle Unit Zeoth (U) [!]"}, {0x6c292739,262144,"Battle Zone & Super Breakout (U) [S]"}, {0xa37a814a,32768,"BattleCity (J) [p1][!]"}, {0xfef62da5,65536,"Battleship (U) (GB) [!]"}, {0x7b217082,262144,"Battletoads & Double Dragon (E) (Sony Imagesoft) [!]"}, {0xa727f9cd,262144,"Battletoads & Double Dragon (U) (Tradewest)"}, {0x331cf7de,131072,"Battletoads (J)"}, {0xb0c3361b,131072,"Battletoads (U) [!]"}, {0x7ffc34ea,131072,"Battletoads in Ragnarok's World (U) (Nintendo) [!]"}, {0xce316c68,131072,"Battletoads in Ragnarok's World (U) (Tradewest)"}, {0xc28ef062,262144,"BC Kid 2 (J) [S]"}, {0x20af727a,262144,"BC Kid 2 (J) [S][BF]"}, {0xabfb84df,262144,"Beach Volleyball (J) [S]"}, {0xaf1ae123,524288,"Beavis and Butthead (U) [!]"}, {0x637e54e3,131072,"Beethoven's 2nd (U) [S]"}, {0x13713993,131072,"Beethoven's 2nd (U) [S][BF]"}, {0x33574ecb,131072,"Beetlejuice (U)"}, {0x80485fda,131072,"Berlitz French Language Translator (U)"}, {0x058eeedb,131072,"Berlitz Spanish Language Translator (U)"}, {0xad3f851d,524288,"Berutomo Kurabu (J) [S][!]"}, {0xb20280e6,262144,"Best of the Best - Championship Karate (U) [!]"}, {0x86d11d10,262144,"Bikkuri Nekketu (J)"}, {0x5e8f656a,131072,"Bill and Ted's Excellent GB Adventure (UE) [!]"}, {0x71cf43ce,131072,"Bill Elliott's NASCAR Fast Tracks (U)"}, {0xa1e55dc2,65536,"Bionic Battler (U)"}, {0x3f4d5c84,262144,"Bionic Commando (J)"}, {0xc2763e73,131072,"Bishojyo Sensi SE (J)"}, {0x2db3dace,262144,"Black Bass - Lure Fishing (U) (GB) [!]"}, {0x3d4e1779,65536,"Black Forest Tale (Game 3 of Sachen 4-in-1 Volume 6) (Unl)[!]"}, {0xf7be0002,131072,"Blades of Steel (AE) (GB) [!]"}, {0xe81c9fb9,131072,"Blades of Steel (U) (GB) [!]"}, {0x3b2c7118,131072,"Blaster Master Boy (U)"}, {0xe9f9016f,131072,"Blaster Master Jr. (E)"}, {0x54b67501,131072,"Block Kuzushi (J) [S]"}, {0x425357fb,131072,"Block Kuzushi (J) [S][BF]"}, {0x51ff6e53,65536,"Blodia (J)"}, {0xf1c0fb1d,131072,"Blues Brothers, The - Jukebox Adventure (U)"}, {0xadb66eff,131072,"Blues Brothers, The (U) [!]"}, {0x7edb78ab,131072,"Bo Jackson Hit and Run (U) [!]"}, {0x70c8c799,131072,"Boggle Plus (U) [!]"}, {0xe8335398,262144,"Boku Drakura Kun (J)"}, {0x7582ae14,131072,"Boku Drakura Kun 2 (Castlevania 2) (J)"}, {0x4825b25f,262144,"Boku Drakura Kun 3 (CV Legends) (Akumajo Dracula) (J) [S][!]"}, {0xd3e2fd02,524288,"Bokujo Monogatari GB (V1.0) (J) [S]"}, {0x2a9b916e,524288,"Bokujo Monogatari GB (V1.0) (J) [S][BF]"}, {0xda218e44,524288,"Bokujo Monogatari GB (V1.1) (J) [S]"}, {0xc2a85d91,32768,"Bomb Disposer (Game 1 of Sachen 4-in-1 Volume 6) (Unl) [!]"}, {0x9bd8815e,32768,"Bomb Jack (U)"}, {0xef9595ac,131072,"Bomber Boy (J)"}, {0xb8fe9077,131072,"Bomber King - Scenario 2 (J)"}, {0x509a6b73,1048576,"Bomberman Collection (J) [S]"}, {0x94337d56,262144,"Bomberman GB (J) [S]"}, {0x291fd094,262146,"Bomberman GB (J) [S][BF1]"}, {0x7036a955,262144,"Bomberman GB (J) [S][BF2]"}, {0xf372d175,262144,"Bomberman GB (U) [S][!]"}, {0x1ff116e5,262144,"Bomberman GB (U) [S][BF]"}, {0x6157443b,262144,"Bomberman GB 2 (J) [S]"}, {0xf658b7a7,262144,"Bomberman GB 3 (J) [S]"}, {0x07e7a85f,262144,"Bomberman GB 3 (J) [S][a1]"}, {0xf63b5c06,262144,"Bomberman GB 3 (J) [S][BF]"}, {0xa7cdbb96,262144,"Bonk's Adventure (U) [!]"}, {0x5d131d5c,262144,"Bonk's Adventure (U) [BF]"}, {0xf1344b78,262144,"Bonk's Revenge (U) [S][!]"}, {0xec83c0b6,262144,"Booby Boys (J)"}, {0xa817450d,65536,"Boomer's Adventure in ASMIK World (J)"}, {0x105bc1c0,65536,"Boomer's Adventure in ASMIK World (U)"}, {0xcaae6b11,131072,"Boomer's Adventure in ASMIK World 2 (J)"}, {0xb5b3f85b,65536,"Boulder Dash (J)"}, {0x644aec3e,65536,"Boulder Dash (U) [!]"}, {0xef7e9fa0,65536,"Boxing (JU)"}, {0xc09cee99,32768,"Boxxle (V1.1) (U) [!]"}, {0xc08e9756,32768,"Boxxle 2 (U)"}, {0x3d0bac10,65536,"Boy and His Blob, A - Fushigina Bulobi (J)"}, {0x25f82bb1,65536,"Boy and His Blob, A - Rescue of Princess Blobette (E)(Img)[!]"}, {0x8210a03f,65536,"Boy and His Blob, A - Rescue of Princess Blobette (U)(Abs)[!]"}, {0xd808752b,65536,"Boy and His Blob, A - Rescue of Princess Blobette (U)(Abs)[BF]"}, {0x8a7fb0e6,131072,"Brain Drain (E) [S]"}, {0xe558aacd,131072,"Brain Drain (J) [S]"}, {0xaff0b159,131072,"Brain Drain (U) [S][!]"}, {0xfbb1f2a1,32768,"Brainbender (U) [!]"}, {0x00cd1876,131072,"Bram Stoker's Dracula (U)"}, {0x46e9fb29,131072,"Break Thru! (U) [BF]"}, {0x5b8f0df2,131072,"Break Thru! (U)"}, {0xad9b300c,131072,"Bubble Bobble (J)"}, {0xd516841d,131072,"Bubble Bobble (U) (GB) [!]"}, {0x39e261b9,131072,"Bubble Bobble Jr. (J)"}, {0x3a98fe03,131072,"Bubble Bobble Part 2 (U) [!]"}, {0x874d0d6f,32768,"Bubble Ghost (J)"}, {0x843068fd,32768,"Bubble Ghost (U) [!]"}, {0xa973e604,131072,"Bugs Bunny - Crazy Castle II (U) [!]"}, {0x403e1b7e,65536,"Bugs Bunny (U) [!]"}, {0xd2dbea8f,262144,"Bugs Bunny Collection (V1.0) (J) [S]"}, {0x8244220b,262144,"Bugs Bunny Collection (V1.1) (J) [S]"}, {0x5a1a20f3,65536,"Burai Fighter Deluxe (J)"}, {0x3c86f5db,65536,"Burai Fighter Deluxe (UE) [!]"}, {0x88219a49,65536,"Burger Time Deluxe (JU) [!]"}, {0x88f8c991,131072,"Burning Paper (J)"}, {0xb94724e6,131072,"Bust-a-Move 2 (U)"}, {0xe555c612,131072,"Bust-a-Move 3 (U)"}, {0xb4245ca3,131072,"Buster Brothers (U)"}, {0x9234eeab,65536,"Ca Da (J)"}, {0xa6c98122,65536,"Cadillac 2 (J)"}, {0x000aaa74,131072,"Caesar's Palace (J)"}, {0xd9f901a9,131072,"Caesar's Palace (U)"}, {0x8042afc5,262144,"Capcom Quiz (J)"}, {0x6b4fefb0,131072,"Captain Knick-Knack (Sachen) (Unl) [!]"}, {0x33a1e1cf,524288,"Captain Tsubasa (J) [S][!]"}, {0xa795e851,262144,"Captain Tsubasa VS (J)"}, {0xd05f4c90,65536,"Card Game (J)"}, {0x2a25e4d2,131584,"Casino Funpak (U) [!]"}, {0xe4b30634,131072,"Casper (U) (Bonsai Software) [S]"}, {0xe67a10e1,131072,"Casper (U) (Natsume) [!]"}, {0x2f752404,32768,"Castelian (E) [!]"}, {0xf2d739e4,32768,"Castelian (U)"}, {0x2f8aaf6f,131072,"Castle Quest (U) [!]"}, {0xe89eac54,262144,"Castlevania - Legends (G) [S]"}, {0xad9c17fb,262144,"Castlevania - Legends (U) [S]"}, {0x8875c8fe,131072,"Castlevania 2 - Belmont's Revenge (U) [!]"}, {0x216e6aa1,65536,"Castlevania Adventure, The ('89) (U) [!]"}, {0x6977c265,65536,"Castlevania Adventure, The ('91) (UE) [!]"}, {0xadb96150,32768,"Catrap (U) [!]"}, {0x44256a2f,131072,"Cave Noire (J)"}, {0x245afcdc,32768,"Centipede (E) (Accolade) [!]"}, {0xe957014f,131072,"Centipede (U) (Majesco)"}, {0xaa920298,65536,"Chacha Maru Panic (J)"}, {0x9dfd4bc0,131072,"Chachamaru Boukenki 3 - Abyss no Tou (J)"}, {0x59579caa,32768,"Challenger GB BIOS (Unl) [!]"}, {0x74d50b47,524288,"Chalvo 55 - Super Puzzle Action (J)"}, {0xef02beb6,131072,"Championship Pool (UE) [!]"}, {0xc58bb4f5,131072,"Chase HQ (J)"}, {0x0c1d2b68,65536,"Chessmaster, The (V1.0) (UE) [!]"}, {0x59ed370c,65536,"Chessmaster, The (V1.1) (UE) [!]"}, {0x886049f9,131072,"Chibi Maruko Chan - Maruko Deluxe Gekijou (J) [S]"}, {0xeab175ff,65536,"Chibi Maruko Chan - Okozukaidaisakusen (J)"}, {0xabff3314,131072,"Chibi Maruko Chan 2 - Deluxe Maruko World (J)"}, {0x44e933c8,131072,"Chibi Maruko Chan 3 - Mezase! Game Taishou no Maki (J)"}, {0xe55138be,131072,"Chibi Maruko Chan 4 - Korega Nihon Dayo Ouji Sama (J)"}, {0xeb33f601,32768,"Chiki Chiki Tengoku (J)"}, {0x7e40044a,131072,"Chiki Race (J) [!]"}, {0xb526a116,1048576,"Chinese Fighter (J) [S]"}, {0x7a102366,1048576,"Chinese Fighter (J) [S][BF]"}, {0x5109f484,131072,"Choplifter 2 (J)"}, {0x5e2e4e19,131072,"Choplifter 2 (U) (JVC - Broderbund)"}, {0x9c7d5e79,131072,"Choplifter 2 (U) (LucasArts - Broderbund)"}, {0x1b3b46ef,131072,"Choplifter 3 (UE) [!]"}, {0xc5951d9e,131072,"Chuck Rock (U) [!]"}, {0xe4271f4b,262144,"Chuugaku Eijukugo 350 (J)"}, {0xd3168eca,262144,"Chuugaku Eitango 1700 (J)"}, {0xaa133439,131072,"Cliffhanger (U)"}, {0x5f466d56,1048576,"Cokemon V0.8 (Pokemon Blue Hack)"}, {0x0627029c,1048576,"Cokemon V1.3 (Pokemon Blue Hack)"}, {0xa549a572,524288,"College Slam (U) [!]"}, {0xcde6de15,131072,"Contra - The Alien Wars (J)"}, {0xf1c81eb0,131072,"Contra - The Alien Wars (U) [S][!]"}, {0x7fc22df5,131072,"Contra Spirits (J) [S][!]"}, {0xe045b886,32768,"Cool Ball (E) [!]"}, {0x0ef6c31d,131072,"Cool Spot (U) [BF]"}, {0x1987eacc,131072,"Cool Spot (U)"}, {0xa193c0d0,131072,"Cool World (U)"}, {0x80b21df1,131072,"Cosmo Tank (J)"}, {0x2e767d25,131072,"Cosmo Tank (U)"}, {0x2699942c,131072,"Crayon Shin Chan (J)"}, {0xca6e0be0,131072,"Crayon Shin Chan 2 (J)"}, {0x24a12807,131072,"Crayon Shin Chan 3 - Ora no Gokigen Athletic (J)"}, {0x37d4aa8c,131072,"Crayon Shin Chan 4 (J) [S]"}, {0xdc723a9e,262144,"Crayon Shin Chan 5 (J) [S]"}, {0xcd6e3136,65536,"Crazy Burger (Sachen) (Unl) [!]"}, {0x51300cfd,32768,"Crystal Quest (U)"}, {0xc3eb82ef,262144,"Cult Master - Ultraman ni Miserarete (J)"}, {0xeebdd360,262144,"Cutthroat Island (U)"}, {0x72b42ea7,131072,"Cyber Formula GPX (J)"}, {0x9d00da55,65536,"Cyraid (U) [!]"}, {0xb6b51fce,32768,"Daedalean Opus (U)"}, {0x798d9489,262144,"Daffy Duck - The Marvin Missions (J) [S]"}, {0x13dd647d,131072,"Daffy Duck - The Marvin Missions (UE) [!]"}, {0xc47671f3,262144,"Daffy Duck - The Marvin Missions (UE) [S][!]"}, {0xc8f80d90,131072,"Daisenryaku Hiro (J)"}, {0xaabc00f6,32768,"Dan Laser (Sachen) (Unl) [!]"}, {0xff858da9,131072,"Darkman (U)"}, {0x238b9646,131072,"Darkwing Duck (U) [!]"}, {0x97be9341,65536,"Daruman Busters (J) [BF]"}, {0xa66f5c02,65536,"Daruman Busters (J)"}, {0xa8301bdd,65536,"Dead Heat Scramble (J)"}, {0x9e3e3656,65536,"Dead Heat Scramble (U)"}, {0x44e97af9,65536,"Deep - Final Mission (Sachen) (Unl) [!]"}, {0x1c829ce3,131072,"Defender-Joust (U) [S]"}, {0x896a30a8,131072,"Dennis (the Menace) (E) [!]"}, {0x7eb0cd32,131072,"Dennis the Menace (U) [!]"}, {0xb700f7f7,262144,"Desert Strike - Return to the Gulf (E) (Ocean) [S]"}, {0x6a702c32,262144,"Desert Strike - Return to the Gulf (U) (Malibu) [S][!]"}, {0x3945bc0d,262144,"Detective Conan (J) [S]"}, {0x1dc5c31a,262144,"Detective Conan 2 (J) [S]"}, {0x659e2283,65536,"Dexterity (U) [!]"}, {0xa308b86b,131072,"Dick Tracy (U)"}, {0x478f573c,262144,"Die Maus (E) (M4)"}, {0x6c742478,131072,"Dig Dug (U) [!]"}, {0x3f0aafec,262144,"Dino Breeder (V1.0) (J) [S]"}, {0x5b289ab4,262144,"Dino Breeder (V1.1) (J) [S]"}, {0x05a3ab7a,524288,"Dino Breeder 2 (J) [S]"}, {0x43af45b1,131072,"Dirty Racing (J)"}, {0xe285cf30,524288,"Disney's Mulan (U) [S]"}, {0xfb291e78,262144,"DMG Gariba Boui (J) [S]"}, {0x7eaf671a,131072,"Dodge Ball (J)"}, {0xf58dc358,131072,"Dodge Boy (J)"}, {0xba595897,262144,"Dodge Danpei (J)"}, {0xedab3378,524288,"Donkey Kong (V1.0) (JU) [S][!]"}, {0xf777a5d8,524288,"Donkey Kong (V1.1) (JU) [S][!]"}, {0x9aeca05c,524288,"Donkey Kong Land (J)"}, {0x49dc0d37,524288,"Donkey Kong Land (U) [S][!]"}, {0x2827e5d4,524288,"Donkey Kong Land 2 (UE) [S][!]"}, {0xb40c159c,524288,"Donkey Kong Land 3 (U) [S][!]"}, {0xa42524a3,131072,"Doraemon (J)"}, {0x843bd5bc,131072,"Doraemon 2 (J)"}, {0xb368e717,262144,"Doraemon DX 10 (J) [S]"}, {0xdd4e588f,262144,"Doraemon Kart (J) [S]"}, {0xa35b9ef5,65536,"Dorakyura Densetsu (Castlevania Adventure) (J)"}, {0xa0645e8a,131072,"Double Dragon (J)"}, {0x40a8bf12,131072,"Double Dragon (U) [!]"}, {0x5b96e474,131072,"Double Dragon 2 (U)"}, {0xfc970aef,131072,"Double Dragon 3 (U) [!]"}, {0xee28749d,131072,"Double Dribble - 5 on 5 (U) [!]"}, {0x252c32b5,131072,"Double Yakuman (J)"}, {0xa3d77a55,131072,"Double Yakuman 2 (J)"}, {0x34ac7268,131072,"Double Yakuman Jr (J)"}, {0x3d04b8e7,131072,"Dr. Franken (J)"}, {0xd409375b,131072,"Dr. Franken (U) [!]"}, {0xf13a60b8,262144,"Dr. Franken (U) [a1]"}, {0x0d62473d,262144,"Dr. Franken II (UE) (M7) [!]"}, {0x10c98dd1,32768,"Dr. Mario (V1.0) (JU) [!]"}, {0xf0225dd0,32768,"Dr. Mario (V1.1) (J)"}, {0x38da46d7,262144,"Dragon Ball Z - Goku Hishouden (J) [S]"}, {0xff3c027d,524288,"Dragon Ball Z Goku 2 (J) [S]"}, {0x8d089356,524288,"Dragon Heart (F)"}, {0x5129a518,524288,"Dragon Heart (U) [!]"}, {0x308a2465,32768,"Dragon Slayer (J)"}, {0x10dcbdc3,131072,"Dragon Slayer 2 (Dorasure Gaiden) (J) [!]"}, {0x1d1155af,131072,"Dragon Tail (J)"}, {0x00a14889,131072,"Dragon's Lair - The Legend (E) (Elite Systems) [!]"}, {0x7a38b5c3,131072,"Dragon's Lair - The Legend (U) (CSG Imagesoft) [!]"}, {0x73c994a0,131072,"Dragon's Lair (J)"}, {0x6cb45fc6,32768,"Dropzone (U) (GB)"}, {0xd25f3b3c,131072,"Duck Adventures (Game 4 of Sachen 4-in-1 Volume 1) (Unl) [!]"}, {0x5b5410f5,65536,"Duck Tales (J)"}, {0xac6483dc,65536,"Duck Tales (U) (Nintendo of America) [!]"}, {0x2bbbb54d,65536,"Duck Tales (U) (Nintendo) [!]"}, {0x169b00c1,131072,"Duck Tales 2 (E)"}, {0x2b693cde,131072,"Duck Tales 2 (J)"}, {0xb151509d,131072,"Duck Tales 2 (U) [!]"}, {0x11be4b45,131072,"Dungeonland (J)"}, {0x8f3e7f95,65536,"DX Baken Oh (J) [!]"}, {0xfadfd0f6,131072,"DX Bakenoh Z (V1.1) (J)"}, {0x9677d157,131072,"Dynablaster (E) [!]"}, {0x259ff267,262144,"Earthworm Jim (U) [!]"}, {0xcb89108f,262144,"Earthworm Jim (U) [a1]"}, {0xca20c594,262144,"Eijukugo Target 1000 (J)"}, {0x9c0d14c3,262144,"Eitango Center 1500 (J)"}, {0xf8406560,262144,"Eitango Target 1900 (J)"}, {0xb749a927,65536,"Elevator Action (U) [!]"}, {0xf54158a6,131072,"Elite Soccer (U) [S]"}, {0x800226a9,262144,"Exchanger (J) [S]"}, {0xe5541ff5,32768,"Explosive Brick '94 (Sachen) (Unl) [!]"}, {0x19608641,131072,"Extra Bases! (U) [!]"}, {0xfac1f53b,65536,"F-1 Boy (J) [!]"}, {0x9054413f,131072,"F-1 Race (G) [!]"}, {0x7e4febdf,131072,"F-1 Race (V1.0) (JUE) [!]"}, {0xab83bd70,131072,"F-1 Race (V1.1) (JUE) [!]"}, {0xf9e08783,131072,"F-1 Spirit (J) [!]"}, {0x045dee8c,131072,"F-15 Strike Eagle (U) [!]"}, {0x7d890cd0,131072,"Faceball 2000 (U) [!]"}, {0xcdfd660a,131072,"Fairy Tale's Club (J)"}, {0xd6ef1450,131072,"Family Jockey (J)"}, {0x0325e729,131072,"Family Jockey 2 (J)"}, {0x3d3c059e,131072,"Famista (J)"}, {0x241a6e4c,131072,"Famista 2 (J)"}, {0xbdc4ccc3,262144,"Famista 3 (J)"}, {0x59285f0a,131072,"Fastest Lap (JU) [!]"}, {0x8d1a9b16,131072,"Felix the Cat (U) [BF]"}, {0xf53f7f00,131072,"Felix the Cat (U)"}, {0xa7bdfec8,131072,"Ferrari - Grand Prix Challenge (J)"}, {0x954d2724,131072,"Ferrari - Grand Prix Challenge (U) [BF]"}, {0x87d0637b,65536,"Ginga (J)"}, {0xed6771db,131072,"Ferrari - Grand Prix Challenge (U) [!]"}, {0xffd4a9e3,262144,"Fidgetts, The (J)"}, {0xb3fd3e36,262144,"Fidgetts, The (UE) (M7) [!]"}, {0xe5989908,524288,"FIFA International Soccer (U) [S]"}, {0xce2eae31,524800,"FIFA Soccer '97 (U) [S]"}, {0xcdf6a5ac,524288,"FIFA Soccer '98 (U) [S]"}, {0x723eb882,131072,"Fighbird GB (J) [a1]"}, {0x4dafb6a9,131072,"Fighbird GB (J)"}, {0x52678ae8,131072,"Fighting Simulator 2-in-1 (Flying Warriors) (U) [!]"}, {0xa6b6e233,524288,"Final Fantasy 4 (Unl) (Chinese)"}, {0x18c78b3a,262144,"Final Fantasy Adventure (U) [!]"}, {0x8046148f,131072,"Final Fantasy Legend (Sa-Ga) (U) [!]"}, {0x58314182,262144,"Final Fantasy Legend II (Sa-Ga 2) (U) [!]"}, {0x3e454710,262144,"Final Fantasy Legend III (Sa-Ga 3) (U) [!]"}, {0xe94a6942,65536,"Final Reverse (J)"}, {0x275947f5,65536,"Fire Dragon (J) (Chinese)"}, {0xdc1f9237,131072,"Fire Fighter (U) [BF]"}, {0xc46bbd49,131072,"Fire Fighter (U)"}, {0x4b929719,65536,"Fish Dude (U)"}, {0x9a84b6cf,131072,"Fist of the North Star (U) [!]"}, {0x3b6cdda4,32768,"Flappy Special (J)"}, {0x6deb1f06,131072,"Flash, The (U) [!]"}, {0x71bf3256,262144,"Fleet Commander VS (J)"}, {0x508282d0,131072,"Flintstones, The - King Rock Treasure Island (U)"}, {0x503d3613,262144,"Flintstones, The (U) [!]"}, {0x198f147d,32768,"Flipull (J)"}, {0xa2f30b4b,32768,"Flipull (U) [!]"}, {0xe98fa051,262144,"Flipull (Unl) [p1]"}, {0xae6ad4c8,262144,"Flipull (Unl) [p2]"}, {0x6e659690,131072,"Football International (U)"}, {0x860ea816,262144,"Foreman for Real (J)"}, {0x77083ae0,262144,"Foreman for Real (U) [!]"}, {0x9a494ae6,524288,"Frank Thomas' Big Hurt Baseball (U) [!]"}, {0x10713b07,524288,"Frank Thomas' Big Hurt Baseball (U) [BF]"}, {0x0bef84a1,131072,"Frisky Tom (J) [S]"}, {0xca436939,65536,"Frommer's Personal Organizer (U)"}, {0x40242e35,262144,"Frommer's Travel Guide (U) [!]"}, {0xbfd87aa4,65536,"Funny Field (J)"}, {0x86f45343,131072,"Funpack 4-in-1 (JU)"}, {0x018b4a02,131072,"Funpack 4-in-1 Vol. 2 (JU)"}, {0x2962afb4,524288,"Furai no Siren (J) [S]"}, {0x150bc291,65536,"G1 King - 3 Biki no Yosouya (J)"}, {0xd06b3f8a,131072,"Galaga & Galaxian (E) [S][!]"}, {0x532036d5,131072,"Galaga & Galaxian (J) [S]"}, {0x6a6ecfec,131072,"Galaga & Galaxian (U) [S]"}, {0x53dcf5da,131072,"Galaga & Galaxian (U) [S][BF]"}, {0x96ecc1e0,262144,"Game & Watch Gallery (E) [S][!]"}, {0x99b2fe79,262144,"Game & Watch Gallery (V1.0) (U) [S]"}, {0x9e6cdc96,262144,"Game & Watch Gallery (V1.1) (U) [S][!]"}, {0x9359a183,524288,"Game & Watch Gallery 2 (J) [S]"}, {0xd2d6ee5b,1048576,"Game & Watch Gallery 2 (U) [S]"}, {0xcacb6d23,32768,"Game Genie (Unl)"}, {0xb0074acb,32768,"Game of Harmony, The (U)"}, {0x09f53d55,262144,"Game of Life, The - Jinsei Game (J) [S]"}, {0xd6909596,131072,"Game Shark (Unl)"}, {0x4640909f,1048576,"Gameboy Camera (UEA) [S][!]"}, {0xa1a3f786,1048576,"Gameboy Camera Gold - Zelda Edition (U) [S]"}, {0xa93e125b,262144,"Gameboy Gallery (J) [S]"}, {0x263fd152,131072,"Gameboy Gallery (U) [S]"}, {0x6b09508f,262144,"Gameboy Gallery 2 (A) [S][!]"}, {0x5691f050,32768,"Gameboy Smart Card (CCL dumper) (Unl) [a1]"}, {0x2d4ab235,33280,"Gameboy Smart Card (CCL dumper) (Unl) [a2]"}, {0x3ded272e,32768,"Gameboy Smart Card (CCL dumper) (Unl) [S]"}, {0x10e413e6,4096,"Gameboy Smart Card (CCL dumper) (Unl)"}, {0xff709f3e,262144,"Gameboy Wars (J)"}, {0x94563424,524288,"Gameboy Wars Turbo (J) [S]"}, {0x86d04bfb,262144,"Gameboy Wars Turbo (J) [S][a1]"}, {0x62769ec1,262144,"Gamera - Daikai Jukutyu Kessen (J) [S]"}, {0xb85d4bd8,262144,"Gamera - Daikai Jukutyu Kessen (J) [S][BF]"}, {0x33261c11,262144,"Ganbare Goemon (J)"}, {0x910afe24,262144,"Ganbare Goemon 2 (J) [S]"}, {0x6226d280,131072,"Ganbaruga (J)"}, {0x6a043abd,131072,"Garfield Labyrinth (U)"}, {0x0030e61f,131072,"Gargoyle's Quest - Ghosts'n Goblins (UE) [!]"}, {0xfe19069a,131072,"Gargoyle's Quest - Ghosts'n Goblins (UE) [BF]"}, {0x1907dac5,262144,"Gauntlet II (U)"}, {0x147e82ae,524288,"Gawa no Kawanushi 3 (J) [S]"}, {0xd9b24d21,131072,"GB Basketball (Tip-Off) (J)"}, {0x1e8808d1,32768,"GB Gamejack 16M (Unl) (GB)"}, {0x31728038,2097152,"GB Gamejack 16M Test (Unl)"}, {0x60c4c47f,32768,"GB Gamejack 16M V2.00 (Unl)"}, {0x5236e5f7,32768,"GB Gamejack 64M (Unl) (GB)"}, {0x690227f6,262144,"GB Genjin (Bonk) (J) [!]"}, {0x6f7ad5d9,262144,"GB Genjin 2 (Bonk's Revenge) (J) [S][!]"}, {0xa4a9f1ff,262144,"GB Genjin 2 (Bonk's Revenge) (J) [S][BF]"}, {0xb2eedd36,1048576,"GB Genjin Collection (J) [S]"}, {0x02029dca,1048576,"GB Genjin Collection (J) [S][a1]"}, {0xb08bb116,262144,"GB Genjin Land - Viva Chikkun Oukoku (J) [!]"}, {0xa2e210e9,131072,"GB Pachislot Hissyouhou Jr. (J)"}, {0x92ce5a8a,131072,"GB Taruru-To 2 (J) [BF]"}, {0xb2b72056,131072,"Gear Works (U) [!]"}, {0xa64a8710,65536,"Gem Gem (J)"}, {0x95e8fcb1,262144,"Genjin Cottu (J) [S]"}, {0x70819e03,262144,"Gensan 2 (J)"}, {0x74a52399,262144,"Gensan Quiz (J)"}, {0x7f62456b,131072,"George Foreman Boxing (U) [!]"}, {0x8f2bf517,262144,"Getaway, The (U)"}, {0x69b161bc,131072,"Ghostbusters 2 (J)"}, {0x5821ecd4,131072,"Ghostbusters 2 (UE) [!]"}, {0x61d80946,262144,"Go Go Ackman (J) [S]"}, {0x845735de,524288,"Go Go Hitchike (J) [S]"}, {0x5e4e030f,65536,"Go Go Tank (J) [BF]"}, {0x30ae39b6,65536,"Go Go Tank (J)"}, {0x65dfabcb,65536,"Go Go Tank (U) [!]"}, {0x2a4a2d2b,131072,"Go! Go! Kid (J)"}, {0x533fa979,131072,"Goal! (with Ireland) (E)"}, {0x00d4caf2,131072,"Goal! (with Venezuela) (U) [!]"}, {0xa1b29ab8,262144,"God Medicine (J)"}, {0x847e0772,524288,"God Medicine FB (J) [S]"}, {0xed204600,131072,"Godzilla (J)"}, {0xfe4f80b7,131072,"Godzilla (U) [!]"}, {0xc529a96a,262144,"Gojira (GB Godzilla) (J)"}, {0x6ed10383,131072,"Golf (JUA) [!]"}, {0xa6dadb1e,262144,"Golf Classic (U) [S]"}, {0x24cfcffa,524288,"Golf Classic (U) [S][BF]"}, {0xd03e59aa,65536,"Gourmet Paradise (U)"}, {0x90f87d57,262144,"Gradius - The Interstellar Assault (U)"}, {0x8c5dee4d,65536,"Grand Prix (Sunsoft) (UE) [!]"}, {0xc4cbf6b1,262144,"Great Greed (U) [!]"}, {0x3579e297,131072,"Gremlins 2 (JUE) [!]"}, {0xe97f2e9a,524288,"Gurander Musashi RV (J) [S]"}, {0x5e4a61d3,131072,"Hal Wrestling (U) [!]"}, {0xb02faa0b,131072,"Hal Wrestling (U) [a1]"}, {0x9e0d2b45,262144,"Hammerin' Harry - Ghost Building Company (Gensan) (J)"}, {0x9f09afe8,262144,"Hammerin' Harry - Ghost Building Company (U)"}, {0x0b467683,65536,"Hatris (U) [BF]"}, {0x7635f28b,65536,"Hatris (U)"}, {0x60727bf9,524288,"Hayaosi Kuizu - The King of Quiz (J) [S]"}, {0x78830daf,65536,"Head On (J)"}, {0x1526a96b,65536,"Heavyweight Championship Boxing (U) [!]"}, {0x08bf29c9,32768,"Heiankyo Alien (J) [p1][!]"}, {0x1495bbe5,32768,"Heiankyo Alien (U) [!]"}, {0x00a9001e,524288,"Hercules (U) [S]"}, {0x4f8a61bf,262144,"Hercules Eikou (J)"}, {0x6b17abe5,131072,"High Stakes Gambling (U) [!]"}, {0x41c17421,262144,"Hinsyutu Eibunpo (J)"}, {0x8ee95e0b,131072,"Hiryu Gaiden (J)"}, {0x2c77f399,131072,"Hit the Ice (UE) [!]"}, {0x59db5e75,131072,"Hitoride Dekirumon - Cooking Densetsu (J)"}, {0xc2c2ad19,131072,"Hoi Hoi - Gameboy Ban (J)"}, {0xe4b4febc,131072,"Hokuto no Ken - Fist of the North Star (J)"}, {0x7c3f3107,131072,"Home Alone (J)"}, {0x8efc8434,131072,"Home Alone (U) [!]"}, {0x4e305fb8,131072,"Home Alone (U) [BF]"}, {0xe8e430f1,131072,"Home Alone 2 (U) [!]"}, {0x6c407eed,65536,"Hon Shougi (J) [S]"}, {0x5ad83d68,32768,"Hong Kong (J)"}, {0x0d255d59,262144,"Honmei Boy (J)"}, {0x370a2c2f,131072,"Hook (E) (Ocean) [!]"}, {0x62d8173c,131072,"Hook (J)"}, {0x6765b61b,131072,"Hook (U) (Sony Imagesoft)"}, {0x754496bb,131072,"Houghton Mifflin Spell Checker and Calculator (U) [!]"}, {0x1cb6158c,131072,"Hudson Hawk (J)"}, {0xadff7bbd,131072,"Hudson Hawk (U) [!]"}, {0x74aa5e0f,131072,"Hugo (E) [S]"}, {0x67998fa4,131072,"Hugo 2 (G) [S][!]"}, {0x1df2e81d,262144,"Humans, The (U)"}, {0x3a4636ff,524288,"Hunchback of Notre Dame, The - Topsy Turvy Games (U) [S][!]"}, {0xc2e7be35,131072,"Hunt for Red October, The (J)"}, {0x5a61ee00,131072,"Hunt for Red October, The (U) [!]"}, {0xc364d55f,262144,"Hyper Black Bass (J)"}, {0x32a81a49,262144,"Hyper Black Bass '95 (J)"}, {0x02d09ce3,131072,"Hyper Dunk (U)"}, {0xb3a86164,32768,"Hyper Lode Runner (JU) [!]"}, {0x6d4fd9aa,131072,"Ikari no Yousai 2 (Fortified Zone 2) (J) [!]"}, {0x80ac487e,131072,"In Your Face (U)"}, {0xd81c08fa,131072,"Incredible Crash Dummies, The (U) [!]"}, {0xa4e5d461,131072,"Indiana Jones and the Last Crusade (J) [BF]"}, {0x8f234f49,131072,"Indiana Jones and the Last Crusade (J)"}, {0x9189921a,131072,"Indiana Jones and the Last Crusade (UE) [!]"}, {0xcad36c69,131072,"Indiana Jones and the Last Crusade (UE) [BF]"}, {0x6cc56612,262144,"Initial D Gaiden (J) [S][!]"}, {0x94757be8,262144,"International Superstar Soccer (U) [S]"}, {0xecd61f03,262144,"Irem Fighter (J)"}, {0x8e3c7e15,131072,"Iron League (Strong Wind Chapter One) (J)"}, {0x173232e5,524288,"Ironman - X-O Manowar in Heavy Metal (U) [S][!]"}, {0x85b98a77,65536,"Ishido (U) [!]"}, {0xab367915,32768,"Ishidou (Ishido) (J) [!]"}, {0xddb147e5,131072,"Itchy & Scratchy - Minature Golf Madness (U)"}, {0x1c4d3665,262144,"Itsudemo Nyanto Wonderful (J) [S][!]"}, {0x98259257,131072,"J. Cup Soccer (J)"}, {0xcdd02f22,262144,"J. League Big Wave Soccer (J) [S]"}, {0x17608642,131072,"J. League Fighting Soccer (J)"}, {0xf0321342,262144,"J. League Live '95 (J) [S]"}, {0x91e6bf74,524288,"J. League Supporter Soccer (J) [S]"}, {0xadb46f9c,131072,"J. League Winning Goal (J)"}, {0x654988b2,131072,"Jack Nicklaus Golf (U) [!]"}, {0xca3bc3ce,524288,"James Bond 007 (U) [S][!]"}, {0x37b3d081,65536,"Jankenman (J)"}, {0x0530e1cc,65536,"Janshirou (J)"}, {0x2812036b,131072,"Janshirou 2 (J)"}, {0x04daa03b,131072,"Jantaku Boy (J)"}, {0xa1e76a33,131072,"Jeep Jamboree (U) [!]"}, {0x7e6598bb,262144,"Jelly Boy (U)"}, {0x08725c79,131072,"Jeopardy (U) [!]"}, {0xe3843152,131072,"Jeopardy (U) [BF]"}, {0x3b523216,131072,"Jeopardy! - Sports Edition (U) [!]"}, {0xcd3df0c1,131072,"Jeopardy! - Teen Tournament (U) [S][!]"}, {0x6386c870,131072,"Jetsons, The (U)"}, {0x229e9113,262144,"Jida Igeki (J)"}, {0x435c4697,262144,"Jikuu Senki Mu (J)"}, {0x18671602,65536,"Jimmy Connors Tennis (J)"}, {0x9b7ebf91,65536,"Jimmy Connors Tennis (U) [!]"}, {0x590f4afc,131072,"Jinsei (J)"}, {0x9d335162,131072,"Jissen Mahjong Kyoshitsu (J) [S]"}, {0x5da86ed4,262144,"Joe & Mac (U) [!]"}, {0x3fcb174d,65536,"Jordan One-on-One (J)"}, {0xc90c5456,65536,"Jordan vs Bird (U)"}, {0x951b9907,262144,"Judge Dredd (J)"}, {0xb9d11656,262144,"Judge Dredd (U) [!]"}, {0xb64d27ee,131072,"Jungle Book. The (U) [!]"}, {0x763ababb,262144,"Jungle Strike (U)"}, {0x2ad46ac7,262144,"Jungle Wars (J)"}, {0x391f532a,524288,"Jurassic Park - Lost World, The (U) [S]"}, {0xb350bedf,262144,"Jurassic Park (U) [!]"}, {0xaf3d2e95,262144,"Jurassic Park 2 - The Chaos Continues (UE) [S][!]"}, {0x665fee83,524288,"Jurassic Park 3 (V1.1) (Unl) (Chinese) [BF]"}, {0x83fa30d0,524288,"Jurassic Park 3 (V1.1) (Unl) (Chinese)"}, {0x943059ba,262144,"Kabuto Jump (J)"}, {0xd4319169,131072,"Kachiu Mayoso Keiba Kizoku Ex 94 (J)"}, {0xc18cd57a,524288,"Kaeruno Tameni (J)"}, {0xb6d9d6c4,131072,"Kaguyahime (J)"}, {0x82e03e10,524288,"Kandume Monster (J) [S]"}, {0xe18aedaf,524288,"Kanjiro (J) [S]"}, {0x44f5a443,262144,"Kanyoku Kotowaza 210 (J)"}, {0xfa7ea8a0,262144,"Karamucho Ziken (J) [S]"}, {0x42e8ba89,524288,"Kaseki Reborn (J) [S]"}, {0xefbc23fc,131072,"Kattobi Road (J)"}, {0xa57e1ac1,131072,"Keiba Kizoku (J)"}, {0x326273b7,131072,"KeiTai Keiba 8 Special (J)"}, {0x0a9859c1,524288,"Ken Griffey Jr. Presents Major League Baseball (U) [S][!]"}, {0x12caa1ca,65536,"Kesamaru (J)"}, {0x8056344c,262144,"Kick Boxing, The (J)"}, {0xf27294b7,262144,"Kid Dracula (U) [!]"}, {0x0c042862,131072,"Kid Icarus - Of Myths and Monsters (UE) [!]"}, {0xbc78feab,131072,"Kid Icarus - Of Myths and Monsters (UE) [BF]"}, {0xbbff21b1,65536,"Kid Niki (J) [BF]"}, {0x004443e6,65536,"Kid Niki (J)"}, {0xac793b54,524288,"Killer Instinct (U) [S][!]"}, {0x1ff84e8c,524288,"King of Fighters '95, The (U) [S][!]"}, {0xd2d648c4,65536,"King of the Zoo (J)"}, {0x920202dc,131072,"Kingdom Crusade (U)"}, {0xf3ccadc3,131072,"Kingyo Chuuihou! 2 (J)"}, {0x48c2cd38,131072,"Kinnkuman DM (J)"}, {0x47f42f42,262144,"Kira Kira Kids (J) [S]"}, {0x4bedf22c,524288,"Kirby 2 - Hoshinoka 2 (J) [S]"}, {0xdf3bbcd7,524288,"Kirby no Block Ball (J) [S]"}, {0x7ad90b4b,524288,"Kirby's Block Ball (U) [S][!]"}, {0x40f25740,262144,"Kirby's Dream Land (U) [!]"}, {0x8dc07c35,524288,"Kirby's Dream Land 2 (U) [S][!]"}, {0x21035f95,262144,"Kirby's Hoshinoka-Bi (Dream Land) (V1.0) (J)"}, {0x04342c83,262144,"Kirby's Hoshinoka-Bi (Dream Land) (V1.1) (J)"}, {0x8b44fb7d,262144,"Kirby's Pinball Land (J)"}, {0x31cb6526,262144,"Kirby's Pinball Land (U) [!]"}, {0x91300898,262144,"Kirby's Star Stacker (U) [S][!]"}, {0x28e507b0,262144,"Kitarou (J) [S]"}, {0x909937cb,131072,"Kitchin Panic (J)"}, {0x13c9c5ff,262144,"Kiteretu Zyuraki (J) [BF]"}, {0xd53548b0,262144,"Kiteretu Zyuraki (J)"}, {0xb4955889,32768,"Klax (J) (GB)"}, {0x72660774,65536,"Klax (U) (GB) [!]"}, {0xc6f24d2f,131072,"Knight Quest (J)"}, {0xdf50f477,131072,"Knight Quest (U)"}, {0xf3e1e652,32768,"Koi Wa Kakehiki (J)"}, {0x53ff8041,524288,"Kokiatsu Boy (J) [S]"}, {0x8e367457,131072,"Konami Basketball (J)"}, {0x992cd78f,524288,"Konami Collection 1 (J) [S]"}, {0xc3b318cd,524288,"Konami Collection 2 (J) [S]"}, {0x1de9caf9,524288,"Konami Collection 3 (J) [S]"}, {0x3a43ea33,524288,"Konami Collection 4 (J) [S]"}, {0x0fdc9fb1,131072,"Konami Golf (E)"}, {0xd14dee07,131072,"Konami Ice Hockey (J)"}, {0xc16d4db2,131072,"Konami Golf (J)"}, {0x5721e7d6,131072,"Konami Sports (J)"}, {0xf6b3e291,524288,"Konchu Hakase (V1.0) (J) [S]"}, {0x05753790,524288,"Konchu Hakase (V1.1) (J) [S]"}, {0x39608c31,32768,"Korodice (J)"}, {0x84e30e6c,262144,"Koukou Nyuushi Deru Jun - Kanji Mondai no Seifuku (J)"}, {0x70468755,262144,"Koukou Nyuushi Rika - Anki Point 250 (J)"}, {0xf01d0b87,262144,"Kumano Putaru (J) [S]"}, {0xb77ac17b,65536,"Kung-Fu Master (Spartan X) (U) [BF]"}, {0x3340e600,65536,"Kung-Fu Master (Spartan X) (U)"}, {0x25b21acc,131072,"Kunio (J)"}, {0x21c98af2,32768,"Kwirk (UA) [!]"}, {0xe158d4db,32768,"Kyorchan Land (Hiro) (J)"}, {0x8059bc15,65536,"Kyoudai Jingi (Splitz) (J)"}, {0x675e1309,131072,"Lamborghini American Challenge (U) [!]"}, {0x10499af6,131072,"Last Action Hero (U)"}, {0xfe9dd4c0,262144,"Last Bible (J)"}, {0x52e15ff2,262144,"Last Bible 2 (J) [f1]"}, {0xf8e519d9,262144,"Last Bible 2 (J)"}, {0x134f91d7,131072,"Lawnmower Man, The (U) [!]"}, {0x31fb404b,65536,"Lazlos' Leap (U) [!]"}, {0x179c494e,131072,"Legend of Prince Valiant (U)"}, {0xa6e685dc,524288,"Legend of the River King (U) [S][!]"}, {0xbf2ab18b,524288,"Legend of Zelda, The - Link's Awakening (F)"}, {0x760ab4e7,524288,"Legend of Zelda, The - Link's Awakening (G) [!]"}, {0x39a6684e,524288,"Legend of Zelda, The - Link's Awakening (V1.0) (J)"}, {0x8cf27c90,524288,"Legend of Zelda, The - Link's Awakening (V1.0) (U) [!]"}, {0xea20b82a,524288,"Legend of Zelda, The - Link's Awakening (V1.1) (J)"}, {0x7d1b6cd6,524288,"Legend of Zelda, The - Link's Awakening (V1.1) (U) [!]"}, {0x34d08e7b,524288,"Legend of Zelda, The - Link's Awakening (V1.2) (U) [!]"}, {0x492edb36,131072,"Legend of Zerd, The (J)"}, {0x23467a35,131072,"Lemmings (E) [!]"}, {0x7d5cc03a,131072,"Lemmings (J)"}, {0xf2d1c19d,131072,"Lemmings (U) [!]"}, {0x9800bd49,524288,"Lemmings 2, The Tribes (U) [!]"}, {0x55fc585f,262144,"Les Aventures De Tintin - Le Temple Du Soleil (E)"}, {0x1f8d207c,131072,"Lethal Weapon (U) [!]"}, {0x8fc3ca73,524288,"Lion King, The (Disney Classics) (U) [!]"}, {0x3430d261,524288,"Lion King, The (Virgin) (U)"}, {0xe37e1832,131072,"Little Indian in Big City (U) [S]"}, {0x31cd9670,131072,"Little Master (J)"}, {0x187de7f8,262144,"Little Master 2 (J)"}, {0x00def37a,131072,"Little Mermaid, The (E) [!]"}, {0xd7c517e5,131072,"Little Mermaid, The (U) [!]"}, {0xdab91c7a,65536,"Lock 'N Chase (JU) [!]"}, {0xd6185941,131072,"Lolo (J)"}, {0x40e47da3,131072,"Looney Tunes (J)"}, {0xa662a8ef,131072,"Looney Tunes (U) [!]"}, {0x531a3e16,32768,"Loopz (U)"}, {0x538e0591,262144,"Lucky Luke (E) (M4)"}, {0xa2234eb1,65536,"Lucky Monkey (J)"}, {0xa3d5c8d7,524288,"Lucle (J)"}, {0x030d2054,131072,"Lunar Lander (J)"}, {0x016d230b,262144,"Mach Go Go Go (J) [S]"}, {0xd2585bbb,524288,"Madden '95 (U) [S]"}, {0xfd9dc1ad,524288,"Madden '96 (U) [S]"}, {0x88a837a2,524288,"Madden '97 (U) [S][!]"}, {0x0af9089e,131072,"Magic Ball (J) (Chinese)"}, {0xb1acbd28,32768,"Magic Maze (Sachen) (Unl) [!]"}, {0x9c4f54f1,131072,"Magical Talulutokun - Raiba Zone Panic (J)"}, {0xf157ae9e,65536,"Magical Tower (Game 2 of Sachen 4-in-1 Volume 5) (Unl) [!]"}, {0x9c318c64,131072,"Magnetic Soccer (U)"}, {0x2d439d0d,262144,"Mahoujin Guru Guru (J) [S]"}, {0xcfa358de,262144,"Makaimura Gaiden (J)"}, {0xdfa5da12,65536,"Malibu Beach Volleyball (U) [!]"}, {0xb9725e66,262144,"Marble Madness (U) (GB) [!]"}, {0x4627d88b,65536,"Mario & Yoshi (E) [!]"}, {0xf2d652ad,262144,"Mario's Picross (UE) [S][!]"}, {0x0f3ff7da,262144,"Marmalade Boy (J) [S]"}, {0x6e4f1eb3,131072,"Maru's Mission (U) [!]"}, {0x7cb70d3d,262144,"Masakari Densetsu Kintarou ACG (J)"}, {0xd8bab8e0,524288,"Masakari Densetsu Kintarou RPG Hen (J)"}, {0x71c804b3,131072,"Maskrider SD (J)"}, {0x4c0fb33e,32768,"Master Karateka (J)"}, {0x6f30a43a,262144,"Maui Mallard (U) [!]"}, {0x1b167f00,65536,"Max (UE) [!]"}, {0xb3e8028d,524288,"Mazekko Monster (J) [S]"}, {0xe5520693,524288,"Mazekko Monster 2 (J) [S]"}, {0x81de6c13,131072,"McDonaldland (U) [!]"}, {0x98494bf2,131072,"McDonaldland (U) [BF]"}, {0x1bab9900,524288,"Medarot Kabuto (V1.0) (J) [S]"}, {0x12a3982d,524288,"Medarot Kabuto (V1.1) (J) [S]"}, {0xbc0588c4,524288,"Medarot Kuwagata (V1.0) (J) [S]"}, {0x5e77e82e,524288,"Medarot Kuwagata (V1.1) (J) [S]"}, {0x2ea4b976,262144,"Mega Man (E) [!]"}, {0x47e70e08,262144,"Mega Man (U) [!]"}, {0x5e90cb48,262144,"Mega Man 2 (E) [!]"}, {0xe496f686,262144,"Mega Man 2 (U) [!]"}, {0x03b0d4ec,262144,"Mega Man 3 (E) [!]"}, {0x5175d761,262144,"Mega Man 3 (U) [!]"}, {0x973fcf4c,524288,"Mega Man 4 (E)"}, {0xabcea00d,524288,"Mega Man 4 (U) [!]"}, {0x72e6d21d,524288,"Mega Man 5 (U) [S][!]"}, {0xd12ac4fe,524288,"Mega Man 5 (U) [S][a1]"}, {0xc764b1f2,131072,"Megalit (J)"}, {0xf315b842,65536,"Megalit (U) [!]"}, {0x9bb5ba03,131072,"Mercenary Force (UE) [!]"}, {0xf3cc5e62,131072,"Metal Jack (J) [!]"}, {0xbf6866dc,131072,"Metal Masters (U)"}, {0xdee05370,262144,"Metroid 2 - Return of Samus (UA) [!]"}, {0x9039cbdb,65536,"Mi Tu De Lu (Puzzle Path) (Unl)"}, {0xf0482567,131072,"Mickey Mouse - Magic Wand (U) [S][!]"}, {0x77d69349,524288,"Mickey Mouse - Tokyo Disneyland (J) [S]"}, {0x4ca75d4d,65536,"Mickey Mouse (J)"}, {0xfc50dee7,131072,"Mickey Mouse (U) [!]"}, {0xdfee8bcc,131072,"Mickey Mouse II (J)"}, {0x0d30b3a1,131072,"Mickey Mouse IV (J)"}, {0x44cd01dd,131072,"Mickey Mouse V (J)"}, {0xe72db762,131072,"Mickey's Dangerous Chase (E) [!]"}, {0x0ab490c8,131072,"Mickey's Dangerous Chase (J)"}, {0x7b822d8f,131072,"Mickey's Dangerous Chase (U) [!]"}, {0x23e9d625,262144,"Mickey's Ultimate Challenge (U)"}, {0x2088f85f,262144,"Micro Machines (U) [!]"}, {0x24666c4d,524288,"Micro Machines 2 (U)"}, {0x1dd93d95,262144,"Midorin Omaki Baoo (J) [S]"}, {0x86a1c549,262144,"Mighty Morphin Power Rangers - The Movie (U) [S]"}, {0xc60d032a,262144,"Mighty Morphin Power Rangers (U) [S][!]"}, {0xdae94370,262144,"Mighty Morphin Power Rangers (U) [S][BF]"}, {0xced936f8,32768,"Migrain (J)"}, {0x73b80b16,131072,"Mikeneko Holmes (J)"}, {0xb14c3b31,131072,"Millipede - Centipede (UE) [S][!]"}, {0xf188c94c,131072,"Milon no Meikyuu Kumikyoku (J)"}, {0x62b4cc8c,131072,"Milon's Secret Castle (U)"}, {0x1a6bd577,65536,"Miner 2049er (U) [!]"}, {0x5532b3d1,32768,"Minesweeper (J)"}, {0x149ddaed,524800,"Mini 4 Boy (J) [S]"}, {0xd6962241,524288,"Mini 4 Boy II - Final Evolution (J) [S]"}, {0x33cd7550,65536,"Mini Putt (J)"}, {0xb3ad9b76,131072,"Miracle Adventure of Esparks (J)"}, {0x3a6cd4d8,32768,"Missile Command (U) (GB) [!]"}, {0xc7f7f0ac,131072,"Mobile Police Patlabor (J)"}, {0x79e05789,262144,"Mogu Mogu Q (J) [S][!]"}, {0xe1e3629f,32768,"Mogura De Pon! (J)"}, {0x82fca204,524288,"Moguranya (Mole Mania) (J) [S]"}, {0x2c36c74c,524288,"Mole Mania (Moguranya) (U) [S][!]"}, {0xad376905,1048576,"Momotaro Collection (J) [S]"}, {0x8eadec49,1048576,"Momotaro Collection 2 (J) [S]"}, {0xf09b34ab,262144,"Momotaro Dengeki (J)"}, {0x3c1c5eb4,524288,"Momotaro Dengeki 2 (J) [S]"}, {0xba5611ef,262144,"Momotaro Densetsu Gaiden (J)"}, {0x218265b3,524288,"Momotetsu Jr. (J) [S]"}, {0x4ca6d91a,262144,"Momotetu (J)"}, {0x987b621e,262144,"Monopoly (E)"}, {0xd8ac08b5,262144,"Monopoly (J)"}, {0xfd90f0d6,131072,"Monopoly (U) (GB) [!]"}, {0x5284543a,262144,"Monster Go! Go! Go! (Unl) [p1]"}, {0x56ba6a71,131072,"Monster Maker - Barcode Saga (J)"}, {0x725ee86c,131072,"Monster Maker (J)"}, {0x66e708fc,262144,"Monster Maker 2 (J)"}, {0x300b1d2d,262144,"Monster Max (U)"}, {0xad529057,524288,"Monster Race (J) [S]"}, {0xbd3039e5,524288,"Monster Race Other (J) [S]"}, {0x7b484ca2,65536,"Monster Truck (J) [BF]"}, {0xabf9b517,65536,"Monster Truck (J)"}, {0x186c109b,131072,"Monster Truck Wars (U) [S][!]"}, {0xe7ac155b,262144,"Montezuma's Return (E) (M5) [S][!]"}, {0x160fa9ef,262144,"Mortal Kombat (J)"}, {0x90eb0929,262144,"Mortal Kombat (U) [!]"}, {0x7b440ab8,262144,"Mortal Kombat (U) [BF]"}, {0xbf9c65fb,524288,"Mortal Kombat 3 (U) [!]"}, {0xf724b5ce,1048576,"Mortal Kombat I & II (J) [a1]"}, {0xb1a8dfd0,1048576,"Mortal Kombat I & II (J)"}, {0x339f1694,1048576,"Mortal Kombat I & II (U) [a1]"}, {0x57ba5d56,262144,"Mortal Kombat II (J) [S]"}, {0xbfaeadd0,262144,"Mortal Kombat II (U) [S][!]"}, {0xe2697678,32768,"Motocross Maniacs (E) [!]"}, {0xda6053c3,32768,"Motocross Maniacs (J)"}, {0x318dbde1,32768,"Motocross Maniacs (U) [!]"}, {0x4083b8b8,65536,"Mouse Trap Hotel (U) [BF]"}, {0x6edf07e5,65536,"Mouse Trap Hotel (U)"}, {0xcf84ac77,65536,"Mr. Do! (E) [!]"}, {0xa1122fc0,65536,"Mr. Do! (U)"}, {0xeadaf1e7,131072,"Mr. Gono no Baken Tekichu Jyutsu (J)"}, {0x03b64a35,262144,"Mr. Nutz (U)"}, {0x0e5bb1c4,65536,"Ms. Pac-Man (U) [!]"}, {0x7a7ba056,65536,"Ms. Pac-Man (U) [BF]"}, {0x97bd3e8f,131072,"Muhammad Ali's Boxing (U)"}, {0x01aee24b,131072,"Musashi Road (J)"}, {0x3420edea,131072,"Mysterium (J)"}, {0x3b94187d,131072,"Mysterium (U) [BF]"}, {0xeb225e96,131072,"Mysterium (U)"}, {0xb6e134af,262144,"Mystic Quest (F)"}, {0x0351b9a6,262144,"Mystic Quest (G) [!]"}, {0x57d95c92,262144,"Mystic Quest (U) [!]"}, {0xfafb343c,262144,"Mystical Ninja (U) [S][!]"}, {0xa1813cd5,262144,"Mystical Ninja (U) [S][a1][!]"}, {0xb4dd8e6a,131072,"Nada Asatarou no Powerful Mahjong - Tsugi no Itte 100 Dai (J)"}, {0x44badbb7,131072,"Nail'N Scale (U)"}, {0xec3257b3,131072,"Namco Classics (J)"}, {0x1902c6bd,524288,"Namco Gallery Volume 1 (J) [S]"}, {0x7e8cd4b5,524288,"Namco Gallery Volume 1 (J) [S][BF]"}, {0xa69b9260,524288,"Namco Gallery Volume 2 (J) [S]"}, {0x7740341e,524288,"Namco Gallery Volume 3 (J) [S]"}, {0xafd897d9,65536,"NanoLoop Music Generator (E) [!]"}, {0x3e30b63d,131072,"Nanonote (J)"}, {0xafd8c47c,65536,"Navy Blue (J)"}, {0x8cfeb2e2,131072,"Navy Blue '90 (J)"}, {0x2cbe5381,262144,"Navy Blue '98 (J)"}, {0x296ceacb,131072,"Navy Seals (U) [!]"}, {0xf25ba8bf,65536,"NBA All Star Challenge (U) [!]"}, {0xdf9db013,131072,"NBA All Star Challenge 2 (J) [!]"}, {0xc27c0289,131072,"NBA All Star Challenge 2 (U) [!]"}, {0x0ca07cda,262144,"NBA Jam (U)"}, {0x32909f62,524288,"NBA Jam Tournament Edition (J) [!]"}, {0x27d74c50,524288,"NBA Jam Tournament Edition (UE) [!]"}, {0x8885c7cd,524288,"NBA Live 96 (U) [S]"}, {0x3d6d309b,131072,"Nekojara (J)"}, {0xfd74b7f6,131584,"Nemesis ('90) (UE) [!]"}, {0x19930ea5,131072,"Nemesis ('91) (UE) [!]"}, {0xb338dae7,131072,"Nemesis (J)"}, {0xc3e62a35,262144,"Nemesis 2 - The Return of the Hero (U) [!]"}, {0xac5b062d,262144,"Nemesis 2 (J)"}, {0xaa98687f,524288,"Nettou Garou 2 (J) [S]"}, {0x8712f17b,524288,"Nettou King of Fighters '95 (J) [S]"}, {0xaa476500,524288,"Nettou King of Fighters '95 (J) [S][a1]"}, {0xc4d94fcb,524288,"Nettou King of Fighters '95 (J) [S][a2]"}, {0xfecdae42,524288,"Nettou King of Fighters '96 (J) [S]"}, {0xac61ef47,1048576,"Nettou King of Fighters '97 (J) [S][p1]"}, {0x50cf7de7,1048576,"Nettou King of Fighters '97 (J) [S][p1][BF]"}, {0xea0e9651,1048576,"Nettou King of Fighters '97 (J) [S][p2]"}, {0x20b56df6,1048576,"Nettou King of Fighters '97 (J) [S][p3]"}, {0x4a306276,524288,"Nettou Samurai (J) [S]"}, {0x0a12f53c,524288,"Nettou World Heroes 2 Jet (J) [S]"}, {0x82150e4a,65536,"New Chessmaster, The (J)"}, {0x5e1c3e8d,65536,"New Chessmaster, The (M2) (JU)"}, {0xc7ffc203,65536,"New Chessmaster, The (U)"}, {0xe5a78b9b,262144,"New SD Gundam (J) [S]"}, {0x4c3d1508,32768,"NFL Football (U) [!]"}, {0xc7838830,131072,"NFL Quarterback Club (1993) (U) [!]"}, {0xeecb703c,262144,"NFL Quarterback Club (J) [!]"}, {0x06f04370,262144,"NFL Quarterback Club 2 (U) [!]"}, {0xd583bc4e,262144,"NFL Quarterback Club '96 (U)"}, {0xbcabd2d2,524288,"NHL Hockey 95 (U) [S][!]"}, {0x15cd2b63,524288,"NHL Hockey 96 (U) [S][!]"}, {0xd983ff48,262144,"Nichibutsu Mahjong - Yoshimoto Gekijou (J)"}, {0xe1b202db,131072,"Nigel Mansell's World Championship '92 (E)"}, {0x0d0958a3,131072,"Nigel Mansell's World Championship '92 (U)"}, {0x03e84d7d,131072,"Nigel Mansell's World Championship '93 (U)"}, {0xe497842e,262144,"Nihon Daiyou Soccer (J) [S]"}, {0xcf133379,262144,"Nihonshi Target 201 (J)"}, {0x59d3e2ad,65536,"Ninja Boy (U) [!]"}, {0x1e14e981,262144,"Ninja Boy 2 (U) [BF]"}, {0x64c06d94,262144,"Ninja Boy 2 (U)"}, {0xd2be3397,131072,"Ninja Ryukenden (Ninja Gaiden) (J)"}, {0xb864a3b6,131072,"Ninja Spirit (J)"}, {0xc53ebfbd,131072,"Ninja Taro (U) [!]"}, {0xb50119eb,524288,"Ninku (J) [S]"}, {0x7f818772,524288,"Ninku Dai 2 - Ninku Sensou Hen (J) [S]"}, {0x0e37e462,524288,"Nintama Eawase (J) [S]"}, {0xbd223184,262144,"Nintama Rantaro (J) [S]"}, {0x96c24e13,131072,"Nintendo World Cup (U) [!]"}, {0x8803186a,131072,"Nobunaga's Ambition (J)"}, {0x5a843008,131072,"Nobunaga's Ambition (U) [!]"}, {0x6cd63b0b,131072,"Nontan to Issyo - Kurukuru Puzzle (J)"}, {0x8bbcc8bb,262144,"Noobow (J)"}, {0x91ec9567,1048576,"Oak's Dream 2 V1.3 (Pokemon Red Hack)"}, {0x5143e227,262144,"Obelix (E) (M2) (Fre-Ger) [S]"}, {0x6510c0e2,524288,"Oddworld Adventures (UE) [!]"}, {0xbe81bd61,524288,"Olympic Games (U) [S]"}, {0xcaf5b372,131072,"On the Tiles - Franky, Joe & Dirk (E) [!]"}, {0xb7f48649,131072,"Oni (J)"}, {0x2f895df5,262144,"Oni 2 - Innin Densetsu (J) [!]"}, {0x58b3b877,229376,"Oni 2 - Innin Densetsu (J) [BF]"}, {0x6cd62fdb,262144,"Oni 3 - Kuro no Hakaishin (J) [!]"}, {0xbeff4f57,262144,"Oni 4 - Kishin no Ketsuzoku (J) [!]"}, {0xaf030940,262144,"Oni 5 - Innin wo Tsugumono (J) [S][!]"}, {0xf54ec8eb,131072,"Oni Gashima Pachinko Ten (J) [!]"}, {0x2ebbc1ae,131072,"Operation C (U) [!]"}, {0x3faa9306,65536,"Optimus Prime - Terror of the Monstercons (Mario hack) (Unl)"}, {0x54913227,65536,"Osawagase Penguin Boy (J) [!]"}, {0xc17a002e,32768,"Othello (J)"}, {0x64d13a6d,65536,"Othello World (J) [S][!]"}, {0x98500521,262144,"Otogi Banasi Tai (J) [S]"}, {0x2f0f7f63,131072,"Otoko Jyuku (J)"}, {0x0c228a78,262144,"Otto's Ottifanten (E)"}, {0x8afcc4b0,262144,"Out Burst (J) [!]"}, {0x1b67e8b1,131072,"Out of Gas (U) [!]"}, {0x69a5e681,262144,"Pachinko CR Daiku no Gen San GB (J) [S]"}, {0x955b25ba,1048576,"Pachinko Data Card - Chou Ataru Kun (J) [S]"}, {0x52adb7f9,524288,"Pachinko Gaiden (J) [S]"}, {0x47658ade,65536,"Pachinko Time (J)"}, {0xbe4718e8,524288,"Pachio Kun - Game Gallery (J)"}, {0x3690c99c,131072,"Pachio Kun - Puzzle Castle (J)"}, {0x9a3e2dc2,131072,"Pachio Kun (J)"}, {0x3e8d0ae9,131072,"Pachio Kun 2 (J)"}, {0xc6dd7d92,131072,"Pachio Kun 3 (J)"}, {0x6ee0f7b9,131072,"Pachislot Hisshou Guide GB (J) [S]"}, {0x8c21a77d,131072,"Pachislot Kids (J)"}, {0xdeace430,131072,"Pachislot Kids 2 (J)"}, {0x40fc1186,262144,"Pachislot Kids 3 (J)"}, {0x92c9141f,131072,"Pachislot World Cup 94 (J)"}, {0x50a15dc8,262144,"Pac-In-Time (E) [S][!]"}, {0x1a5a38da,262144,"Pac-In-Time (J) [S]"}, {0x8690b691,262144,"Pac-In-Time (U) [S]"}, {0x65998f48,65536,"Pac-Man (J)"}, {0xb681e243,65536,"Pac-Man (U) (Namco Hometek) [!]"}, {0x0509069c,65536,"Pac-Man (U) (Namco)"}, {0xdb641f82,32768,"PacoPaco Pocket (V1.1) (J)"}, {0xaaebd509,131072,"Pac-Panic (J) [S]"}, {0x57bad9b1,131072,"Pac-Panic (J) [S][BF]"}, {0xc9be96d3,262144,"Pagemaster, The (U) [S][!]"}, {0xcdfa71e5,262144,"Pagemaster, The (U) [S][a1]"}, {0x3b19c3b2,262144,"Pagemaster, The (U) [S][BF]"}, {0x600d7ddf,65536,"Painter Momo Pie (J) [BF]"}, {0xfb79ef58,65536,"Painter Momo Pie (J)"}, {0x4b993d0d,32768,"Palamedes (J)"}, {0x526942e1,32768,"Palamedes (UE) [!]"}, {0xd000a116,65536,"Panel Action Bingo (U)"}, {0x9ae199df,131072,"Pang (U)"}, {0x46de32ba,65536,"Paperboy (U) (GB) [!]"}, {0x8ee404ca,262144,"Paperboy 2 (U)"}, {0x798f324a,131072,"Papuwakunn (J)"}, {0xc35ad128,131072,"Parasol Stars (UE) [!]"}, {0xae97ec53,65536,"Parasoru Hembei (J)"}, {0x85748525,262144,"Parodius (UE) [!]"}, {0x1791e952,262144,"Parodius Da! (J)"}, {0xf4cab596,524288,"Parts Collection - Medarot Kuma (J) [S]"}, {0x89f94482,524288,"Parts Collection 2 (J) [S]"}, {0x2e123f5b,262144,"Pawapuro Baseball (V1.0) (J) [S]"}, {0x71bea855,262144,"Pawapuro Baseball (V1.1) (J) [S]"}, {0xd0040f49,131072,"Peetan (J)"}, {0x7b852074,262144,"Pen Anime Sample 1 (J)"}, {0xc169606d,65536,"Penguin Kun Wars VS (J)"}, {0xa9e62e88,32768,"Penguin Land (J)"}, {0xeecff7f3,65536,"Penguin Wars (U)"}, {0xeafddefc,262144,"Penta Dragon (J) [BF]"}, {0x1e2efaee,262144,"Penta Dragon (J)"}, {0x7d7def64,524288,"PGA European Tour (U) [S][!]"}, {0x6ff72043,524288,"PGA Tour '96 (U) [S]"}, {0xe742561e,262144,"Phantasm (J)"}, {0xf5aa5902,524288,"Picross 2 (J) [S]"}, {0x2f56b2df,1048576,"Pikamon V1.5 (Red Hack)"}, {0x1b3a89c6,65536,"Pinball - Revenge of the Gator (J)"}, {0x79804305,65536,"Pinball - Revenge of the Gator (U) [!]"}, {0x02864c32,262144,"Pinball Deluxe (U)"}, {0xf056a911,262144,"Pinball Fantasies (U)"}, {0xedc8d122,262144,"Pinball Mania (U)"}, {0x740552ed,65536,"Pinball Party (J)"}, {0xa8dd80c6,262144,"Pingu - Sekai de 1 Ban Genkina Penguin (J)"}, {0x2d924e46,262144,"Pinocchio (U) (Black Pearl 1996) [!]"}, {0x085c4a02,262144,"Pinocchio (U) (Nintendo 1995)"}, {0x2cb7d00a,262144,"Pinocchio (U) [BF]"}, {0xd8b4aea4,32768,"Pipe Dream (J)"}, {0xf59cedea,32768,"Pipe Dream (U) [!]"}, {0x0680bfc3,262144,"Pit Fighter (U) [!]"}, {0xef88fad1,32768,"Pitman (J) [a1]"}, {0xa0b68136,32768,"Pitman (J)"}, {0x983caf46,131072,"Play Action Football (U) [!]"}, {0xce58c63d,524288,"Pocahontas (U) [S]"}, {0x2c88f996,131072,"Pocket Bass Fishing (J)"}, {0x17114316,131072,"Pocket Battle (J)"}, {0x212b47a5,524288,"Pocket Bomberman (J) [S]"}, {0x0fd1ae54,524288,"Pocket Bomberman (U) [S]"}, {0x73e8ef96,1048576,"Pocket Camera (V1.1) (J) [S]"}, {0x34e62c8b,262144,"Pocket Collection (J) [S]"}, {0x845bb677,524288,"Pocket Densya (J) [S]"}, {0x48993d4f,524288,"Pocket Family (J) [S]"}, {0x755152bb,131072,"Pocket Golf (J)"}, {0x490f8c46,524288,"Pocket Jockey (J) [S]"}, {0xc034ece1,262144,"Pocket Kyorochan (J) [S]"}, {0xd570a9df,524288,"Pocket Love (J) [S]"}, {0x9f8440b5,1048576,"Pocket Love 2 (J) [S]"}, {0x90f026d4,131072,"Pocket Mahjang (J)"}, {0xe4468d14,524288,"Pocket Monsters Blue (J) [S]"}, {0xdb02f066,524288,"Pocket Monsters Blue (J) [S][BF]"}, {0xbaeacd2b,524288,"Pocket Monsters Green (V1.0) (J) [S]"}, {0x86493ce6,524288,"Pocket Monsters Green (V1.0) (J) [S][BF1]"}, {0xe05a7e7f,524288,"Pocket Monsters Green (V1.0) (J) [S][BF2]"}, {0x37ae8dc4,524288,"Pocket Monsters Green (V1.1) (J) [S]"}, {0xb7d71d6a,1048576,"Pocket Monsters Red (V1.0) (J) [S] (Chinese)"}, {0x13652705,524288,"Pocket Monsters Red (V1.0) (J) [S]"}, {0xb77be1e0,524288,"Pocket Monsters Red (V1.1) (J) [S]"}, {0xe80479b6,524288,"Pocket Monsters Red (V1.1) (J) [S][BF]"}, {0x4ec85504,1048576,"Pocket Monsters Yellow (V1.0) (J) [S]"}, {0xf8c76ce6,1048576,"Pocket Monsters Yellow (V1.0) (J) [S][BF1]"}, {0xa5a31b25,1048576,"Pocket Monsters Yellow (V1.0) (J) [S][BF2]"}, {0xa2545d33,1048576,"Pocket Monsters Yellow (V1.1) (J) [S]"}, {0xfd3da7ff,1048576,"Pocket Monsters Yellow (V1.2) (J) [S]"}, {0x43e47a81,262144,"Pocket Puyo Puyo 2 (J) [S]"}, {0x2fa1bde6,262144,"Pocket Shougi (J) [S]"}, {0xd68c9f79,524288,"Pocket Sonar (J)"}, {0xf855d91c,65536,"Pocket Stadium (J) [BF]"}, {0xc7bd9228,65536,"Pocket Stadium (J)"}, {0xd4d84ca9,32768,"Pocket Voice Multi-ROM Menu V0.1 (Unl)"}, {0x1e1d8fb3,32768,"Pocket Voice Multi-ROM Menu V1.0 (Unl)"}, {0x20418ff9,32768,"Pocket Voice Multi-ROM Menu V2.0 (Unl)"}, {0x1e000a65,1048576,"Pokemon - The Johto Journeys (Red Hack) by MB Hacks"}, {0xd42c95b5,1048576,"Pokemon Amsterdam by Ruliz & AGP V0.10 (Pokemon Red Hack) [S]"}, {0xd95416f9,1048576,"Pokemon Azul (Blue) (S) [S]"}, {0xd6cc5177,1048576,"Pokemon Azul (Blue) (S) [S][BF]"}, {0xf58d56f5,1048576,"Pokemon Black - Special Palace Edition 1 (Red Hack) by MB Hacks"}, {0x9c336307,1048576,"Pokemon Blau (Blue) (G) [S][!]"}, {0x3aca6219,1048576,"Pokemon Blau (Blue) (G) [S][BF]"}, {0x50e2fc1d,1048576,"Pokemon Bleu (Blue) (F) [S]"}, {0x4d0984a9,1048576,"Pokemon Blu (Blue) (I) [S][!]"}, {0xd6da8a1a,1048576,"Pokemon Blue (UA) [S][!]"}, {0xc0d79ecf,1048576,"Pokemon Blue (UA) [S][BF1]"}, {0x23757859,1048576,"Pokemon Blue (UA) [S][BF2]"}, {0x23868fa5,1048576,"Pokemon Blue Before Elite (Blue Hack)"}, {0xd20a2c73,1048576,"Pokemon Blue Edition - Enhanced V0.4beta (Blue Hack)"}, {0x2559b2ad,1048576,"Pokemon Breeders Edition V6 (Blue Hack)"}, {0xcd463c1f,1048576,"Pokemon Generations (Red Hack)"}, {0x2a268399,1048576,"Pokemon Girl V1.0 (Red Hack)"}, {0x5d96a36f,1048576,"Pokemon Green (U) [p1][!]"}, {0xe3bd0b6e,1048576,"Pokemon II V1.0 (Red Hack)"}, {0x4764ebd7,65536,"Pokemon Land V0.3 (Super Mario Land Hack)"}, {0x81962488,524288,"Pokemon of the Past V0.1 (Zelda hack by PR) (U)"}, {0xf4be68e3,1048576,"Pokemon Pink Version (Red Hack) by MB Hacks"}, {0x9c9cdf8a,1048576,"Pokemon Red (Advanced) (U) [S][!]"}, {0x9f7fdd53,1048576,"Pokemon Red (U) [S][!]"}, {0x3bbf1b08,1048576,"Pokemon Red (U) [S][BF]"}, {0x07150f92,1048576,"Pokemon Rocket - James Version V1.1 (Blue hack) (U)"}, {0x509d13ef,1048576,"Pokemon Rocket - Jessie Version V1.0 (Red hack) (U)"}, {0x2ca5a427,1048576,"Pokemon Rocket - Jessie Version V1.1 (Red hack) (U)"}, {0x914142c3,1048576,"Pokemon Rocket - Jessie Version V1.2 (Red hack) (U)"}, {0xd8507d8a,1048576,"Pokemon Rojo (Red) (S) [S]"}, {0x91dcec6c,1048576,"Pokemon Rojo (Red) (S) [S][BF]"}, {0x2945aceb,1048576,"Pokemon Rosso (Red) (I) [S][!]"}, {0x89197825,1048576,"Pokemon Rot (Red) (G) [S][!]"}, {0xbc60c7a8,1048576,"Pokemon Rot (Red) (G) [S][BF]"}, {0xf612c80b,1048576,"Pokemon Rot (Red) (G) [S][BF][a1]"}, {0x337fce11,1048576,"Pokemon Rouge (Red) (F) [S]"}, {0x970677c7,1048576,"Pokemon White Version (Blue Hack) by MB Hacks"}, {0x61c34232,262144,"Ponkonyan (J) [S]"}, {0x058b3dab,65536,"Ponta to Hinako no Chindouchuu - Yuujou Hen (J)"}, {0xd07db274,131072,"Pop 'N Twinbee (E) [!]"}, {0x7f545b40,32768,"Pop Up (U) [!]"}, {0x2fb4da21,131072,"Popeye (J)"}, {0x4372ed68,131072,"Popeye 2 (J)"}, {0x729c2e40,131072,"Popeye 2 (U) (1993)"}, {0x3d0bb6d1,131072,"Popeye 2 (U) [BF]"}, {0xc07ed722,131072,"Popeye 2 (U)"}, {0xf327167e,131072,"Populous (J)"}, {0x453057ac,131072,"Populous (UE) [!]"}, {0x46cb2f33,131072,"Power Mission (U)"}, {0x0e2a1414,131072,"Power Mission (V1.0) (J)"}, {0xe30ef8ab,131072,"Power Mission (V1.1) (J)"}, {0x48c1ee22,524288,"Power Quest - Gekitou Power Modeler (J) [S]"}, {0xcf8aeee8,65536,"Power Racer (U) [!]"}, {0xc5204156,131072,"Prehistorik Man (U)"}, {0x55da3515,65536,"Pri Pri (J)"}, {0xc95d927b,262144,"Primal Rage (U)"}, {0x1d16d689,131072,"Prince of Persia (J)"}, {0x2bd995f1,131072,"Prince of Persia (U)"}, {0xdb8f4cf7,131072,"Prince YehRude (J) (Chinese)"}, {0xa2a6a863,32768,"Pro Action Replay (Unl) [!]"}, {0x71c98c70,32768,"Pro Action Replay (Unl) [f1]"}, {0x6f5b6748,131072,"Pro Mahjong Kiwame GB (J) [S]"}, {0xa6f3bee2,131072,"Pro Soccer (J)"}, {0xf27c06da,131072,"Pro Wrestling (J)"}, {0xc9acc4f4,131072,"Probotector (E) [!]"}, {0xb5090e43,131072,"Probotector 2 (E) [S]"}, {0x5916713e,131072,"Punisher, The (U)"}, {0xacc589fc,524288,"Purikura Pocket (J) [S]"}, {0xd145ea23,524288,"Purikura Pocket 2 (J) [S]"}, {0xceb62411,1048576,"Purikura Pocket 3 (J) [S]"}, {0x420881ae,131072,"Puro Stadium '91 (Pro Yakyu Stadium '91) (J) [!]"}, {0x71559ba0,262144,"Puro Stadium '92 (Pro Yakyu Stadium '92) (J)"}, {0x9e372d13,262144,"Puyo Puyo (J) [S]"}, {0x10235e38,131072,"Puzzle Bobble GB (J) [S]"}, {0x2ae2d71c,32768,"Puzzle Boy (J)"}, {0xe5463a1d,65536,"Puzzle Boy 2 (J)"}, {0x952920ba,262144,"Puzzle Nintama Rantarou (J) [S]"}, {0x9f0f3606,32768,"Puzzle Road (J)"}, {0x916e638d,65536,"Puzznic (J)"}, {0xabef175b,65536,"Pyramids of Ra (U)"}, {0x979ed154,32768,"Q Billion (J)"}, {0x7202e973,32768,"Q Billion (U) [!]"}, {0xefe75f7f,65536,"Q-bert II (J) [BF]"}, {0xe9ba4bad,65536,"Q-bert II (J)"}, {0xb0109545,65536,"Q-bert II (UEA) [!]"}, {0x949887ba,65536,"Q-bert II (UEA) [BF]"}, {0x9185e89e,65536,"Qix (JU) [!]"}, {0xaef48678,65536,"Qix (JU) [p1]"}, {0x40e5adc9,65536,"Quarth (J)"}, {0xbfb112ad,65536,"Quarth (U) [!]"}, {0xd8c33dcd,262144,"Quiz Sekaiha Show by Shobai (J)"}, {0x442420b3,262144,"Race Days (Dirty Racing & 4 Wheel Drive) (U) [a1]"}, {0xb9ab5319,262144,"Race Days (Dirty Racing & 4 Wheel Drive) (U)"}, {0x6775ccd6,131072,"Race Drivin' (U) [!]"}, {0x97ebd21d,1048576,"Racing Mini 4WD - Let's Go!! MAX (J) [S]"}, {0xfc0c180b,524288,"Racing Mini 4WD (J) [S]"}, {0x7c7e6d1c,131072,"Radar Mission (J)"}, {0x581da9c9,131072,"Radar Mission (UE) [!]"}, {0x1ef3bedb,262144,"Raging Fighter (UE) [!]"}, {0x7d03727d,65536,"Raijinou (J)"}, {0xa19ca3c1,65536,"Railway (Game 3 of Sachen 4-in-1 Volume 5) (Unl) [!]"}, {0x10f447f0,131072,"Rainbow Prince (J) (Chinese)"}, {0x96a4c720,131072,"Rampart (J)"}, {0x6d347812,131072,"Rampart (U)"}, {0x613e657a,262144,"Ranma Nibun no Ichi - Kakugeki!! (J)"}, {0xd9d57151,262144,"Ranma Nibun no Ichi - Part 2 (J)"}, {0x94838a81,262144,"Ray Earth (J) [S]"}, {0x00202dfa,262144,"Ray Earth 2 (J) [S]"}, {0xa00a9468,131072,"Ray Thunder (J) [!]"}, {0xf4031d4c,524288,"Real Bout Special (Fatal Fury) (J) [S]"}, {0xe1592b83,131072,"Real Ghostbusters, The (U) [!]"}, {0xae0122aa,131072,"Red Arremer (J)"}, {0x10bd83ba,262144,"Rekishi Masters 512 (J)"}, {0x7e262a4d,262144,"Rekishi Nendai Anki Point 240 (J)"}, {0x504cbd1d,262144,"Ren & Stimpy - Veediots (U) [!]"}, {0x2085aad9,262144,"Ren & Stimpy Show, The - Space Cadet Adventures (U) [!]"}, {0x52f5e960,32768,"Renjyu Club (J) [S]"}, {0x2350922b,65536,"Rentaiou (J)"}, {0x8a546dec,524288,"Retrieve (J) [S]"}, {0xfb5d24e0,131072,"Riddick Bowe Boxing (U)"}, {0xfd3d5ba7,131072,"Ring Rage (J)"}, {0xbce5dfb7,131072,"Ring Rage (U) [!]"}, {0x04453e78,131072,"Roadster (J)"}, {0x0b2071a3,262144,"Robin Hood - Prince of Thieves (G)"}, {0xe5c8c2b1,262144,"Robin Hood - Prince of Thieves (U)"}, {0x06d6980b,131072,"Robocop (J)"}, {0x6088b426,131072,"Robocop (U) [!]"}, {0x157ce6e5,131072,"Robocop 2 (J)"}, {0x4365a789,131072,"Robocop 2 (U)"}, {0xf82d7223,131072,"Robocop vs Terminator (U) [!]"}, {0x1f0b4a28,131072,"Robocop vs Terminator (U) [BF]"}, {0x630299c1,524288,"Rock 'N Monster (J) [S]"}, {0x3be6ac04,262144,"Rockman World (J)"}, {0xc34d265e,262144,"Rockman World 2 (J)"}, {0xe904484f,262144,"Rockman World 3 (J)"}, {0x16aec559,524288,"Rockman World 4 (J)"}, {0xeeabd3c6,524288,"Rockman World 5 (J) [S]"}, {0x2355be94,65536,"Rodland (J)"}, {0xecc2f2c0,65536,"Rodland (U)"}, {0x38c126aa,262144,"Roger Clemens MVP Baseball (J) [!]"}, {0x9da8595b,262144,"Roger Clemens MVP Baseball (U) [!]"}, {0x1a602590,65536,"Rolan's Curse (U) [!]"}, {0x2704fa7a,65536,"Rolan's Curse (U) [BF]"}, {0x2754f360,131072,"Rolan's Curse 2 (U) [!]"}, {0xe4988910,131072,"R-Type (J) [!]"}, {0xe0f23fc0,131072,"R-Type (U) [!]"}, {0x6002e291,131072,"R-Type 2 (J) [!]"}, {0x2fe2a72d,131072,"R-Type 2 (U)"}, {0xe8aea452,131072,"Rubble Saver (J)"}, {0x92c95f2d,65536,"Rubble Saver 2 (J)"}, {0x124a0d06,524288,"Rugrats Movie, The (U) [S]"}, {0x131b09f2,131072,"Sa-Ga (Final Fantasy Legend) (V1.0) (J)"}, {0x1953820f,131072,"Sa-Ga (Final Fantasy Legend) (V1.1) (J)"}, {0x18055bb9,262144,"Sa-Ga 2 (Final Fantasy Legend II) (V1.0) (J)"}, {0xf6cfcfb1,262144,"Sa-Ga 2 (Final Fantasy Legend II) (V1.1) (J)"}, {0x575d6d9d,262144,"Sa-Ga 3 (Final Fantasy Legend III) (J)"}, {0xe43da090,131072,"Sagaia (J)"}, {0xea759875,262144,"Sailor Moon R (J)"}, {0xbfd24c2a,131072,"Saiyuuki (J)"}, {0x70393c0f,262144,"Same Game (J) [S]"}, {0x69292ee6,524288,"Samurai Shodown (U) [S]"}, {0x3e3b715f,262144,"Sangokushi (J) [p1]"}, {0x83706e92,262144,"Sangokushi (J)"}, {0x48d8ab7a,65536,"Sanrio Carnival (J)"}, {0x758c7b2a,65536,"Sanrio Carnival 2 (J)"}, {0xb6ef042e,262144,"Satoru Nakajima - F-1 Hero - The Graded Driver '92 (J)"}, {0xe00ebc44,131072,"Satoru Nakajima - F-1 Hero '91 (J)"}, {0x4a0f5972,131072,"Scotland Yard (J)"}, {0x39058153,131072,"SD Command Gundam - G-Arms (J) [!]"}, {0x016a0552,131072,"SD Gundam - SD Sengokuden Kunitori Monogatari (J) [!]"}, {0xc9dbba10,131072,"SD Gundam Gaiden - Lacroan Heroes (J) [!]"}, {0xc4d09768,524288,"SD Hiryu no Ken Gaiden (J) [S][!]"}, {0xadb511ca,1048576,"SD Hiryu no Ken Gaiden 2 (J) [S][!]"}, {0xf0b73db4,65536,"SD Lupin the Third (J) [!]"}, {0xd6fe3c56,262144,"SD Saint Seiya Paradise (J)"}, {0x5b7c6faa,262144,"SD Sen Goku Den 2 (J) [!]"}, {0x7c61426c,262144,"SD Sen Goku Den 3 (J) [!]"}, {0xba091b91,131072,"Sea Battle (E)"}, {0x31a3bd99,262144,"SeaQuest DSV (U) [S][!]"}, {0x19056889,262144,"SeaQuest DSV (U) [S][BF]"}, {0x79afe59e,65536,"Seaside Volley (J)"}, {0xd771c1b6,262144,"Seiken Densetsu (J)"}, {0x799c5cdb,131072,"Selection (J)"}, {0xa6027919,524288,"Selection 1&2 (J) [S]"}, {0xd09073f6,262144,"Selection 2 (J)"}, {0x6bae3a41,131072,"Sengoku Ninjakun - Ninja Taro (J)"}, {0xbef1fe2b,32768,"Serpent (J)"}, {0x74d466d7,32768,"Serpent (U)"}, {0xbcc18e24,131072,"Shadow Warriors (E)"}, {0x7c29672b,32768,"Shanghai (J)"}, {0x580fcb18,32768,"Shanghai (U) [!]"}, {0x6b8eff2c,262144,"Shanghai Pocket (J) [S]"}, {0x7ed43fe6,524288,"Shaq Fu (U)"}, {0x0cdd8b04,32768,"Shi Sensyo - Match-Mania (J)"}, {0x5d43a385,1048576,"Shikakui Atama wo Maruku Suru - Joushiki no Sho (J)"}, {0x3c907f2c,1048576,"Shikakui Atama wo Maruku Suru - Nanmon no Sho (J)"}, {0xc34ae38f,262144,"Shikakui Atama wo Maruku Suru - Rika Battle Hen (J)"}, {0x0dadb829,262144,"Shikakui Atama wo Maruku Suru - Sansu Battle (V1.0) (J)"}, {0x74821248,262144,"Shikakui Atama wo Maruku Suru - Sansu Battle (V1.1) (J)"}, {0xf141b2dc,262144,"Shikakui Atama wo Maruku Suru (V1.0) (J)"}, {0x195bee90,65536,"Shikinjyo (J) [BF]"}, {0xf8ec3a41,65536,"Shikinjyo (J)"}, {0xa8a43013,131072,"Shin Nihon Pro Wrestling Tokon Sanjushi (J)"}, {0x47095204,262144,"Shinri Game 2, The (J)"}, {0xfb2fe362,262144,"Shinri Game, The (J)"}, {0x56410442,65536,"Shippo De Bun (J)"}, {0xb3063db5,131072,"Shonen Ashibe - Yuuenchi Panic (J)"}, {0xab3477c4,524288,"Shou Hyper Fish (J) [S]"}, {0x4fb44cb4,131072,"Shougi (J)"}, {0xa074bf7e,262144,"Shougi Saikyo (J) [S]"}, {0x9a1e30b4,65536,"Side Pocket (U) [!]"}, {0x3ba099ec,65536,"Side Pocket (U) [BF]"}, {0x8bd567d1,262144,"Sika Kokugo (J)"}, {0x7aa4e0bb,131072,"Simpsons, The - Bart & the Beanstalk (J)"}, {0x517a614c,131072,"Simpsons, The - Bart & the Beanstalk (U)"}, {0x6819cf0d,131072,"Simpsons, The - Bart vs the Juggernauts (U) [!]"}, {0x0fd66b1a,131072,"Simpsons, The - Escape from Camp Deadly (J)"}, {0x5546a382,131072,"Simpsons, The - Escape from Camp Deadly (U) [!]"}, {0x0ba318b1,131072,"Simpsons, The - Escape from Camp Deadly (U) [BF]"}, {0x1cedb141,131072,"Simpsons, The - Krusty's Funhouse (U)"}, {0xac1fb27a,131072,"Skate or Die - Bad 'N Rad (E) [!]"}, {0x4db7c817,131072,"Skate or Die - Bad 'N Rad (U)"}, {0x02b77c09,131072,"Skate or Die - Tour de Thrash (U)"}, {0x395fe571,65536,"Sky Ace (Game 3 of Sachen 4-in-1 Volume 7) (Unl) [!]"}, {0xae478a6f,262144,"Slam Dunk - Gakeppuchi no Kesshou League (J) [S][!]"}, {0xcb35900a,524288,"Slam Dunk 2 - Zengoku he no TIPOFF (J) [S][!]"}, {0xdbf106d1,524288,"Small Soldiers (U) [S]"}, {0xcb2c7198,131072,"Smurfs 2, The (U)"}, {0x8ef938c4,262144,"Smurfs 3, The (UE) [!]"}, {0xcdff161f,131072,"Smurfs, The (V1.0) (E) [!]"}, {0x8b5bcde7,131072,"Smurfs, The (V1.1) (UE) [S][!]"}, {0x7bf40d7d,131072,"Sneaky Snakes (UE) [!]"}, {0x4892984d,65536,"Snoopy - Magic Show (J)"}, {0x2b7a5034,65536,"Snoopy - Magic Show (U) [!]"}, {0x8900a7c0,131072,"Snoopy no Hajimete no Otsukai (J) [S][!]"}, {0xe5a22f5a,131072,"Snow Bros Jr. (J)"}, {0xd45a1daa,131072,"Snow Bros Jr. (U) [!]"}, {0xc36b199b,131072,"Soccer (E) (M3) [S][!]"}, {0xbe51a876,131072,"Soccer (J)"}, {0x23f64e82,65536,"Soccer Boy (J)"}, {0x6f87b543,65536,"Soccer Mania (JU) [!]"}, {0x11817103,65536,"Solar Striker (JU) [!]"}, {0x7c5aec86,131072,"Soldam (J)"}, {0x1119484a,65536,"Solitaire (J)"}, {0x35a5234a,131072,"Solitaire Funpack (U) [!]"}, {0x901bff2e,65536,"Solomon's Club (J)"}, {0xcea9622a,65536,"Solomon's Club (UE) [a1]"}, {0x5fed0068,262144,"Sonic 3D Blast 5 (Unl)"}, {0xaa4e9379,524288,"Sonic 6 (Unl)"}, {0xd50d6d0a,32768,"Soukoban (J)"}, {0xd9da6741,32768,"Soukoban 2 (J)"}, {0x868b57b2,32768,"Space Invaders (J)"}, {0x891b8f04,524288,"Space Invaders '94 (U) [S][!]"}, {0x7f0f5762,524288,"Space Invaders '94 (U) [S][a1]"}, {0x6ee7ca79,65536,"Spanky's Quest (U) (Natsume) [!]"}, {0xe9ef8136,65536,"Spanky's Quest (U) (Taito)"}, {0x8c7fa1f7,65536,"Spartan X (Kung-Fu Master) (J) [BF]"}, {0xca7b4229,65536,"Spartan X (Kung-Fu Master) (J)"}, {0xfd06e22d,131072,"Speed Ball 2 - Brutal Deluxe (U) [!]"}, {0xb2e6a1c5,262144,"Speedy Gonzales (J)"}, {0x27cde8d6,262144,"Speedy Gonzales (U) [!]"}, {0xbfc0042d,131072,"Spider-Man and the X-Men - Arcade's Revenge (U) [BF]"}, {0x1009c6c0,131072,"Spider-Man and the X-Men - Arcade's Revenge (U)"}, {0x735b29e2,262144,"Spirou (U) (M4) [S]"}, {0x35415a00,262144,"Spirou (U) (M4) [S][a1]"}, {0x24dd09e0,524288,"Sports Collection (J)"}, {0x235171c4,524288,"Sports Illustrated Championship Football & Baseball (U) [!]"}, {0xf0d76d49,262144,"Sports Illustrated for Kids - Ultimate Triple Dare! (U) [!]"}, {0x552a53b9,131072,"Spot - The Cool Adventure (J)"}, {0xa26cab1c,131584,"Spot - The Cool Adventure (U)"}, {0x2ca58280,32768,"Spot (J)"}, {0xfcd61b98,32768,"Spot (U) [!]"}, {0x70e5ed99,65536,"Spud's Adventure (U)"}, {0x6d40e5a2,131072,"Spy vs Spy - Operation Boobytrap (U) (Kemco 1992) [S][!]"}, {0x36645203,131072,"Spy vs Spy - Operation Boobytrap (U) (Kemco 1996) [S]"}, {0x8b882745,65536,"Square Deal - The Game of Two Dimensional Poker (U) [!]"}, {0xb4fa9cf2,524288,"SS Spinner - Yo for it (J) [S]"}, {0xe032e502,131072,"Star Hawk (U) [!]"}, {0xd6fd967c,262144,"Star Sweep (J) [S]"}, {0xd925d15d,131072,"Star Trek - Generations - Beyond the Nexus (E) [S]"}, {0x9f2d11c6,131072,"Star Trek - Generations - Beyond the Nexus (U) [!]"}, {0x3a5a56cb,131072,"Star Trek - The Next Generation (U) [!]"}, {0x605de43a,131072,"Star Trek (U) [!]"}, {0x6cb73dc7,524288,"Star Wars - Super Return of the Jedi (U) [S][!]"}, {0x05c488f5,524288,"Star Wars - Super Return of the Jedi (U) [S][BF]"}, {0x8515e78d,131072,"Star Wars - The Empire Strikes Back (U) (Capcom) [BF]"}, {0xa0fff8e7,131072,"Star Wars - The Empire Strikes Back (U) (Capcom)"}, {0x240c589d,131072,"Star Wars - The Empire Strikes Back (U) (UBI Soft) [!]"}, {0x1e3305c0,131072,"Star Wars (U) (Capcom) [BF]"}, {0xb01da1ae,131072,"Star Wars (U) (Capcom)"}, {0x7e3f6bbe,131072,"Star Wars (U) (UBI Soft)"}, {0x5d8deb5b,131072,"Star Wars (V1.1) (U) (Nintendo) [!]"}, {0x4789295c,131072,"Stargate (U) [!]"}, {0x86107477,131072,"Stop That Roach! (U)"}, {0xc775f488,524288,"Street Fighter II (J) [S]"}, {0x54a0aaa3,524288,"Street Fighter II (UE) [S][!]"}, {0x5bbacaa8,131072,"Street Racer (J)"}, {0xfcfb4ce4,131072,"Street Racer (U) [!]"}, {0x7751e066,32768,"Street Rider (Game 1 of Sachen 4-in-1 Volume 1) (Unl) [!]"}, {0x45e3e8f2,524288,"Study Boy Kokugo 2 (J)"}, {0xbadc7cee,131072,"Sumo Fighter (U) [!]"}, {0x31a227ed,131072,"Super Battle Tank (U)"}, {0xfc516de2,262144,"Super Bikkuri (J) [BF]"}, {0xc1e1a041,262144,"Super Bikkuri (J)"}, {0x6b497842,524288,"Super Black Bass (U) [S][!]"}, {0x8a7c1678,1048576,"Super Black Bass Pocket (J) [S]"}, {0x68a553b6,1048576,"Super Black Bass Pocket 2 (J) [S]"}, {0x239711ec,524288,"Super Bomberman B-Daman (J) [S] (HUC-1 chip)"}, {0x7a07adcd,524288,"Super Bomberman B-Daman (J) [S]"}, {0xb503ffad,131072,"Super Bombliss (J) [S]"}, {0x037d966a,65536,"Super Chinese Land (J)"}, {0x7d1d8fdc,1048576,"Super Chinese Land 1-2-3 (J) [S]"}, {0x88508483,262144,"Super Chinese Land 2 (J)"}, {0xe01caf0b,262144,"Super Chinese Land 3 (J) [S]"}, {0xf9620cff,262144,"Super Chinese Land 3 Dash (J) [S]"}, {0x695f4600,524288,"Super Donkey Kong (J) [S]"}, {0x2359d61e,131072,"Super Hunchback (E)"}, {0xf20078c2,131072,"Super Hunchback (J)"}, {0x1a45706e,131072,"Super Hunchback (U)"}, {0x4b1dfe3d,131072,"Super Kick Off (U)"}, {0xd9f3eb9f,131072,"Super Mario 4 (Unl)"}, {0x90776841,65536,"Super Mario Land (V1.0) (JUA) [!]"}, {0x2c27ec70,65536,"Super Mario Land (V1.1) (JUA) [!]"}, {0xd5ec24e4,524288,"Super Mario Land 2 - 6 Golden Coins (V1.0) (UE) [!]"}, {0xbd0285f4,524288,"Super Mario Land 2 - 6 Golden Coins (V1.0) (UE) [BF]"}, {0x635a9112,524288,"Super Mario Land 2 - 6 Golden Coins (V1.2) (UE) [!]"}, {0xa715daf5,524288,"Super Mario Land 2 - 6 Tsu no Kinka (V1.0) (J)"}, {0xc0fdeb7d,524288,"Super Mario Land 2 - 6 Tsu no Kinka (V1.2) (J) [a1]"}, {0x29e0911a,524288,"Super Mario Land 2 - 6 Tsu no Kinka (V1.2) (J)"}, {0x40be3889,524288,"Super Mario Land 3 - Wario Land (JUE) [!]"}, {0xe94ac677,131072,"Super Mario Land 4 (J) [!]"}, {0x0c83f4fd,256953,"Super Mario Quest (Final Fantasy hack V0.2 by PR) (U)"}, {0x3497ab07,256957,"Super Mario Quest (Final Fantasy hack V0.5 by PR) (U)"}, {0xe8b4891f,262144,"Super Momotaro Dentetsu 2 (J)"}, {0x3e2810be,131072,"Super Off Road (U) [!]"}, {0x35ef33d8,131072,"Super Off Road (U) [BF]"}, {0xcde0ff00,262144,"Super Pachinko Wars (J) [S]"}, {0x7960f33f,131072,"Super RC Pro-Am (UE) [!]"}, {0x7dd9d7d6,131072,"Super Robot War (J)"}, {0xdf8b2b20,524288,"Super Robot War 2G (J) [S]"}, {0x82a26c13,524288,"Super Robot War 2G (J) [S][a1]"}, {0x06155099,524288,"Super Robot War 2G (J) [S][a2]"}, {0xb88f0974,1048576,"Super Robot War 2G (J) [S][p1]"}, {0x3874b7a2,131072,"Super Scrabble (U) [!]"}, {0x984d0f7f,65536,"Super Snaky (J) [S]"}, {0xa269559f,131072,"Super Street Basketball (J)"}, {0x8090c9cc,131072,"Super Street Basketball 2 (J) [S]"}, {0x358e0091,131072,"Superman (U) [S][!]"}, {0x76ae62c8,131072,"Swamp Thing (U) [!]"}, {0x5b7ff38c,262144,"Sword of Hope 2, The (U) [S][!]"}, {0xc7e48c7c,131072,"Sword of Hope, The (E) (Swedish) [!]"}, {0x498e0e9f,131072,"Sword of Hope, The (G)"}, {0x7e923846,131072,"Sword of Hope, The (U) [!]"}, {0x2868aabf,131072,"Sword of Su Zi, The - Trial Version (V1.1) (Unl)"}, {0x7ec795fa,131072,"T2 - The Arcade Game (J)"}, {0x00f09c7f,131072,"T2 - The Arcade Game (U) [!]"}, {0x96555e9a,262144,"Taachiyan (J) [S]"}, {0x62a31de6,65536,"Taikyoku Renju (J)"}, {0xc5acce7c,65536,"Tail Gator (U) [!]"}, {0xd29ddc91,131072,"Tale Spin (E)"}, {0xde383e73,131072,"Tale Spin (U)"}, {0x084c2401,524288,"Tamagotchi (F) [S]"}, {0xefc0f266,524288,"Tamagotchi (J) [S]"}, {0x677c0ee4,524288,"Tamagotchi (J) [S][BF]"}, {0xdbf1bd20,524288,"Tamagotchi (UE) [S][!]"}, {0x19889c43,524288,"Tamagotchi 2 (J) [S]"}, {0x6db395e6,524288,"Tamagotchi 2 (J) [S][BF]"}, {0x9694d69d,524288,"Tamagotchi 3 (J) [S]"}, {0x69f29cf2,131072,"Taruru-To (J)"}, {0x0aad5217,131072,"Taruru-To 2 (J)"}, {0xc2f50fb3,131072,"Tarzan (U) [!]"}, {0x9ea867a7,32768,"Tasmania Story (J)"}, {0xa33c4fff,32768,"Tasmania Story (U) [!]"}, {0x7625e5a5,524288,"Tatsujin Techou (J)"}, {0x7a4784f3,131072,"Taz-Mania (E)"}, {0x22d07cf6,262144,"Taz-Mania (U)"}, {0x4ccb65e0,131072,"Taz-Mania 2 (U) [!]"}, {0x28b85584,524288,"TDL Fantasy Tour (J) [S]"}, {0xcfd74e34,262144,"Tecmo Bowl (J)"}, {0xe4f29760,262144,"Tecmo Bowl (U)"}, {0xcf24506c,262144,"Teenage Mutant Hero Turtles - Back From the Sewers (E) [!]"}, {0x9f3245f3,131072,"Teenage Mutant Hero Turtles III - Radical Rescue (E) [!]"}, {0x44f51c73,262144,"Teenage Mutant Ninja Turtles - Back From the Sewers (U) [!]"}, {0xdca70cbb,262144,"Teenage Mutant Ninja Turtles - Back From the Sewers (U) [a1]"}, {0x5a6984c3,131072,"Teenage Mutant Ninja Turtles - Fall of the Foot Clan (U) [!]"}, {0x74078236,131072,"Teenage Mutant Ninja Turtles (J) [!]"}, {0x84e6fb25,262144,"Teenage Mutant Ninja Turtles 2 (J)"}, {0x55153bb5,131072,"Teenage Mutant Ninja Turtles 3 - Radical Rescue (J)"}, {0x58832bbc,131072,"Teenage Mutant Ninja Turtles III - Radical Rescue (U)"}, {0x7b903a6f,65536,"Tekichu Rush (J)"}, {0x22d8889e,131072,"Tekkaman Blade (J) [!]"}, {0xb8da8eb5,131072,"Tekkyufight! (J)"}, {0xa9018354,262144,"Tenchi Wokurau (J)"}, {0xb71396a6,131072,"Tenjin Kaisen - Mercenary Force (J)"}, {0x211c4611,262144,"Tenjin Kaisen 2 (J)"}, {0x5009215f,32768,"Tennis (JUA) [!]"}, {0xac044e9a,131072,"Tensai Bakabon (J)"}, {0x21848101,131072,"Terminator 2 - Judgment Day (UE) [!]"}, {0xc77e316f,32768,"Tesserae (U) [!]"}, {0x63f9407d,32768,"Tetris (V1.0) (JU) [!]"}, {0x46df91ad,32768,"Tetris (V1.1) (JU) [!]"}, {0xaa4a1edb,131072,"Tetris 2 (U) [!]"}, {0xea19a9d9,131072,"Tetris 2 (UE) [S][!]"}, {0xb76c769b,524288,"Tetris Attack (V1.0) (U) [!]"}, {0x5ee45a4d,524288,"Tetris Attack (V1.1) (U) [S]"}, {0x7be5a73f,131072,"Tetris Blast (U) [S][!]"}, {0x9dfcb385,131072,"Tetris Flash (J) [S]"}, {0x2ec9120a,262144,"Tetris Plus (J) [S]"}, {0xdafc3bff,262144,"Tetris Plus (U) [S][!]"}, {0xeffb6d09,262144,"Tetris Plus (U) [S][BF]"}, {0x149e9393,131072,"Thunderbirds (J)"}, {0xe0f7a702,524288,"Tiny One Gameboy (V1.1) (J)"}, {0x11a06fe3,524288,"Tiny One Gameboy Special Use - 5-3 Bright Season (V1.1) (J)"}, {0xd3904be9,131072,"Tiny Toon Adventures - Wacky Sports (U) [!]"}, {0xd731bda2,131072,"Tiny Toon Adventures - Wacky Sports (U) [a1]"}, {0xeaf523ec,131072,"Tip Off (UE) [!]"}, {0xfb13462b,131072,"Tiny Toon Adventures - Bab's Big Break (J)"}, {0x9b5e6219,131072,"Tiny Toon Adventures - Bab's Big Break (U) [!]"}, {0xc5c7868d,131072,"Tiny Toon Adventures 2 - Montana's Movie Madness (U) [!]"}, {0x0fd47f8a,131072,"Tiny Toon Adventures 2 (J)"}, {0x3fa10931,131072,"Tiny Toon Adventures 3 (J)"}, {0x814fa146,262144,"Titus the Fox (U)"}, {0x61a0803b,65536,"To-Heart Columns (J)"}, {0x9db7dcc3,131072,"Tokio Senki (J)"}, {0x56afca4c,262144,"Tokoro Jr. (J) [S][!]"}, {0xc2dbd1aa,131072,"Tom & Jerry - Frantic Antics (U)"}, {0xca836e6d,131072,"Tom & Jerry (J)"}, {0x0636d89e,131072,"Tom & Jerry (U)"}, {0xdd19a9ec,131072,"Tom & Jerry Part 2 (J)"}, {0x0506c12b,131072,"Top Gun 2 (U) [!]"}, {0xd577d8e0,262144,"Top Ranking Tennis (U) [!]"}, {0x1fb35885,131072,"Torpedo Range (J)"}, {0xed9882a9,131072,"Torpedo Range (UE) [!]"}, {0x3700927f,131072,"Total Carnage (U) (Nintendo) [!]"}, {0x9b5b7bff,131072,"Totsugeki Tank (J)"}, {0x8f9e28ad,262144,"Tottemo Luckyman (J) [S]"}, {0xf924bdb1,131072,"Tower of Druaga, The (J)"}, {0xea59c6e3,131072,"Toxic Crusaders (U)"}, {0xd34287cc,524288,"Toy Story (U) [S][!]"}, {0xc0ef39f0,131072,"Track & Field (U)"}, {0x48d37cd2,131072,"Track Meet (J)"}, {0x7b5dc3e4,131072,"Track Meet (U)"}, {0x1c2fc6bf,32768,"Trap & Turn (Sachen) (Unl) [!]"}, {0xafefd085,131072,"Trappers Tengoku (J)"}, {0x4a38be7d,131072,"Trax (U) [!]"}, {0x11568e64,262144,"Trip World (J)"}, {0xedec63e6,262144,"True Lies (U) [!]"}, {0xfd16ac45,32768,"Trump Boy (J) [a1]"}, {0x694c66cb,32768,"Trump Boy (J)"}, {0x39157849,65536,"Trump Boy 2 (J)"}, {0x8341be0f,131072,"Trump Collection GB (J)"}, {0xceee6a61,131072,"Tsume Go Series 1 - Fujisawa Hideyuki Meiyo Kisei (J) [S]"}, {0x43e2a5c0,65536,"Tsume Shougi - Hyaku Ban Shoubu (J)"}, {0xd5434c94,131072,"Tsume Shougi - Kanki 5 Dan (J) [S]"}, {0x6403af06,65536,"Tsume Shougi - Mondai Teikyou Shougi Sekai (J)"}, {0xc97daaca,65536,"Tsumego (J)"}, {0x881afd62,131072,"Tumble Pop (J)"}, {0x8a3aab31,131072,"Tumble Pop (U)"}, {0xdc324100,524288,"Turi Sensei (J) [S]"}, {0x901a0147,131072,"Turn & Burn (U) [BF]"}, {0xb6c09e36,131072,"Twin (J)"}, {0x91394bd8,131072,"Turn & Burn (U) [!]"}, {0x518c2d2f,262144,"Turok - Battle of the Bionosaurs (UE) (M4) [!]"}, {0x2359bf0c,131072,"Turrican (UE) [!]"}, {0x18f64779,262144,"TV Champion (J) [S]"}, {0x017fd6f5,131072,"Twin-Bee Da!! (J)"}, {0xd7e52d4e,524288,"Two Hearts (Beta) (J)"}, {0x5bf747f8,262144,"Uchuu Senkan Yamato (J) [!]"}, {0xd2f94181,131072,"Ultima - Runes of Virtue (J) [!]"}, {0xc44a0f1e,131072,"Ultima - Runes of Virtue (U)"}, {0x796fd6a5,262144,"Ultima - Runes of Virtue 2 (J) [!]"}, {0xc449fbbf,262144,"Ultima - Runes of Virtue 2 (U)"}, {0x12de9bac,131072,"Ultra Golf (U)"}, {0x5944c3ed,131072,"Ultraman (J)"}, {0x468d1a2e,131072,"Ultraman Ball (J) [S][!]"}, {0x91eda860,65536,"Ultraman Club 1 (J) [!]"}, {0xb904230d,262144,"Ultraman Gekiden (J) [S]"}, {0x19ff5b3e,524288,"Umi no Nushitsuri 2 (J) [S]"}, {0xf71752dd,262144,"Undercover Cops (J) [BF]"}, {0xb7af37f5,262144,"Undercover Cops (J)"}, {0x82511a8f,262144,"Undoukai (J)"}, {0x99ae9d06,262144,"Universal Soldier (U)"}, {0xa37c022d,262144,"Uno - Small World (J) [!]"}, {0xa7ad65ef,131072,"Uno 2 - Small World (J) [S][!]"}, {0xf7e1c9c5,65536,"Uoozu (J) [!]"}, {0x89625945,524288,"Urban Strike (U) [S][!]"}, {0x56800c6b,262144,"Urusei Yatsura (J) [!]"}, {0xf2119a2d,65536,"Valations (J)"}, {0x956b603c,131072,"Vattle Guice (J) [!]"}, {0xc8be05d8,524288,"Vegas Stakes (U) [S][!]"}, {0x0817aa32,65536,"Velious (J)"}, {0xb55eb427,131072,"Velious II (J)"}, {0x449cf2e4,131072,"Versus Hero (J)"}, {0x642aee97,32768,"Vex Block (Sachen) (Unl) [!]"}, {0x220bbcb6,131072,"Virtual Wars (J)"}, {0x89a7aeca,262144,"Vitamina Kingdom (J)"}, {0x0d06ea32,32768,"Volley Fire (J)"}, {0xd149652b,262144,"V-Rally - Championship Edition (E) (M3) [!]"}, {0x20ae389a,65536,"VS Battler (J)"}, {0xe69a6f0a,131072,"Wapiko no Waku Waku Stamp Ralley! - Kingyo Chuuihou! (J)"}, {0x927b57a1,262144,"Wario Blast (U) [S][!]"}, {0x853dd162,262144,"Wario Blast (U) [S][BF]"}, {0x4b08a38a,1048576,"Warioland 2 (UE) [S] (MBC1 hack)"}, {0x9c54358d,1048576,"Warioland 2 (UE) [S][!]"}, {0xecf1b801,65536,"Warrior (J)"}, {0xf5d364db,262144,"Wars (J)"}, {0x4786fd6e,262144,"Water World (U)"}, {0xa6595506,131072,"Wave Race (UE) [!]"}, {0x829ea425,262144,"Wayne's World (U)"}, {0x974e712b,131072,"WCW Main Event (U) [!]"}, {0x9812a6c6,262144,"Wedding Peach (J) [S][!]"}, {0xf6e2baae,262144,"Welcome Nakayosi Park (J) [!]"}, {0xc811560b,131072,"We're Back - A Dinosaur's Story (U)"}, {0xe8b26577,131072,"Wheel of Fortune (Gluecksrad) (G) [!]"}, {0x8408fe48,131072,"Wheel of Fortune (U) [!]"}, {0x3116b0da,131072,"Wheel of Fortune (U) [a1]"}, {0x88bf466b,131072,"Who Framed Roger Rabbit (U) [BF]"}, {0xb93138fa,131072,"Who Framed Roger Rabbit (U) [!]"}, {0x72462125,65536,"WildSnake (U) [S]"}, {0x14e91757,131072,"Winner's Horse (J) [!]"}, {0x99afd62c,131072,"Winter Gold (U) [BF]"}, {0x3c4cd245,131072,"Winter Gold (U)"}, {0x4d640e73,262144,"Wizardry Gaiden 1 - Suffering of the Queen (J) [!]"}, {0xf6826d12,262144,"Wizardry Gaiden 2 - Curse of the Ancient Emperor (J) [!]"}, {0x59ffaeca,524288,"Wizardry Gaiden 3 - Scripture of the Dark (J) [BF]"}, {0x104eb503,65536,"Wizards & Warriors Chapter X - The Fortress of Fear (UE) [!]"}, {0x075a8231,131072,"Wordtris (U) [!]"}, {0x6dce0366,131072,"Wordtris (U) [BF]"}, {0xc5e037d1,65536,"Wordzap (U) [BF]"}, {0xe8e57b50,65536,"Wordzap (U)"}, {0xeaa9a468,131072,"World Beach Volleyball 1991 GB Cup (J) [BF]"}, {0xa2894581,131072,"World Beach Volleyball 1991 GB Cup (J)"}, {0x47feadf2,32768,"World Bowling (J)"}, {0x896e76a2,32768,"World Bowling (U)"}, {0x77c3aa0b,131072,"World Circuit Series (U)"}, {0x50c2ada1,131072,"World Cup (J)"}, {0x6a3272b1,524288,"World Cup '98 (UE) [S][!]"}, {0xfdefa88d,131072,"World Cup Striker (J)"}, {0x9d27f9de,262144,"World Cup USA '94 (J)"}, {0x60231f83,262144,"World Cup USA '94 (UE) [!]"}, {0x67303954,524288,"World Heroes 2 Jet (U) [S][!]"}, {0x2914e23d,131072,"World Ice Hockey (J) [BF]"}, {0x4e345023,131072,"World Ice Hockey (J)"}, {0x57d21ef4,524288,"World Soccer GB (J) [S]"}, {0x66130a7a,65536,"Worm Visitor (Game 4 of Sachen 4-in-1 Volume 5) (Unl) [!]"}, {0x2ebc40c2,262144,"Worms (U) [!]"}, {0x3ab55613,131072,"WWF - King of the Ring (J)"}, {0x7f0cd87c,131072,"WWF - King of the Ring (U) [!]"}, {0x63faab12,262144,"WWF Raw (U) [BF]"}, {0x1889552f,262144,"WWF Raw (U)"}, {0xf28e5aa1,131072,"WWF Superstars (J)"}, {0xadbc4e0a,131072,"WWF Superstars (UE) [!]"}, {0xca12d752,131072,"WWF Superstars 2 (J)"}, {0x8ece1c04,131072,"WWF Superstars 2 (U) [!]"}, {0x6015b7e1,262144,"WWF Warzone (U)"}, {0x75e1d268,262144,"Xekkusu (J) [!]"}, {0x2feb70d2,131072,"Xenon 2 (J)"}, {0xde398678,131072,"Xenon 2 (U)"}, {0xa197bdb7,524288,"Xerd!! (J)"}, {0xa6905fb2,131072,"Xiang Pu -- Dong Hai Dao Chang Suo (Sumo Fighter) (J)"}, {0x022eb849,131072,"XVII Olympic Winter Games, The - Lillehammer 1994 (U) [BF]"}, {0x1a98f0a4,131072,"XVII Olympic Winter Games, The - Lillehammer 1994 (U)"}, {0xcc19768e,262144,"Yaiba (J) [!]"}, {0xd185b939,524288,"Yaka Sekaishi (J)"}, {0x90cb60c1,32768,"YakyuMan (J)"}, {0xa09c1790,524288,"Yamakawa Nihon (J)"}, {0x402d4d47,65536,"Yannick Noah Tennis (F)"}, {0x5b66e143,32768,"Yie Ar Kung Fu (V1.1) (Unl)"}, {0x6e7bb436,131072,"Yogi Bear in Yogi Bear's Goldrush (E) [!]"}, {0xa86bd81b,131072,"Yogi Bear in Yogi Bear's Goldrush (U) [!]"}, {0xc8e01c7c,262144,"Yojijukugo 288 (J)"}, {0x46af90da,262144,"Yoku Tsukawareru Eiken 2 Kyuu Level no Kaiwa Hyougen 333 (J)"}, {0xf2f4bcca,65536,"Yoshi (U) [!]"}, {0x75336712,131072,"Yoshi's Cookie (U) [!]"}, {0xa37255fe,131072,"Yossi no Cookie (J)"}, {0x9b6fcc76,65536,"Yossi no Tamago (J)"}, {0x3beb7239,524288,"Yossy no Panepon (J)"}, {0x8875ec54,1048576,"Yugio (J) [S]"}, {0x7103b4ac,262144,"Yuuyuu 1 (J)"}, {0x6a6d7350,262144,"Yuuyuu 2 (J)"}, {0x25c618f6,262144,"Yuuyuu 3 (J)"}, {0x3e7c6b2b,262144,"Yuuyuu 4 (J) [S]"}, {0xa67cd2cc,262144,"Yuu-Yuu Hakusho 3 (J)"}, {0x26d2d5c2,524288,"Z - Miracle of the Zone, The (J) [S]"}, {0xdc010f04,262144,"Z Kai - Chuga Kueitango 1132 Translator (J)"}, {0xd792f747,262144,"Z Kai - Eigo Kobun 285 Translator (J)"}, {0x3fac5c42,262144,"Z Kai - Etan 1500 Translator (J)"}, {0x12e738ea,262144,"Z Kai - Jukugo 1017 Translator (J)"}, {0xb3114619,262144,"Z Kai - Kyukyoku no Kobun Tango (J) [a1]"}, {0x99062c13,262144,"Z Kai - Kyukyoku no Kobun Tango (J)"}, {0x995d0838,1048576,"Zankurou Musouken (J) [S][!]"}, {0x7bfd1cff,131072,"ZAS (J)"}, {0x642c7ebe,131072,"Zen Intergalactic Ninja (E)"}, {0x88190730,131072,"Zen Intergalactic Ninja (U)"}, {0x119bcad5,262144,"Zennichi Jet Japan Pro Wrestling (J) [S]"}, {0x7279b3c4,65536,"Zipball (Game 4 of Sachen 4-in-1 Volume 9) (Unl) [!]"}, {0x684d1484,32768,"Zipball (Unl)"}, {0xc32dca06,65536,"Zoids (J)"}, {0xfc6f3bc2,32768,"Zoo Block (Sachen) (Unl) [!]"}, {0xae13e227,131072,"Zool (E) (Gremlin) [!]"}, {0xef54b46e,131072,"Zool (U) (Gametek) [!]"}, {0x10e1a10c,65536,"Zoop (J)"}, {0x14f8b6bb,65536,"Zoop (U) [!]"}, {0x96d343cf,524288,"Last Bible 2 (Chinese) [p1][!]"}, {0xc5571f88,1048576,"Pokemon Blue (Chinese) [S][p1][!]"}, {0x727d5509,131072,"Prehistorik Man (J) [S]"}, {0x44257f02,524288,"SD Gundam Gaiden - Lacroan Heroes (Chinese) [p1][!]"}, {0xb07a2745,65536,"Splitz (J)"}, {0x7e054a88,131072,"Addams Family, The - Pugsley's Scavenger Hunt (U)"}, {0xce457dfd,262144,"Batman Forever (U) [BF]"}, {0x41dbb5fb,262144,"Bionic Commando (U) [!]"}, {0x1bcad99d,524288,"Bugs Bunny - Crazy Castle 3 (J) [f1]"}, {0x67a45d19,131072,"Chase HQ (V1.1) (U) [!]"}, {0x35d9be0e,131072,"Days of Thunder (U) [!]"}, {0x3ef2e823,131072,"DX Bakenoh Z (V1.0) (J)"}, {0xbead8ae4,65536,"Elevator Action (J) [!]"}, {0xaf4a5de1,524288,"FIFA Soccer '96 (U) [S]"}, {0xe3b59b7e,131072,"Fortified Zone (Ikari no Yousai) (U)"}, {0x1c2ba2a1,131072,"Ikari no Yousai (Fortified Zone) (J)"}, {0x9c6a4918,131072,"Kachiu Mayoso Keiba Kizoku Ex 95 (J)"}, {0xfc20ebf0,131072,"Legend (J)"}, {0x17533700,262144,"Mario's Picross (J) [S]"}, {0x85c984f2,262144,"Mogu Mogu Gombo (J) [S]"}, {0xd3741a3a,131072,"Ninja Gaiden Shadow (U)"}, {0x2d08d27f,131072,"Oira Jajamaru Sekaidai Boken (J) [!]"}, {0x6da713e3,131072,"Pinball Dreams (UE) [!]"}, {0xf8c2504d,1048576,"Pocket Monsters Green (Chinese Blue Hack) (J) [S]"}, {0xd622859a,1048576,"Pocket Monsters Yellow (V1.0) (Chinese) (Unl) [S]"}, {0x796fbb66,65536,"Racing Damashii (J) [!]"}, {0x4e05537e,65536,"Ranma Nibun no Ichi (J)"}, {0xb7a0cdd1,524288,"Rockman World 4 (J) (hacked Megaman)"}, {0x0d4c02a7,262144,"Sanrio Uranai Party (J)"}, {0x87f0cfad,262144,"Shikakui Atama wo Maruku Suru - Shakai Battle (J)"}, {0x701ccdb3,65536,"Solomon's Club (UE) [!]"}, {0xf8fc0b41,262144,"Takahashimeijin no Bouken Jima 3 (J)"}, {0x5d2bd778,262144,"TinTin in Tibet (U) [S]"}, {0xc88e751d,262144,"Turok - Battle of the Bionosaurs (J)"}, {0x32c94538,524288,"Wizardry Gaiden 3 - Scripture of the Dark (J) [!]"}, {0xb14920f0,2097152,"Animaster GB (J) [!]"}, {0xe6607e29,32768,"Othello (UE) [!]"}, {0x57dc27ab,524288,"Gawa no Kawanushi 3 (J) [S][p1][!]"}, {0x96bdcb9c,540672,"Mortal Kombat I & II (U) [!]"}, {0x47e86daf,1048576,"Mortal Kombat I & II (U) [f1]"}, {0x8c17aae6,1048576,"Pocket Monsters Yellow (Chinese) (Unl) [S][!]"}, {0x07b1be0b,1048576,"Super Minna no Konchu Daizukan II (Unl)"}, {0x600a6ad5,262144,"Bubsy 2 (U) [!]"}, {0x78bf3633,131072,"Caesar's Palace (E) (M5)"}, {0x4e17d08a,131072,"Gargoyle's Quest - Ghosts'n Goblins (F)"}, {0xa3164516,262144,"Bubsy 2 (U) [h1]"}, {0xc66fc56f,262144,"Aguri Suzuki F-1 Super Driving (J) [h1]"}, {0xb61e47b4,131072,"Amazing Spider-Man 2, The (UE) [h1]"}, {0xe994484d,131072,"Amazing Spider-Man 2, The (UE) [h2]"}, {0xa1cb2933,65536,"Amazing Spider-Man, The (UE) [h1]"}, {0x7b23e05c,262144,"Animaniacs (U) [S][h1]"}, {0x08108068,262144,"Animaniacs (U) [S][h2]"}, {0xe928c629,524288,"Battle Arena Toshinden (J) [S][h1]"}, {0x1884cb21,131072,"Battle Unit Zeoth (J) [h1]"}, {0x7cbde1a9,262144,"Bionic Commando (J) [h1]"}, {0xbde5077e,131072,"Block Kuzushi (J) [S][h1]"}, {0xb0b5a5de,1048576,"Bokemob V2.2 (Pokemon Blue Hack) [h1]"}, {0x46631a03,1048576,"Bokemob v2.5 (Pokemon Blue Hack) [h1]"}, {0x4389fb4b,131072,"Boku Drakura Kun 2 (Castlevania 2) (J) [h1]"}, {0xdf72a7ef,65536,"Boomer's Adventure in ASMIK World (J) [h1]"}, {0xe11202c7,65536,"Boomer's Adventure in ASMIK World (U) [h1]"}, {0x8b5d3ec1,65536,"Boomer's Adventure in ASMIK World (U) [h2]"}, {0x6f848e69,131072,"Boomer's Adventure in ASMIK World 2 (J) [h1]"}, {0xe446121c,131072,"Bubble Bobble (U) (GB) [h1]"}, {0x23ea8d35,32768,"Bubble Ghost (U) [h1]"}, {0xa50bd433,32768,"Bubble Ghost (U) [h2]"}, {0xf04675ad,65536,"Bugs Bunny (U) [h1]"}, {0xb61f5352,524288,"Captain Tsubasa (J) [S][h1]"}, {0xb3f577bc,262144,"Captain Tsubasa VS (J) [h1]"}, {0x3fe36a93,131072,"Casino Funpak (U) [h1]"}, {0x14598061,131072,"Casino Funpak (U) [h2]"}, {0x3d0f9750,32768,"Castelian (U) [h1]"}, {0x02349cb4,131072,"Castle Quest (U) [h1]"}, {0x3e2c6d68,131072,"Castle Quest (U) [h2]"}, {0xfd1f0679,262144,"Cave Noire (J) [h1]"}, {0xc0a682c8,65536,"Chacha Maru Panic (J) [h1]"}, {0x5aaa2d5d,65536,"Chibi Maruko Chan - Okozukaidaisakusen (J) [h1]"}, {0x6b9c4cdf,262144,"Chiki Race (J) [h1]"}, {0x2814c76f,131072,"Chuck Rock (U) [h1]"}, {0x9e784cd2,131072,"Chuck Rock (U) [h2]"}, {0xbf2ab01f,131072,"Chuck Rock (U) [h3]"}, {0x3b7c6a1d,131072,"Chuck Rock (U) [h4]"}, {0x5690de6c,131072,"Chuck Rock (U) [h5]"}, {0xaaa41a14,131072,"Chuck Rock (U) [h6]"}, {0x431e7467,131072,"Chuck Rock (U) [h7]"}, {0xab3c7bb9,131072,"Chuck Rock (U) [h8]"}, {0x734502ab,262144,"Daffy Duck - The Marvin Missions (J) [S][h1]"}, {0xf1c6b5ed,262144,"Daisenryaku Hiro (J) [h1]"}, {0xa0d3a21b,262144,"Daisenryaku Hiro (J) [h2]"}, {0xc3171dd8,524288,"Donkey Kong Land (U) [S][h1]"}, {0x9c14b87b,524288,"Donkey Kong Land (U) [S][h2]"}, {0x9f72cbb7,131072,"Doraemon (J) [h1]"}, {0xce29eae5,131072,"Doraemon 2 (J) [h1]"}, {0x20a48781,131072,"Double Dragon (J) [h1]"}, {0x0e1de7ff,32768,"Dr. Hatio V1.0 (Dr. Mario Hack) [h1]"}, {0xd24b141c,32768,"Dr. Mario (V1.0) (JU) [h1]"}, {0xd676691b,32768,"Dr. Mario (V1.0) (JU) [h2]"}, {0xa6353c07,262144,"Dragon Slayer 2 (Dorasure Gaiden) (J) [h1]"}, {0x9f07e00c,131072,"Dragon's Lair (J) [h1]"}, {0x2f1f6e71,131072,"Duck Tales 2 (U) [h1]"}, {0x46141ef6,1048576,"Dude, Where's My Char v0.01 (Pokemon Blue Hack) [h1]"}, {0x819fd93c,262144,"Exchanger (J) [S][h1]"}, {0xb604565f,262144,"F-1 Pole Position (U) [h1]"}, {0x9aaa0e38,262144,"F-1 Pole Position (U) [h2]"}, {0xf9444f7f,262144,"F-1 Pole Position (U) [h3]"}, {0xf8cc4dfd,131072,"F-1 Spirit (J) [h1]"}, {0x34d0eb55,131072,"Final Fantasy Legend (Sa-Ga) (U) [h1]"}, {0x5cd18d2e,262144,"Final Fantasy Legend II (Sa-Ga 2) (U) [h1]"}, {0x3bb2d561,262144,"Final Fantasy Legend II (Sa-Ga 2) (U) [h2]"}, {0xadb58ca4,262144,"Final Fantasy Legend II (Sa-Ga 2) (U) [h3]"}, {0xfa154fd6,262144,"Final Fantasy Legend III (Sa-Ga 3) (U) [h1]"}, {0xafb75ca9,262144,"Final Fantasy Legend III (Sa-Ga 3) (U) [h2]"}, {0xc6f02ec9,262144,"Final Fantasy Legend III (Sa-Ga 3) (U) [h3]"}, {0xb94722f2,262144,"Flintstones, The (U) [h1]"}, {0x3d0cf664,262144,"Foreman for Real (U) [h1]"}, {0x81cd6254,8192,"Game Genie V1.17 (Unl) [h1]"}, {0xd9f7f72d,131072,"Gargoyle's Quest - Ghosts'n Goblins (UE) [h1]"}, {0xa771f632,262144,"GB Genjin 2 (Bonk's Revenge) (J) [S][h1]"}, {0x271ff1b3,262144,"Go Go Ackman (J) [S][h1]"}, {0x4240b81c,262144,"Go Go Ackman (J) [S][h2]"}, {0x1acc359f,131072,"Home Alone 2 (U) [h1]"}, {0x819f1072,131072,"Houghton Mifflin Spell Checker and Calculator (U) [h1]"}, {0x13bf0573,131072,"Houghton Mifflin Spell Checker and Calculator (U) [h2]"}, {0x10e42f20,131072,"Jungle Book. The (U) [h1]"}, {0xa055ed80,262144,"Jurassic Park 2 - The Chaos Continues (UE) [S][h1]"}, {0xf5e08610,131072,"Kid Icarus - Of Myths and Monsters (UE) [h1]"}, {0x3b9b4ceb,131072,"Kid Icarus - Of Myths and Monsters (UE) [h2]"}, {0x9c19c0c2,131072,"Kid Icarus - Of Myths and Monsters (UE) [h3]"}, {0x574c0084,262144,"Knal Fantasy Adventure (Rev 1) (Final Fantasy Adv Hack) (U) [h1]"}, {0x3fc8db0e,65536,"Kung-Fu Master (Spartan X) (U) [h1]"}, {0x967c1fad,524288,"Legend of Zelda, The - Link Gets Laid (P3 hack) (1) [h1]"}, {0x0bc927bc,524288,"Legend of Zelda, The - Link Gets Laid (P3 hack) (2) [h1]"}, {0x7f989f50,524288,"Legend of Zelda, The - Link Gets Laid (P3 hack) (3) [h1]"}, {0x28965e82,262144,"Metroid 2 - Samus Bares All (P3 Hack) [h1]"}, {0x6c7c652d,131072,"Miracle Adventure of Esparks (J) [h1]"}, {0x08f13b2f,524288,"Momotaro Dengeki 2 (J) [S][h1]"}, {0xd91de820,32768,"Motocross Maniacs (J) [h1]"}, {0x8ffd9e61,262144,"Mystic Quest (U) [h1]"}, {0xe8bc8f03,524288,"Nettou Garou 2 (J) [S][h1]"}, {0x78c44066,524288,"Nettou King of Fighters '95 (J) [S][h1]"}, {0x039c27bd,524288,"Nettou King of Fighters '96 (J) [S][h1]"}, {0x63e41242,1048576,"Oak's Dream V0.15 (Pokemon Blue hack) (U) [S][h1]"}, {0x4510d5ed,131072,"Out of Gas (U) [h1]"}, {0xb847ca23,466126,"Pikabomber v0.10 (Bomberman GB Hack) [h1]"}, {0x0b17d36b,524288,"Pikabomber v1.10 (Pocket Bomberman Hack) [h1]"}, {0xdf2fd2ba,1048576,"Pokemon - Aqua v2.4 (Pokemon Red Hack) [h1]"}, {0x5bc7bf93,1048576,"Pokemon - Revolution v2.0 (Pokemon Red Hack) [h1]"}, {0x1d7c0fd6,1048576,"Pokemon Blue (UA) [S][h1] (Sonic the Hedgehog)"}, {0x29cd1812,1048576,"Pokemon Blue Upgrade V2.0 (Blue hack) (U) [S][h1]"}, {0x01f04aaa,1048576,"Pokemon Meowth (Blue Hack) [h1]"}, {0x64b3d034,1048576,"Pokemon Meowth (Red Hack) [h1]"}, {0x934cbf91,1048610,"Pokemon Neo - Adventure v2.8 (Pokemon Red Hack) [h1]"}, {0xf7ac3553,1048576,"Pokemon Neo - Rocket v2.1 (Pokemon Blue Hack) [h1]"}, {0xb2309279,1048576,"Pokemon Red Upgrade V2.0 (Red hack) (U) [S][h1]"}, {0xabb17913,2097152,"Pokemon Red-Blue 2-in-1 (Unl) [S][h1]"}, {0x45b3a0d2,2097152,"Pokemon Red-Blue 2-in-1 (Unl) [S][h1][a1]"}, {0xb22d7ac4,1048576,"Pokemon Trep Edition V0.01 (Blue hack) (U) [S][h1]"}, {0x69715097,1048576,"Pokemon Z V3.0 (Red hack) (U) [S][h1]"}, {0x74de3a9d,65536,"Q-bert II (UEA) [h1]"}, {0xa0a04c07,65536,"Qix (JU) [h1] (Hi-score patch)"}, {0x7e8c53eb,262144,"Ranma Nibun no Ichi - Kakugeki!! (J) [h1]"}, {0x88edc83d,131072,"Road Rash (U) [h1]"}, {0xb1f7970a,131072,"Road Rash (U) [h2]"}, {0x4f09238a,131072,"Road Rash (U) [h3]"}, {0x7c4e55cc,524288,"Rockman World 4 (J) [h1]"}, {0x59b7091e,131072,"R-Type 2 (U) [h1]"}, {0x65b1a2c1,131072,"Sagaia (J) [h1]"}, {0xe05843d3,131072,"Saiyuuki (J) [h1]"}, {0xd4d0870c,131072,"Satoru Nakajima - F-1 Hero '91 (J) [h1]"}, {0x7b54c00e,131072,"Simpsons, The - Bart vs the Juggernauts (U) [h1]"}, {0x01fbc9f6,131072,"Simpsons, The - Krusty's Funhouse (J) [h1]"}, {0x0fd0896c,131072,"Smurfs, The (V1.0) (E) [h1]"}, {0xc837c92a,131072,"Smurfs, The (V1.0) (E) [h2]"}, {0xc38b2391,131072,"Smurfs, The (V1.0) (E) [h3]"}, {0xe8dc982b,131072,"Snow Bros Jr. (J) [h1]"}, {0x9eb673e6,65536,"Solar Striker (JU) [h1]"}, {0x9bb6aa01,65536,"Spanky's Quest (U) (Natsume) [h1]"}, {0xb963e379,65536,"Spanky's Quest (U) (Natsume) [h2]"}, {0xa371df71,131072,"Speed Ball 2 - Brutal Deluxe (U) [h1]"}, {0xa91369f7,262144,"Speedy Gonzales (U) [h1]"}, {0xa1c6841e,262144,"Speedy Gonzales (U) [h2]"}, {0x815c408f,524288,"Star Wars - Super Return of the Jedi (U) [S][h1]"}, {0x74c4d70a,262144,"Super Chinese Land 3 Dash (J) [S][h1]"}, {0xca6367be,131072,"Super Mario 4 (Unl) [h1]"}, {0xf025bc56,131072,"Super Mario 4 (Unl) [h2]"}, {0xf5962ac6,131072,"Super Mario 4 (Unl) [h3]"}, {0xd4a9b338,1048576,"Super Mario Bros. DX (Mono Hack) (V1.0) (U) [h1]"}, {0x2eee5e26,65536,"Super Mario Land (V1.1) (JUA) [h1]"}, {0x493a869e,65536,"Super Mario Land (V1.1) (JUA) [h2]"}, {0xf71f26d0,524288,"Super Mario Land 2 - 6 Golden Coins (V1.0) (UE) [h1]"}, {0x074a875f,524288,"Super Mario Land 3 - Wario Land (JUE) [h1]"}, {0x07072e53,65536,"Super Pika Land (Super Mario hack V0.5 by PR) [h1]"}, {0x94315c53,65536,"Super Pika Land (Super Mario hack V1.0 by PR) [h1]"}, {0x1d8b4edf,65536,"Super Pika Land (Super Mario hack V1.5 by PR) [h1]"}, {0x800c8f35,65536,"Super Pika Land (Super Mario hack V2.0 by PR) [h1]"}, {0x8cc49088,131072,"Super Pika Land (Super Mario hack Vx.x by PR) [a1][h1]"}, {0x9ef4afdd,65536,"Super Pika Land (Super Mario hack Vx.x by PR) [h1]"}, {0xed8a73fb,131072,"Teenage Mutant Ninja Turtles - Fall of the Foot Clan (U) [h1]"}, {0x864cb0a0,131072,"Teenage Mutant Ninja Turtles 3 - Radical Rescue (J) [h1]"}, {0xdf32e098,131072,"Tom & Jerry Part 2 (J) [h1]"}, {0x87d5c1c3,131072,"Total Carnage (U) [h1]"}, {0xb9b05901,262144,"V-Rally - Championship Edition (E) (M3) [h1]"}, {0xd77bd2e2,131072,"World Beach Volleyball 1991 GB Cup (J) [h1]"}, {0x6224f18c,262144,"World Cup USA '94 (UE) [h1]"}, {0xfde13d25,1048576,"Gameboy Camera (UAE) [S][h1]"}, {0x8a8ca2b9,65536,"Boy and His Blob, A - Rescue of Princess Blobette (U)(Abs)[h1]"}, {0xd46965d6,1048576,"Pokemon Red (U) [S][h1]"}, {0xcb11e76d,65536,"Super Pikaland by PR_Trans (Mario hack) [h1]"}, {0x0374eaaf,131072,"Batman - Return of the Joker (J) [h1]"}, {0xd685098d,32769,"Alleyway (JUA) [o1]"}, {0x2d687a16,262144,"Amazing Spider-Man 3, The - Invasion of the Spider-Slayers (U) [o1]"}, {0xfc2556a0,262144,"Aretha (J) [o1]"}, {0x4f8f1d7d,262144,"Aretha (J) [o2]"}, {0x276a6b92,131072,"Battleship (U) (GB) [o1]"}, {0x0ce26be8,66048,"Battleship (U) (GB) [o2]"}, {0x48db80b2,270336,"Best of the Best - Championship Karate (U) [o1]"}, {0xe38ea075,270336,"Best of the Best - Championship Karate (U) [o2]"}, {0x198b409e,131073,"Blades of Steel (U) (GB) [o1]"}, {0xa09e5089,32769,"Bomb Jack (U) [o1]"}, {0x96e4cc7a,655360,"Bomberman GB (J) [S][o1]"}, {0x838c719f,262146,"Bomberman GB (J) [S][o2]"}, {0xc7162745,262144,"Bubble Bobble Part 2 (U) [o1]"}, {0x1fef71e0,131073,"Bubble Bobble Part 2 (U) [o2]"}, {0xc06cf1ed,139264,"Castlevania 2 - Belmont's Revenge (U) [o1]"}, {0x4621b29b,262144,"Cave Noire (J) [o1]"}, {0x65d50364,262144,"Cave Noire (J) [o2]"}, {0x2d24a214,262144,"Cave Noire (J) [o3]"}, {0xf999d21e,262144,"Chiki Race (J) [o1]"}, {0x5c9bb1de,262144,"Chiki Race (J) [o2]"}, {0x51ca510c,131073,"Choplifter 3 (UE) [o1]"}, {0x1a1b6a0d,262144,"Choplifter 3 (UE) [o2]"}, {0x69953653,262144,"Daisenryaku Hiro (J) [o1]"}, {0x6135f956,262144,"Daisenryaku Hiro (J) [o2]"}, {0xe2ab56b5,262656,"Desert Strike - Return to the Gulf (E) (Ocean) [S][o1]"}, {0xd8644d8d,262144,"Dragon Slayer 2 (Dorasure Gaiden) (J) [o1]"}, {0xd392ffc8,262144,"Dragon Slayer 2 (Dorasure Gaiden) (J) [o1][h1]"}, {0xad1f068f,262144,"Dragon Slayer 2 (Dorasure Gaiden) (J) [o2]"}, {0x34160c9f,65538,"Elevator Action (U) [o1]"}, {0x3419731d,262144,"F-1 Race (V1.1) (JUE) [o1]"}, {0x55de2dd1,139264,"Faceball 2000 (U) [o1]"}, {0x5d423271,262144,"Fastest Lap (JU) [o1]"}, {0x0bb4fcfe,262144,"Fire Fighter (U) [o1]"}, {0x6dd6bb45,139264,"Fire Fighter (U) [o2]"}, {0xd4a7cd0d,32768,"Game Genie V1.17x (Unl) [o1]"}, {0xa8c022bc,270336,"Gauntlet 2 (U) [o1]"}, {0x943db6ca,262144,"Golf (JUA) [o1]"}, {0x0c6e3574,262144,"Golf (JUA) [o2]"}, {0xfb7bcb59,262144,"Golf (JUA) [o3]"}, {0xb63f7f49,524288,"Golf Classic (U) [S][o1]"}, {0x061d751c,270336,"Gradius - The Interstellar Assault (U) [o1]"}, {0x843bbef1,270336,"Humans, The (U) [o1]"}, {0x05193c99,270336,"Humans, The (U) [o2]"}, {0xc4d84b2e,139264,"Incredible Crash Dummies, The (U) [o1]"}, {0x68bea5b3,262144,"Incredible Crash Dummies, The (U) [o2]"}, {0x0bc05c1e,236352,"Jurassic Park (U) [o1]"}, {0x774fc218,262144,"Kid Icarus - Of Myths and Monsters (UE) [o1]"}, {0x9529e3a5,262144,"Legend (J) [o1]"}, {0x98e92fc6,262144,"Legend (J) [o2]"}, {0x69c1825e,262144,"Little Master (J) [o1]"}, {0x110295d0,66048,"Mario & Yoshi (E) [o1]"}, {0x11a64fbe,65538,"Mario & Yoshi (E) [o2]"}, {0xcbe980a5,262146,"Mega Man 2 (E) [o1]"}, {0x85a1c904,262144,"Mercenary Force (UE) [o1]"}, {0xa67bb0d8,524288,"Micro Machines (U) [o1]"}, {0xf0e16369,524288,"Micro Machines (U) [o3]"}, {0xee3d0ac9,139264,"Milon's Secret Castle (U) [o1]"}, {0xf112b855,139264,"Milon's Secret Castle (U) [o2]"}, {0x14eb03c7,262144,"Nekojara (J) [o1]"}, {0x6894cb7e,262144,"Nekojara (J) [o2]"}, {0xb13fd260,262144,"Ninja Taro (U) [o1]"}, {0x60d36049,139264,"Ninja Taro (U) [o2]"}, {0x84102a6d,73728,"Paperboy (U) [o1]"}, {0x6ddfa19c,262144,"Pocket Mahjang (J) [o1]"}, {0x26e8182d,139264,"Popeye 2 (U) [o1]"}, {0xf46a5d02,262144,"Puro Stadium '91 (Pro Yakyu Stadium '91) (J) [o1]"}, {0xd63eeeeb,262144,"Sa-Ga (Final Fantasy Legend) (V1.1) (J) [o1]"}, {0x080f1643,262144,"Sa-Ga (Final Fantasy Legend) (V1.1) (J) [o2]"}, {0xb4cf385a,262144,"SD Gundam Gaiden - Lacroan Heroes (J) [o1]"}, {0x423239b2,262144,"Sengoku Ninjakun - Ninja Taro (J) [o1]"}, {0xd6b0002e,139264,"Smurfs, The (V1.1) (UE) [S][o1]"}, {0xbfa0e0a3,32769,"South Pong (PD) [o1]"}, {0x23a22b48,139264,"Star Wars - The Empire Strikes Back (U) (Capcom) [o1]"}, {0x7ae3ef0c,524288,"Super Bombliss (J) [S][o1]"}, {0x069c777a,524288,"Super Bombliss (J) [S][o2]"}, {0x36a6fe3f,177588,"Super Mario 4 (Unl) [h1][o1]"}, {0x824e7873,262144,"Super Robot War (J) [o1]"}, {0x201e7477,262144,"Super Robot War (J) [o2]"}, {0x55aeb65b,262144,"Sword of Hope, The (U) [o1]"}, {0x6dac1ca3,131073,"Sword of Hope, The (U) [o2]"}, {0x182d42ff,33280,"Tennis (JUA) [o1]"}, {0xf0ce6707,208856,"Tom & Jerry (U) [o1]"}, {0xee7f641b,262144,"Torpedo Range (J) [o1]"}, {0xda521d4c,262144,"Torpedo Range (J) [o2]"}, {0xb742dc3c,262144,"Velious II (J) [o1]"}, {0x461b9277,524288,"XVII Olympic Winter Games, The - Lillehammer 1994 (U) [o1]"}, {0xe3d9365d,524288,"Flappy Special (J) [o1]"}, {0x2975eb4b,450000,"Micro Machines (U) [o2]"}, {0x0746b172,32768,"Adventure V0.1 (PD)"}, {0x2a5f8775,32768,"Adventure V0.2 (PD)"}, {0x715afdc0,32768,"Adventure V0.3 (PD)"}, {0x1e755cf5,32768,"American Jesus (PD)"}, {0x71736fa9,32768,"Ant Hill (Bung) (PD) [a1]"}, {0xc220f791,32768,"Ant Hill (Bung) (PD)"}, {0xff24ed7d,131072,"Ant Soldiers (Demo) (PD)"}, {0x5056e805,32768,"Apocalypse Now Demo (PD) [a1]"}, {0xb4a584af,32768,"Apocalypse Now Demo (PD)"}, {0xca88b489,32768,"Apple Demo (PD)"}, {0x1b319ad3,2097152,"Armageddon Video Trailer (GBTK Video) (1) (PD)"}, {0x87894863,2097152,"Armageddon Video Trailer (GBTK Video) (2) (PD)"}, {0x1ad8528f,32768,"ASCII Wars (V1.1) (PD)"}, {0x7aba98d2,32768,"Ash Demo (PD)"}, {0xa963db6e,524288,"Asukatti Slide Show (PD)"}, {0xbb2acf13,32768,"Atari 2600 Boxing (PD)"}, {0x9de36835,32768,"Balloon Man (PD)"}, {0x4c9b5d3b,32768,"BBS Demo (Quang2000) (PD)"}, {0xa729d9fc,32768,"Big Scroller Demo (PD)"}, {0xcf8e38a5,32768,"Blastroids (PD)"}, {0x9e9165c2,32768,"Bounce (Quang2000) (PD)"}, {0x6f62f388,32768,"Bounce by Jarvik7 (Bung) (PD)"}, {0x08ee11bd,65536,"Boxes (Bung) (PD)"}, {0xdfacb455,65536,"Boxes (PD)"}, {0xdbface65,32768,"Bung Cart Slideshow (PD)"}, {0x5b9d40ee,32768,"Bung Trivia 1 (PD)"}, {0x86b13d7c,32768,"Bung Trivia 2 (PD)"}, {0xb61d7e20,32768,"Car (Bung) (PD)"}, {0x6d6510e6,32768,"Card Shuffle (PD)"}, {0x3a3fe1d0,32768,"Chapter 4 Link Test (PD)"}, {0x64d048e0,131072,"Chip the Chick (PD)"}, {0x138d44ea,32768,"Clock (PD)"}, {0xe5671fb4,32768,"Clown Demo (1) (PD)"}, {0xea3e2a6c,32768,"Clown Demo (2) (PD)"}, {0x71e40027,32768,"Clown Demo (PD)"}, {0x70b2a4ff,32768,"Collision Detection 1.0 (PD)"}, {0xde190a81,32768,"Collision Detection 1.20 (PD)"}, {0x4acb4cd3,32768,"Collision Detection 1.40 (PD)"}, {0x445e9196,32768,"Collision Detection 1.50 (PD)"}, {0x55a37ad1,32768,"Collision Detection 1.60 (PD)"}, {0xc8e01222,32768,"Collision Detection 1.61 (PD)"}, {0x0411c465,32768,"Color Collapse (PD)"}, {0x02bca193,32768,"Commando (PD)"}, {0xcbe00b80,32768,"Commando Death (PD)"}, {0x9fbd92c5,32768,"Crash (PD)"}, {0xfa86dff6,32768,"Cricket (PD)"}, {0x3f47ed05,32768,"Dan Laser Demo (PD)"}, {0x7656ed0c,131072,"Dawn Demo (PD)"}, {0xc8acc076,32768,"Dirty Pair Flash Picture (PD)"}, {0x6473ac4b,32768,"Distortion Demo by Anders Granlund (PD)"}, {0x90cc4679,32768,"Dog Demo (PD)"}, {0xbb6e47ec,32768,"Doodlebug (PD)"}, {0xc7d76f59,32768,"Downhill Ski (PD)"}, {0xf15065f7,32768,"DragonEagle's GBDK Printer Library (PD)"}, {0xcc8686e0,32768,"Dungeon Escape (1) (PD)"}, {0x857f4396,32768,"Dungeon Escape (3) (PD)"}, {0xef967254,131072,"Effigy (Bung V4) (PD)"}, {0x1828f608,32768,"Emulators Unlimited Demo (PD)"}, {0x6d84a0b9,32768,"EVA Pong (PD)"}, {0xe08ba6fd,32768,"F-1 Racing 2000 Demo (PD)"}, {0x133680a6,32768,"Flare Squip (PD) [a1]"}, {0x7a086503,32768,"Flare Squip (PD)"}, {0x31ca2f78,32768,"Fogel V0.45 (PD)"}, {0xcfedc76d,32768,"Gabe Edit V0.1 (PD)"}, {0x3c3de96b,32768,"Galaga Demo (PD)"}, {0xba8970cd,32768,"Gameboy Printer Emulator V1.0 by Jeff Frohwein (PD)"}, {0x10871d19,32768,"Gameboy Stop Watch (PD)"}, {0x2dd6d4bc,32768,"GameDepot.com Credits Scroll (PD)"}, {0x7377a635,32768,"GAY (Tennis) (PD)"}, {0x41e35edc,32768,"GB ALS V1.0f (PD)"}, {0x1bee795f,32768,"GB Basic V1.06 (PD)"}, {0xd33905a6,32768,"GB Basic V1.21 (PD)"}, {0x508b4f38,16384,"GB Basic V1.22 (PD) [a1]"}, {0xd48af9b4,32768,"GB Basic V1.22 (PD)"}, {0x35c3994d,32768,"GB Cart Mag-E-Zine Vol 1 Issue 1 October 2nd, 2000 (PD)"}, {0xb21d7bcd,65536,"GB Clock V1.0 (PD)"}, {0xb2a9cf4d,65536,"GB Clock V1.1 (PD)"}, {0xe983e4ca,65536,"GB Clock V1.2 (PD)"}, {0xde9436dd,32768,"GB Debug V1.3 (PD) [a1]"}, {0x0c0e7300,16384,"GB Debug V1.3 (PD)"}, {0xaf829534,32768,"GB Demo V1.1 (PD)"}, {0x3ed9534e,32768,"GB Demo V1.2 (PD)"}, {0x7f646c3e,32768,"GB DTMF Generator (PD)"}, {0x84f49fbe,32768,"GB Lander (PD)"}, {0xc436f50b,32768,"GB Pack V1.3 (PD) (GB)"}, {0xd0616672,32768,"GB Pack Vx.x (16Mbit) (PD) [a1]"}, {0xa0c8e9ad,32768,"GB Pack Vx.x (16Mbit) (PD) [a2]"}, {0x1bddf36f,32768,"GB Pack Vx.x (16Mbit) (PD)"}, {0x3de7419e,32768,"GB Pack Vx.x (4Mbit) (PD)"}, {0x7f9d0dc0,32768,"GB Printer Test Demo (PD)"}, {0xd26f958d,65536,"GB Pyritz Inc (PD)"}, {0x425640a9,32768,"GB Quiz for Kids (PD)"}, {0x7c1ef796,32768,"GB Sound Xperimenter V1.0 (PD)"}, {0xa1ec117d,32768,"GB Sound Xperimenter V1.3 (PD)"}, {0xb3acde3f,32768,"GB Tic-Tac-Toe (PD) [a1]"}, {0x775ae755,32768,"GB Tic-Tac-Toe (PD)"}, {0xe1f453fc,32768,"GBS Player V1.00 - Adventures of Lolo (PD)"}, {0x1ac49058,32768,"GBS Player V1.00 - Alien 3 (PD)"}, {0xee114794,32768,"GBS Player V1.00 - Altered Space (PD)"}, {0x28b254d7,32768,"GBS Player V1.00 - Balloon Kid (PD)"}, {0x568c1d0b,32768,"GBS Player V1.00 - Batman - Return of The Joker (PD)"}, {0x2a188c53,32768,"GBS Player V1.00 - Batman - The Animated Series (PD)"}, {0x4b2eb184,32768,"GBS Player V1.00 - Batman (PD)"}, {0x4dfe1262,32768,"GBS Player V1.00 - Battletoads (PD)"}, {0xd72db89f,32768,"GBS Player V1.00 - Bionic Command (PD)"}, {0x443e20b1,32768,"GBS Player V1.00 - Bonk's Adventure (PD)"}, {0x49b949c6,32768,"GBS Player V1.00 - Bubble Ghost (PD)"}, {0x97318580,32768,"GBS Player V1.00 - Castlevania 2 - Belmont's Revenge (PD)"}, {0x19a9f3f1,32768,"GBS Player V1.00 - Castlevania Adventure (PD)"}, {0xb45d7910,65536,"GBS Player V1.00 - Castlevania Legends (PD)"}, {0x40125bf4,32768,"GBS Player V1.00 - Dennis The Menace (PD)"}, {0x0f3edc56,32768,"GBS Player V1.00 - Donkey Kong Land (PD)"}, {0xdcdf9a09,32768,"GBS Player V1.00 - Dr. Franken (PD) [a1]"}, {0x19692466,32768,"GBS Player V1.00 - Dr. Franken (PD)"}, {0x721346f2,32768,"GBS Player V1.00 - Dr. Franken II (PD) [a1]"}, {0xb4cd041a,32768,"GBS Player V1.00 - Dr. Franken II (PD)"}, {0x707f5973,32768,"GBS Player V1.00 - Dr. Mario (PD)"}, {0x352714f7,32768,"GBS Player V1.00 - Fidgetts, The (PD)"}, {0xa241b00e,32768,"GBS Player V1.00 - Final Fantasy (PD)"}, {0xf93059f2,32768,"GBS Player V1.00 - Final Fantasy 2 (PD)"}, {0xeb4b5b10,32768,"GBS Player V1.00 - Final Fantasy 3 (PD)"}, {0x1d343e33,32768,"GBS Player V1.00 - Final Fantasy Adventure (PD)"}, {0x55d7eb86,32768,"GBS Player V1.00 - Gargoyle's Quest (PD)"}, {0x27b630cb,65536,"GBS Player V1.00 - Gradius - The Interstellar Assault (PD)"}, {0x8bf02d06,32768,"GBS Player V1.00 - Kaeru no Tameni (PD)"}, {0x1a24a27b,65536,"GBS Player V1.00 - Kid Dracula (PD)"}, {0xb98550ef,32768,"GBS Player V1.00 - Kirby's Dreamland (PD)"}, {0x4605d442,65536,"GBS Player V1.00 - Kirby's Dreamland 2 (PD)"}, {0x3c594503,65536,"GBS Player V1.00 - Legend of Zelda - Link's Awakening (PD)"}, {0xc80145a4,32768,"GBS Player V1.00 - Metroid 2 - Return of Samus (PD)"}, {0xaa791e97,32768,"GBS Player V1.00 - Monster Max (PD)"}, {0x0fc30b87,65536,"GBS Player V1.00 - Motocross Maniacs 2 (PD)"}, {0x1514dd1d,32768,"GBS Player V1.00 - Nemesis (PD)"}, {0x86be503f,32768,"GBS Player V1.00 - Ninja Gaiden Shadow (PD)"}, {0x092ed3ec,32768,"GBS Player V1.00 - Operation C (PD)"}, {0x6cf46b9c,32768,"GBS Player V1.00 - Parasol Stars (PD)"}, {0xc4807d72,65536,"GBS Player V1.00 - Parodius (PD)"}, {0x3a19fefc,65536,"GBS Player V1.00 - Pokemon Blue (PD)"}, {0xd2987103,65536,"GBS Player V1.00 - Pokemon Trading Card Game (PD)"}, {0x3b127895,32768,"GBS Player V1.00 - Quarth (PD)"}, {0x59e256c6,32768,"GBS Player V1.00 - Radar Mission (PD)"}, {0xc2fc53ab,32768,"GBS Player V1.00 - Ranma Nibun no Ichi - Part 2 (PD)"}, {0x03206056,32768,"GBS Player V1.00 - R-Type (PD)"}, {0x31818897,32768,"GBS Player V1.00 - R-Type 2 (PD)"}, {0x22dbbfdb,32768,"GBS Player V1.00 - Snow Bros. Jr. (PD)"}, {0x2d002645,32768,"GBS Player V1.00 - Solar Striker (PD)"}, {0xf948a84d,32768,"GBS Player V1.00 - Super Mario Land (PD)"}, {0x2e4d19d4,32768,"GBS Player V1.00 - Super Mario Land 2 - 6 Golden Coins (PD) [a1]"}, {0xcea3d9fd,32768,"GBS Player V1.00 - Super Mario Land 2 - 6 Golden Coins (PD)"}, {0x7ed39068,32768,"GBS Player V1.00 - Super Mario Land 3 - Wario Land (PD)"}, {0xe6cf0e7f,32768,"GBS Player V1.00 - Super Mario Land 3 - Warioland (PD)"}, {0x19cd2ef8,32768,"GBS Player V1.00 - Super RC Pro-Am (PD)"}, {0x39841437,32768,"GBS Player V1.00 - Tetris (PD)"}, {0xb59a3049,32768,"GBS Player V1.00 - Tiny Toon Adventures (PD)"}, {0xcf30bb33,32768,"GBS Player V1.00 - Tiny Toon Adventures 2 (PD)"}, {0x7ac713f2,32768,"GBS Player V1.00 - Twin-Bee (PD)"}, {0x8800a503,131072,"GBS Player V1.00 - Warioland 2 (PD)"}, {0x83407e85,32768,"GBS Player V1.00 - WWF Superstars (PD)"}, {0x68f15b7a,32768,"GBS Player V1.01 - Aladdin (PD)"}, {0xa6efcfa1,32768,"GBS Player V1.01 - Daffy Duck - The Marvin Missions (PD)"}, {0xcde39b9e,131072,"GBS Player V1.01 - Drymouth (PD)"}, {0xca417f3c,32768,"GBS Player V1.01 - Duck Tales (PD)"}, {0x05fed0aa,32768,"GBS Player V1.01 - Duck Tales 2 (PD)"}, {0x9dc02fae,65536,"GBS Player V1.01 - Furai no Siren (PD)"}, {0x253a9387,32768,"GBS Player V1.01 - Gremlins 2 - The New Batch (PD)"}, {0xbf1fb001,65536,"GBS Player V1.01 - Mega Man (PD)"}, {0x855a77e0,32768,"GBS Player V1.01 - Mega Man 2 (PD)"}, {0xd1d6ab1a,32768,"GBS Player V1.01 - Mega Man 3 (PD)"}, {0x231ff200,65536,"GBS Player V1.01 - Mega Man 4 (PD)"}, {0x01281896,65536,"GBS Player V1.01 - Mega Man 5 (PD)"}, {0x552ddee3,32768,"GBS Player V1.01 - Metroid 2 - Return of Samus (PD)"}, {0x69266f5c,32768,"GBS Player V1.01 - Popeye 2 (PD)"}, {0x9ed2f9b3,32768,"GBS Player V1.01 - Rolan's Curse (PD)"}, {0xa9c0e857,32768,"GBS Player V1.01 - Rolan's Curse 2 (PD)"}, {0x5f76c261,32768,"GBS Player V1.01 - Super Hunchback (PD)"}, {0xa1a09f12,32768,"GBS Player V1.01 - Tail Gator (PD)"}, {0x2cb6c048,32768,"GBS Player V1.01 - Trax (PD)"}, {0xa1e8bc99,65536,"GBS Player V1.01 - Trip World (PD)"}, {0x393b5915,32768,"Gen13 (X-rated) (PD)"}, {0xbdbea9fa,32768,"Ghostbusters Logo Demo (PD)"}, {0x4d71e074,32768,"GHunter (V0.5) (PD)"}, {0x7dc62e02,32768,"Goth Chick (PD)"}, {0x2979a8e9,32768,"Greeting Card Demo 3 (PD)"}, {0x62c06245,32768,"Greeting Card Demo 4 (PD)"}, {0x8c64ac58,32768,"Greeting Card Demo 6 (PD)"}, {0x397c4adc,32768,"Guess The Number 1 (PD)"}, {0xf4aded70,32768,"Guess The Number 2 (PD)"}, {0xa154cfce,262144,"Hangman (PD)"}, {0x6b9e11d9,32768,"Happy Birthday HOME Demo (PD)"}, {0x58ab027f,32768,"Hello World Demo (PD)"}, {0x938ea371,32768,"Hello World With Input Demo (PD)"}, {0xf05f2af2,32768,"Hentai Animation (PD)"}, {0x7fea2f69,32768,"Hero Zero GFX-CON (PD)"}, {0x013129c6,32768,"Hero Zero Sample - Disasm (PD)"}, {0x91a1ba0b,32768,"Hero Zero Sample - Lines 1 (PD)"}, {0x8ecc271d,32768,"Hero Zero Sample - Lines 2 (PD)"}, {0x8a408e63,32768,"Hero Zero Sample - Lines 3 (PD)"}, {0x7e4e5685,32768,"Horrible Demon, The (Bung) (PD) [a1]"}, {0xa99c57f9,32768,"Horrible Demon, The (Bung) (PD)"}, {0x23fee115,32768,"Horrible Demon, The (PD)"}, {0x9ac04932,32768,"Horrid Demon, The (Bung) (PD)"}, {0xb0417673,262144,"Hybrid GBPlot (PD)"}, {0x41def6a7,32768,"IDSA Invaders (PD)"}, {0x78efe9eb,262144,"Infocom - BALLYHOO (1) (PD)"}, {0x21ebc3c3,262144,"Infocom - BALLYHOO (2) (PD)"}, {0x5dec1a30,131072,"Infocom - BALLYHOO (3) (PD)"}, {0xe025ecf6,262144,"Infocom - BALLYHOO (4) (PD)"}, {0xb9b8407d,262144,"Infocom - BALLYHOO (5) (PD)"}, {0xafdbc8dd,131072,"Infocom - Cutthroats (1) (PD)"}, {0xaba10888,131072,"Infocom - Cutthroats (2) (PD)"}, {0xbd37a36d,131072,"Infocom - Cutthroats (3) (PD)"}, {0x62aff22f,131072,"Infocom - Deadline (1) (PD)"}, {0xaa4906f5,131072,"Infocom - Deadline (2) (PD)"}, {0x5f15805b,131072,"Infocom - Deadline (3) (PD)"}, {0x060bc616,131072,"Infocom - Enchanter (1) (PD)"}, {0xd655910c,131072,"Infocom - Enchanter (2) (PD)"}, {0x42c5e24c,131072,"Infocom - Enchanter (3) (PD)"}, {0xb521397e,131072,"Infocom - Hitchiker's Guide to the Galaxy, The (1) (PD)"}, {0xf368dc8c,131072,"Infocom - Hitchiker's Guide to the Galaxy, The (2) (PD)"}, {0x59dd81e3,131072,"Infocom - Hitchiker's Guide to the Galaxy, The (3) (PD)"}, {0x86b1eac0,131072,"Infocom - Hollywood Hijinx (1) (PD)"}, {0x784c93d8,131072,"Infocom - Hollywood Hijinx (2) (PD)"}, {0x5d5f3cd1,131072,"Infocom - Hollywood Hijinx (3) (PD)"}, {0x30b5b8fc,131072,"Infocom - Infidel (1) (PD)"}, {0x36506a59,131072,"Infocom - Infidel (2) (PD)"}, {0x999d0af6,262144,"Infocom - Leather Goddesses of Phobos, The (1) (PD)"}, {0x0bb32620,131072,"Infocom - Leather Goddesses of Phobos, The (2) (PD)"}, {0xe8efa0c0,262144,"Infocom - Leather Goddesses of Phobos, The (3) (PD)"}, {0x7116a89b,262144,"Infocom - Leather Goddesses of Phobos, The (4) (PD)"}, {0x8360eb16,262144,"Infocom - Lurking Horror, The (1) (PD)"}, {0x2a7c5014,262144,"Infocom - Lurking Horror, The (2) (PD)"}, {0xa14dc4c8,131072,"Infocom - Lurking Horror, The (3) (PD)"}, {0xf6c728d9,262144,"Infocom - Lurking Horror, The (4) (PD)"}, {0xc9de9552,262144,"Infocom - Moonmist (1) (PD)"}, {0x98f0339f,131072,"Infocom - Moonmist (2) (PD)"}, {0xb191a4b4,262144,"Infocom - Moonmist (3) (PD)"}, {0xeaf51f01,131072,"Infocom - Planetfall (1) (PD)"}, {0x9f7fab35,131072,"Infocom - Planetfall (2) (PD)"}, {0x6c1b9a6b,131072,"Infocom - Sorcerer (Enchanter 2) (1) (PD)"}, {0xeda18737,131072,"Infocom - Sorcerer (Enchanter 2) (2) (PD)"}, {0x453ac640,262144,"Infocom - Spellbreaker (Enchanter 3) (1) (PD)"}, {0x4996ae1b,131072,"Infocom - Spellbreaker (Enchanter 3) (2) (PD)"}, {0x9257429c,262144,"Infocom - Spellbreaker (Enchanter 3) (3) (PD)"}, {0xe7f08153,262144,"Infocom - Spellbreaker (Enchanter 3) (4) (PD)"}, {0x27295a87,131072,"Infocom - Starcross (1) (PD)"}, {0xe6e51e7c,131072,"Infocom - Starcross (2) (PD)"}, {0xe0eae993,131072,"Infocom - Suspect (1) (PD)"}, {0x310b0c77,131072,"Infocom - Suspect (2) (PD)"}, {0x529be597,131072,"Infocom - Suspended (1) (PD)"}, {0x4a62fe1f,131072,"Infocom - Suspended (2) (PD)"}, {0x4c53c4a3,262144,"Infocom - Wishbringer (1) (PD)"}, {0x413dcbd0,131072,"Infocom - Wishbringer (2) (PD)"}, {0x5e5513f1,262144,"Infocom - Wishbringer (3) (PD)"}, {0xaf71504e,131072,"Infocom - Witness, The (1) (PD)"}, {0x271a029b,131072,"Infocom - Witness, The (2) (PD)"}, {0x3527b539,131072,"Infocom - Zork I - The Great Underground Empire (1) (PD)"}, {0x335dd738,131072,"Infocom - Zork I - The Great Underground Empire (2) (PD)"}, {0xcd8df291,131072,"Infocom - Zork I - The Great Underground Empire (3) (PD)"}, {0x1450e174,131072,"Infocom - Zork II - The Wizard of Frobozz (1) (PD)"}, {0x70487d4d,131072,"Infocom - Zork II - The Wizard of Frobozz (2) (PD)"}, {0xbf3dd952,131072,"Infocom - Zork III - The Dungeon Master (1) (PD)"}, {0x020dfe8e,131072,"Infocom - Zork III - The Dungeon Master (2) (PD)"}, {0xefdcafcf,32768,"Interrupts Demo (PD)"}, {0xe8b433a8,32768,"James Bond Demo (PD)"}, {0x3e50a080,32768,"JetPac V0.01 (Different Controls) (PD)"}, {0xb1d1f4e2,32768,"JetPac V0.01 (PD)"}, {0xbcc96acf,32768,"JetPac V0.02 (PD)"}, {0x6567ef98,32768,"JetPac V0.03 (PD) [a1]"}, {0xb7538bd6,32768,"JetPac V0.03 (PD)"}, {0xcef0fb8d,32768,"JetPac V0.04 (PD)"}, {0x0bd33517,32768,"Joy of Interrupts (PD)"}, {0x58c6c9dd,32768,"Joy Rider Demo (PD)"}, {0xc2f4be4e,32768,"Joypad Test V0.1 (PD)"}, {0x0c3e84e3,32768,"Jumping Jack (PD)"}, {0x05cb3f18,32768,"Kasumi Scroller (PD)"}, {0xb77ba5ae,32768,"Ken Kameda's World Demo (PD)"}, {0x47893b7f,32768,"Kirby XXL Demo (PD)"}, {0x723465dd,32768,"Labyrinth (Bung) (PD) [a1]"}, {0x22fd7011,32768,"Labyrinth (Bung) (PD)"}, {0x7535285f,32768,"Ladeks (PD)"}, {0x09062445,32768,"Lamborghini 2 Demo (PD) [a1]"}, {0x1371dd03,32768,"Landscape Demo (PD)"}, {0x723f54c3,65536,"Lemon Player Demo by Lemon Productions (PD)"}, {0xb47317e4,32768,"Life (PD)"}, {0x7cf546e1,32768,"Life 2 (PD)"}, {0x9bc72a6a,32768,"Lik Sang MP3 Demo (PD)"}, {0xff1c4bcb,32768,"Login Password Demo (PD)"}, {0xf6641be4,32768,"Log-X (Bung V4) (PD)"}, {0x9d333610,32768,"Mango Cat Animation Demo (PD)"}, {0x7bfdc800,32768,"Mango Dxcp Scroller Demo (PD)"}, {0x6ae7cc11,32768,"Mango Dycp Scroller Demo (PD)"}, {0x48273daa,32768,"Mango Flex Demo (PD)"}, {0x171edd12,32768,"Mango Muzak Demo (PD)"}, {0x02a5dd62,32768,"Mango Plot Demo (PD)"}, {0x8722dea4,32768,"Mango Toons Demo (PD)"}, {0x18276e73,32768,"Master Your Multiplication (PD)"}, {0x4692e63d,1048576,"Matrix Video, The (PD)"}, {0x99ab44e4,32768,"Mega Man X PCX2GB Demo (PD)"}, {0xcf053fd7,32768,"Megamania Demo (PD)"}, {0xb49f1926,32768,"Merry Christmas! Demo (PD)"}, {0x651e8084,32768,"Mines (Bung) (PD)"}, {0x5ba0b0fb,32768,"Minesweeper (PD)"}, {0x3adee509,32768,"Missing Files (E-Mag Article) (PD)"}, {0x6127ea3e,524288,"MMX El-Hazard Movie (PD) [a1]"}, {0xf95d3d56,524288,"MMX El-Hazard Movie (PD) [a2]"}, {0xd22060bb,524288,"MMX El-Hazard Movie (PD)"}, {0xafb2a546,32768,"MMX Image Slideshow (PD)"}, {0x5a5bfc79,32768,"MMX MegAnime (PD)"}, {0x4a6a5310,32768,"MMX PCX-to-GB Demo (PD) [a1]"}, {0xb41ebb1d,32768,"MMX PCX-to-GB Demo (PD)"}, {0x1c005183,524288,"MMX T2 Demo (PD)"}, {0x83821eeb,262144,"Motoko no Ken (PD)"}, {0xcc936616,32768,"Multi Puzzle (PD)"}, {0x6407f5cf,32768,"Multi Sprite Demo (PD)"}, {0xd9aace03,65536,"Multikart 2 V1.1 (GB BASIC & Debugger) (PD)"}, {0xbfffc784,65536,"Multikart 2 V1.3 (GB BASIC & Debugger) (PD)"}, {0x6eb34883,32768,"N64 Controller (PD)"}, {0xe27d56e1,65536,"NanoLoop Demo (PD)"}, {0x8c86e3ea,32768,"NanoSynth (PD)"}, {0x302a7f51,32768,"NanoVoice Demo (PD)"}, {0xafc6b6a8,262144,"Neon Genesis Evangelion - Rei Demo 1 (PD)"}, {0x3fda45f3,32768,"Nick's GAME1 (PD)"}, {0x652da1aa,32768,"Night Driving - Atari 2600 (PD)"}, {0xf1270b43,32768,"Nuku7 Demo (7-Shades Pic) (PD)"}, {0xd09c6572,32768,"Obsession's SokoBan (V1.1) (PD)"}, {0x4da8036c,32768,"Obsession's SokoBan (V1.2) (PD)"}, {0x88cc6acd,32768,"Paddle Mission (PD)"}, {0xe0b9921e,32768,"Phreak-boy (PD)"}, {0x00065fb1,32768,"PI Speak Demo (PD)"}, {0xba117b47,32768,"Pika Killa (Quang2000) (PD)"}, {0x23aa539f,32768,"Pikachu Scroller 1 (PD)"}, {0x11ec8963,32768,"Pikachu Scroller 2 (PD)"}, {0x11e538b1,65536,"Planet Console Ad (PD)"}, {0x4342e599,131072,"Plumpy (PD)"}, {0x975f9540,32768,"Poke Mission '97 (Beta) (PD)"}, {0x260d1044,32768,"Poke Mission '97 (Final) (PD)"}, {0xa391ce5f,32768,"Poke Mission '97 (PD)"}, {0x50a457ac,32768,"Poke Mission '97 (V1.01) (PD)"}, {0x4c3e4483,32768,"Pong (PD)"}, {0x3f20126e,524288,"Punk Demo (PD)"}, {0x5ace1276,32768,"Puzz (Bung) (PD)"}, {0x30e7bf4b,32768,"Puzzle (1) (PD)"}, {0x8a4f91c8,32768,"Puzzle (2) (PD)"}, {0xcd40c5b7,32768,"Puzzle (3) (PD)"}, {0x65d08472,32768,"Puzzle X (Bung) (PD)"}, {0xb4ab2de6,32768,"Puzzle X (PD) [a1]"}, {0x18d4f088,32768,"Puzzle X (PD) [a2]"}, {0xe248c528,32768,"Puzzle X (PD)"}, {0x9bf07f7d,32768,"Quick Push (PD)"}, {0xef0c85f1,32768,"Random Number Generator (PD)"}, {0x68429b2f,32768,"Raster Bars Test (PD)"}, {0xe08d0942,32768,"Raven 2 Demo (PD) [a1]"}, {0xd240aa93,32768,"Raven 2 Demo (PD)"}, {0x184f6e90,65536,"Raven 3 (PD)"}, {0x50471e16,32768,"Rei 3D Pyramid Demo (PD)"}, {0xf524e6ce,32768,"Robot War (PD)"}, {0x35938cbe,32768,"Rotation (PD)"}, {0x2bf17c20,32768,"RPN Calculator (PD)"}, {0x97279f9a,32768,"Sailor Moon Demo (PD)"}, {0x5fd5b876,262144,"Sailor Super V Movie (PD)"}, {0xf8ad7dec,262144,"Sakigake Memorial (PD)"}, {0x7a4e8c4f,32768,"Scrolling Demo 2 (PD)"}, {0x929c4538,32768,"Segmond First Demo (PD)"}, {0x2e07baf0,32768,"SGB Pack (PD) (GB) [a1]"}, {0xea41cbca,32768,"SGB Pack (PD) (GB) [a2]"}, {0x88f164a1,32768,"SGB Pack (PD) (GB)"}, {0x13d27881,32768,"Showdown in Neo Tokyo (PD)"}, {0xb3f5dc58,32768,"Shutdown (PD)"}, {0x76bb8bae,32768,"Sierpinski Gasket (PD)"}, {0x1c56c44c,524288,"Simple Dictionary V1.2 (PD)"}, {0xc1831316,32768,"Simple Parallax Scroller (PD)"}, {0x9ebf0dcc,32768,"Slippy (PD)"}, {0x1327c6c5,32768,"Song Pro Demo (PD)"}, {0x73447cb3,32768,"Sound Demo (PD)"}, {0x05d34411,32768,"Sound Test (PD) [a1]"}, {0x4e5a9e26,32768,"Sound Test (PD)"}, {0x9c28fe73,131072,"South Park Xtreme Demo (GB) (PD)"}, {0x7febc515,32768,"South Pong (PD)"}, {0xcd6398dd,32768,"Space Demo (2) (PD)"}, {0x7a4ee4f9,32768,"Space Demo (PD)"}, {0x999abe51,32768,"Space Invaders (PD)"}, {0xa6fc740c,32768,"Speed Finger V0.01 (Bung) (PD)"}, {0x9a45c417,32768,"Speed Finger V0.02 (Bung) (PD)"}, {0xe9ec7087,32768,"Sprite Demo (PD)"}, {0x2a9ad766,32768,"Sprite Demo 2 (PD)"}, {0x6025e612,32768,"Sprite Demo Test (PD)"}, {0x74c02ee6,32768,"Sprite1 Demo (PD)"}, {0x6f2ec87e,32768,"Sprite2 Demo (PD)"}, {0x91a0413d,32768,"Sprite3 Demo (PD)"}, {0x09a2be8f,32768,"Sprite4 Demo (PD)"}, {0x6b8aebcc,32768,"Sprite4a Demo (PD)"}, {0xd9334ddf,32768,"SQRXZ (V1.1) (PD)"}, {0x85a9e0db,32768,"StarFisher (PD)"}, {0x597b1b70,524288,"Super Ayanami D (PD)"}, {0x6fd98165,32768,"Swedish Flag Demo (PD)"}, {0x8c3edf21,32768,"Terminal & Basic Graphics Demo (PD)"}, {0xca9c9710,1048576,"Terminator 2 Video (PD)"}, {0x5efb3370,32768,"Test (V1.1) (PD)"}, {0x17aba5d6,32768,"Test Game Pack (PD)"}, {0xae902c4b,32768,"Test Game Pack (scrolling picture) (PD)"}, {0xada57d37,32768,"Testrand (side-side) (PD)"}, {0x92dc091e,32768,"Testrand (up-down) (PD)"}, {0x3aa0695d,65536,"They Came from Outer Space (PD) [S]"}, {0x32f964d1,524288,"To-Heart Slideshow Green (PD)"}, {0xb2db2832,524288,"To-Heart Slideshow Red (PD)"}, {0x8c7cdd40,32768,"Tunnel (V0.1) (PD)"}, {0x3d7ce579,32768,"Unix (PD)"}, {0xc9dca59c,65536,"Versatility (PD)"}, {0x8df7df40,32768,"VGB Lord Demo (PD)"}, {0xa803ab80,32768,"Vila Caldan V0.1 (PD)"}, {0xa5e43ce5,32768,"Viper (Bung) (PD)"}, {0x561c5fc3,32768,"Wario Walking Demo (PD)"}, {0x0f53d6ac,32768,"WD 3D Demo (PD)"}, {0x7395f49f,32768,"WD Checkercube Demo V0.1 (PD)"}, {0x1ae6b0cd,32768,"WOW Super Gameboy Peep-Show (PD)"}, {0xcb5d02fd,65536,"Yar's Revenge - The Quotile Ultimatum (PD)"}, {0xfc17d1f1,32768,"You Pressed Demo (PD)"}, {0x1ae74cc8,65536,"ZipGB V0.001 ALPHA (PD)"}, {0xd9c315e7,32768,"Zoomar Demo V2 (PD)"}, {0x76d26c54,32768,"Zoomar Demo V3 (2) (PD)"}, {0xf6e79989,32768,"GB Electric Drum (PD)"}, {0xa7752f4c,32768,"BLEM! (PD)"}, {0x1da7f24a,32768,"Books of the Bible (Freedom GB Contest 2001) (PD)"}, {0x7e350676,32768,"Dungeon Escape (2) (PD)"}, {0x3649d08b,65536,"GB Tracker V990220 (PD)"}, {0xfcfa0b8b,32768,"GBS Player V1.00 - The Fidgetts (PD)"}, {0x39d6331c,32768,"Lamborghini 2 Demo (PD)"}, {0xc182f628,32768,"Runtime - Test Rom (PD)"}, {0x38b754ec,32768,"SunTsu7's Monty Python Greeting (PD)"}, {0xa8adab6a,32768,"Zoomar Demo V3 (1) (PD)"}, {0x3cd7aa0d,32768,"Distortion Demo by Anders Granlund (PD) [a1]"}, {0x9f8d4f0b,32768,"Greyscale Moving Globe Demo (PD)"}, {0x5f7c431e,32768,"Obj Put0 Demo (PD)"}, {0x44653ae3,32768,"Sound Output Demo 1 (PD)"}, {0x40974b5c,32768,"Tam Bitmap Demo (PD)"}, {0x329df849,524288,"TSS Grayscale Movie (PD)"}, {0xeb2a6c89,131072,"WanWan (PD)"}, {0xdacfc143,32768,"BG Put0 Demo (PD)"}, {0x77a71690,131072,"Addams Family, The - Pugsley's Scavenger Hunt (U) [t1]"}, {0x846b73a4,131072,"Adventure Island (U) [t1]"}, {0xb99d6e2e,131072,"Adventures of Star Saver, The (U) [t1]"}, {0x9676491e,32768,"Alleyway (JUA) [t1]"}, {0x23fbc95a,131072,"Amazing Spider-Man 3, The - Invasion of the Spider-Slayers (U) [t1]"}, {0xc505c150,131072,"Asteroids & Missile Command (U) [S][t1]"}, {0x542c69c3,524288,"Bubsy 2 (U) [t1]"}, {0x041cdd0c,524288,"Bubsy 2 (U) [t2]"}, {0xa079c953,65536,"Burger Time Deluxe (JU) [t1]"}, {0xc2a1dbe3,131072,"Bust-a-Move 2 (U) [t1]"}, {0x9c27e92c,131072,"Bust-a-Move 2 (U) [t2]"}, {0x92959f40,131072,"Defender-Joust (U) [S][t1] (Joust Lives)"}, {0x6c7ef44f,131072,"Defender-Joust (U) [S][t2] (Defender Lives)"}, {0x4dc53c2e,131072,"Defender-Joust (U) [S][t3] (Defender Bombs)"}, {0x328a8ef2,262144,"Gameboy Gallery (J) [S][t1]"}, {0xeb80bfd2,131072,"Incredible Crash Dummies, The (U) [t1]"}, {0x7563c122,262144,"Judge Dredd (U) [t1]"}, {0xc0eb61fe,131072,"Jungle Book. The (U) [t1]"}, {0x388f80cb,524288,"Kirby's Block Ball (U) [S][t1]"}, {0x79a96ddf,262144,"Mega Man 3 (U) [t1]"}, {0xccd8d832,65536,"Mr. Do! (U) [t1]"}, {0x44620e03,524288,"Namco Gallery Volume 2 (J) [S][t1]"}, {0xa5e6d02e,65536,"Paperboy (U) (GB) [t1]"}, {0x31aa2d87,131072,"Prince of Persia (U) [t1]"}, {0x9d89d267,65536,"Snoopy - Magic Show (U) [t1]"}, {0x4456d578,262144,"Speedy Gonzales (U) [t1]"}, {0x58eafbe5,131072,"Super Mario Land (V1.1) (JUA) [t1]"}, {0x04593076,65536,"They Came from Outer Space (PD) [S][t1]"}, {0xe2c49415,524288,"True Lies (U) [t1]"}, {0xe0c5f046,262144,"True Lies (U) [t2]"}, {0xbd566e44,65536,"Head On (J) [t1]"}, {0xd50b7a20,131072,"Snow Bros Jr. (U) [t1]"}, {0x8c826da4,131072,"Addams Family, The - Pugsley's Scavenger Hunt (U) [t2]"}, {0xa428b80f,65536,"After Burst (J) [t1]"}, {0x53d6cc70,131072,"Addams Family, The (U) [t1]"}, {0xfaeb2fc9,262144,"Aladdin (U) [S][t2]"}, {0xd735cfcd,131072,"Alien 3 (U) [t1]"}, {0x0dfcb094,131072,"Asterix (UE) (M5) [t1]"}, {0xeb752234,32768,"Asteroids (U) [t1]"}, {0x87015796,65536,"Astro Rabby (J) [t1]"}, {0x67f09f08,65536,"Ayakashi no Siro (J) [t1]"}, {0xaa3a02ec,131072,"Banishing Racer (J) [t1]"}, {0x0a6e35d9,131072,"Atomic Punk (U) [t1]"}, {0x63a602d9,131072,"Barbie - Game Girl (U) [t1]"}, {0xbdb9e155,131072,"Batman (JU) [t1]"}, {0xfe5c689b,32768,"BattleCity (J) [t1]"}, {0xbd20ecc9,131072,"Beetlejuice (U) [t1]"}, {0x1c998292,131072,"Bill and Ted's Excellent GB Adventure (UE) [t1]"}, {0x4fe4788e,262144,"Bionic Commando (J) [t1]"}, {0x30b6cc04,32768,"Bomb Jack (U) [t1]"}, {0x1a78271d,65536,"Boulder Dash (U) [t1]"}, {0xe5767a8b,524288,"Aladdin (U) [S][t1]"}, {0x74232244,131072,"Aero Star (U) [T-Fre]"}, {0xd94f768d,32768,"Bomb Jack (U) [T-Port]"}, {0x3d348238,262144,"Bomberman GB 3 (J) [S][T-Eng1.00_MakoKnight]"}, {0x0365011a,65536,"Chessmaster, The (V1.1) (UE) [T-Port1.0_Brgames]"}, {0xff97468d,131072,"Daisenryaku Hiro (J) [T-Eng1.00_Gaijin Productions]"}, {0xf58b88c9,524288,"Dragon Ball Z Goku 2 (J) [S][T-Chinese]"}, {0x73bd62e0,524288,"Gameboy Wars Turbo (J) [S][T-Eng]"}, {0xa84a08fc,262144,"Gamera - Daikai Jukutyu Kessen (J) [S][T-Eng]"}, {0x9e3ce318,262144,"Gamera - Daikai Jukutyu Kessen (J) [S][T-Eng0.991]"}, {0x0fc10c91,131072,"Garfield Labyrinth (U) [T-Port]"}, {0x3b18c9fb,262144,"Jida Igeki (J) [T-Eng]"}, {0x17919fc2,524288,"Legend of Zelda, The - Link's Awakening (V1.0) (U) [T-Italian]"}, {0x704d3f06,524288,"Mario's Picross 2 (J) [S][T-Eng]"}, {0x5d4c54a5,262144,"Momotaro Dengeki (J) [T-Eng0.91_Toma]"}, {0x72db7936,262144,"Momotaro Dengeki (J) [T-Eng1]"}, {0xce9ede14,262144,"Momotaro Dengeki (J) [T-Eng2]"}, {0xc2e62e0d,262144,"Oni 4 - Kishin no Ketsuzoku (J) [T-Eng0.30_akujin]"}, {0x45abc6c3,524288,"Picross 2 (J) [S][T-Eng]"}, {0x515322a3,524288,"Pocket Monsters Blue (J) [S][T-Eng]"}, {0x287130cc,524288,"Pocket Monsters Blue (J) [S][T-Eng_partial1]"}, {0x29da6919,1048576,"Pocket Monsters Blue (J) [S][T-Eng_partial2]"}, {0x46885ec0,524288,"Pocket Monsters Green (V1.0) (J) [S][T-Eng]"}, {0xd7eae9a2,524288,"Pocket Monsters Green (V1.0) (J) [S][T-Eng_BGTrans]"}, {0xa86f449a,524288,"Pocket Monsters Green (V1.0) (J) [S][T-Eng_LandaR]"}, {0x26b87107,524288,"Pocket Monsters Green (V1.0) (J) [S][T-Eng0.01_LandaR]"}, {0xe4583418,524288,"Pocket Monsters Green (V1.0) (J) [S][T-Eng0.02_LandaR]"}, {0xfa26c76e,524288,"Pocket Monsters Green (V1.0) (J) [S][T-Eng0.03_LandaR]"}, {0x1dc45d3b,524288,"Pocket Monsters Green (V1.0) (J) [S][T-Eng0.5_DWTRANS]"}, {0x70c8d460,524288,"Pocket Monsters Green (V1.0) (J) [S][T-Eng3.1_Vida]"}, {0x72c95aff,524288,"Pocket Monsters Green (V1.1) (J) [S][T-Eng3.1_Vida]"}, {0x5bf275e1,524288,"Pocket Monsters Green (V1.1) (J) [S][T-English_v0.5_DWTRANS]"}, {0xcc9e3167,1048576,"Pocket Monsters Yellow (V1.0) (J) [S][T-Eng]"}, {0x1e0deed5,1048576,"Pocket Monsters Yellow (V1.0) (J) [S][T-Eng][a1]"}, {0x4c62adc7,1048576,"Pokemon Blue (UA) [S][T-Port]"}, {0xb56fee0f,1048576,"Pokemon Blue (UA) [S][T-Spa]"}, {0x6bc938e7,1048576,"Pokemon Red (U) [S][T-Dutch]"}, {0x819417d2,1048576,"Pokemon Red (U) [S][T-Norwegian2000.05.06_Just4Fun]"}, {0x3b1c9cbb,262144,"Ray Earth (J) [S][T-Eng]"}, {0x92f945da,524288,"Rockman World 5 (J) [S][T-Eng_partial]"}, {0x5a41520c,524288,"Rockman World 5 (J) [S][T-Eng_partial][a1]"}, {0x302c1d6c,262144,"Sa-Ga 2 (Final Fantasy Legend II) (V1.0) (J) [T-Eng]"}, {0xb36e068c,262144,"Sangokushi (J) [T-Chinese][p1]"}, {0x55fdce57,65536,"Sanrio Carnival (J) [T-Eng1.2_Six Feet Under]"}, {0xb232a7ed,65536,"Sanrio Carnival (J) [T-Eng1.x_Six Feet Under]"}, {0xfd58f758,262144,"SD Saint Seiya Paradise (J) [T-Spa1.0b]"}, {0x5aa96c27,65536,"Super Mario Land (V1.1) (JUA) [T-Port]"}, {0xb0a4e40e,131072,"Super Robot War (J) [T-Chinese]"}, {0x482a0a71,524288,"Tenchi Wokurau (J) [p1][T-Chinese][!]"}, {0xac1c4cfe,32768,"Tetris (V1.1) (JU) [T-Port]"}, {0xbd43f605,131072,"Mickey's Dangerous Chase (U) [T-Fre99%_YF06]"}, {0xf25237b0,65536,"Bugs Bunny (U) [T-Port]"}, {0x4e05098b,1048576,"Pocket Monsters Red (V1.0) (J) [S][T-Eng_partial]"}, {0x34af6a0d,1048576,"Pokemon Green (U) [p1][T-Fre10%_YF06]"}, {0xebfc4ef6,1048576,"Pokemon Red (U) [S][T-Norwegian2000.10.02_Just4Fun]"}, {0x2b85a983,524288,"Another Bible (J) [S][T-Eng1.01]"}, {0xbf7cdd4f,131072,"Bomber Boy (J) [t1]"}, {0x18cdedac,131072,"Blades of Steel (U) (GB) [t1]"}, {0x736a488a,131072,"Bubble Bobble Part 2 (U) [t1]"}, {0x66c1ab42,524288,"Donkey Kong Land 2 (UE) [S][T-Fre99%_YF06]"}, {0xc498f7cb,524288,"Donkey Kong Land 3 (U) [S][T-Fre99%_YF06]"}, {0xef30ada1,524288,"Legend of Zelda, The - Link's Awakening (V1.1) (U) [T-Hungarian0.01]"}, {0x87b72aa6,524288,"Legend of Zelda, The - Link's Awakening (V1.2) (U) [T-Hungarian0.01]"}, {0xb414c109,524288,"Pocket Monsters Green (Chinese) (Unl) [S]"}, {0x1b76b3d2,131072,"Alien vs Predator - The Last of His Clan (J) [t1]"}, {0x6780c0ff,131072,"Addams Family, The - Pugsley's Scavenger Hunt (U) [b3]"}, {0xd47bf469,131072,"Asteroids & Missile Command (U) [S][b2]"}, {0x59c46139,262144,"Bonk's Adventure (U) [b1][t1]"}, {0x0ee0860f,131072,"Bubble Bobble Part 2 (U) [b2]"}, {0x58f5cfaa,139264,"Choplifter 2 (U) (JVC - Broderbund) [o1]"}, {0xe2e546de,131072,"Cool World (U) [b4]"}, {0x38464b75,262144,"Final Fantasy Legend III (Sa-Ga 3) (U) [b1]"}, {0xd9dc38ee,262144,"Jurassic Park (E) (M5) [b2]"}, {0x91280680,32768,"Kwirk (UA) [b3]"}, {0xca0a3f31,131072,"NBA All Star Challenge 2 (U) [b6]"}, {0x156ac361,131072,"Super Kick Off (U) [b3]"}, {0x6869856a,341640,"Super Mario Land 3 - Wario Land (JUE) [b3]"}, {0x2fa0fccf,131073,"Turrican (UE) [b3]"}, {0x96fe243c,1048576,"Warioland 2 (UE) [S][b2]"}, {0xfd497e24,1048576,"Warioland 2 (UE) [S][b3]"}, {0xb4900ada,262144,"Yuuyuu 3 (J) [b1]"}, {0x560a5b48,131072,"Last Action Hero (U) [b2]"}, {0xdaca4ed8,262144,"Marble Madness (U) [b4]"}, {0x44806e76,131584,"Home Alone 2 (crc-2) [U][!]"}, {0x0e08f59b,131072,"Spot - The Cool Adventure (crc-2) [U]"}, {0x5110e971,131072,"Nemesis ('90) (UE) (crc-2) [!]"}, }; int DAT_LookFor(int CRC32) { int i; for(i=0;i<DATROMS;i++) if(MyDat[i].crc==CRC32) return i; return -1; }
Java
/* * rbc.h * ctc local * * Created by Dmitry Alexeev on Nov 3, 2014 * Copyright 2014 ETH Zurich. All rights reserved. * */ #pragma once #include <cuda_runtime.h> using namespace std; namespace CudaRBC { struct Params { float kbT, p, lmax, q, Cq, totArea0, totVolume0, ka, kv, gammaT, gammaC, sinTheta0, cosTheta0, kb, l0; float sint0kb, cost0kb, kbToverp; int nvertices, ntriangles; }; struct Extent { float xmin, ymin, zmin; float xmax, ymax, zmax; }; static Params params; static __constant__ Params devParams; /* blocking, initializes params */ void setup(int& nvertices, Extent& host_extent); int get_nvertices(); /* A * (x, 1) */ void initialize(float *device_xyzuvw, const float (*transform)[4]); /* non-synchronizing */ void forces_nohost(cudaStream_t stream, int ncells, const float * const device_xyzuvw, float * const device_axayaz); /*non-synchronizing, extent not initialized */ void extent_nohost(cudaStream_t stream, int ncells, const float * const xyzuvw, Extent * device_extent, int n = -1); /* get me a pointer to YOUR plain array - no allocation on my side */ void get_triangle_indexing(int (*&host_triplets_ptr)[3], int& ntriangles); };
Java
// Copyright 2018 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <string> // Refer to docs/autoupdate_overview.md for a detailed overview of the autoupdate process // This class defines all the logic for Dolphin auto-update checking. UI-specific elements have to // be defined in a backend specific subclass. class AutoUpdateChecker { public: // Initiates a check for updates in the background. Calls the OnUpdateAvailable callback if an // update is available, does "nothing" otherwise. void CheckForUpdate(); static bool SystemSupportsAutoUpdates(); struct NewVersionInformation { // Name (5.0-1234) and revision hash of the new version. std::string new_shortrev; std::string new_hash; // The full changelog in HTML format. std::string changelog_html; // Internals, to be passed to the updater binary. std::string this_manifest_url; std::string next_manifest_url; std::string content_store_url; }; // Starts the updater process, which will wait in the background until the current process exits. enum class RestartMode { NO_RESTART_AFTER_UPDATE = 0, RESTART_AFTER_UPDATE, }; void TriggerUpdate(const NewVersionInformation& info, RestartMode restart_mode); protected: virtual void OnUpdateAvailable(const NewVersionInformation& info) = 0; };
Java
<?php /* +--------------------------------------------------------------------+ | CiviCRM version 4.3 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2013 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | | CiviCRM is free software; you can copy, modify, and distribute it | | under the terms of the GNU Affero General Public License | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | | | CiviCRM is distributed in the hope that it will be useful, but | | WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | See the GNU Affero General Public License for more details. | | | | You should have received a copy of the GNU Affero General Public | | License and the CiviCRM Licensing Exception along | | with this program; if not, contact CiviCRM LLC | | at info[AT]civicrm[DOT]org. If you have questions about the | | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ */ /** * * @package CRM * @copyright CiviCRM LLC (c) 2004-2013 * $Id$ * */ /** * This class contains all the function that are called using AJAX */ class CRM_Core_Page_AJAX_Location { /** * FIXME: we should make this method like getLocBlock() OR use the same method and * remove this one. * * Function to obtain the location of given contact-id. * This method is used by on-behalf-of form to dynamically generate poulate the * location field values for selected permissioned contact. */ function getPermissionedLocation() { $cid = CRM_Utils_Type::escape($_GET['cid'], 'Integer'); if ($_GET['ufId']) { $ufId = CRM_Utils_Type::escape($_GET['ufId'], 'Integer'); } elseif ($_GET['relContact']) { $relContact = CRM_Utils_Type::escape($_GET['relContact'], 'Integer'); } $values = array(); $entityBlock = array('contact_id' => $cid); $location = CRM_Core_BAO_Location::getValues($entityBlock); $config = CRM_Core_Config::singleton(); $addressSequence = array_flip($config->addressSequence()); if ($relContact) { $elements = array( "phone_1_phone" => $location['phone'][1]['phone'], "email_1_email" => $location['email'][1]['email'], ); if (array_key_exists('street_address', $addressSequence)) { $elements["address_1_street_address"] = $location['address'][1]['street_address']; } if (array_key_exists('supplemental_address_1', $addressSequence)) { $elements['address_1_supplemental_address_1'] = $location['address'][1]['supplemental_address_1']; } if (array_key_exists('supplemental_address_2', $addressSequence)) { $elements['address_1_supplemental_address_2'] = $location['address'][1]['supplemental_address_2']; } if (array_key_exists('city', $addressSequence)) { $elements['address_1_city'] = $location['address'][1]['city']; } if (array_key_exists('postal_code', $addressSequence)) { $elements['address_1_postal_code'] = $location['address'][1]['postal_code']; $elements['address_1_postal_code_suffix'] = $location['address'][1]['postal_code_suffix']; } if (array_key_exists('country', $addressSequence)) { $elements['address_1_country_id'] = $location['address'][1]['country_id']; } if (array_key_exists('state_province', $addressSequence)) { $elements['address_1_state_province_id'] = $location['address'][1]['state_province_id']; } } else { $profileFields = CRM_Core_BAO_UFGroup::getFields($ufId, FALSE, CRM_Core_Action::VIEW, NULL, NULL, FALSE, NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL ); $website = CRM_Core_BAO_Website::getValues($entityBlock, $values); foreach ($location as $fld => $values) { if (is_array($values) && !empty($values)) { $locType = $values[1]['location_type_id']; if ($fld == 'email') { $elements["onbehalf_{$fld}-{$locType}"] = array( 'type' => 'Text', 'value' => $location[$fld][1][$fld], ); unset($profileFields["{$fld}-{$locType}"]); } elseif ($fld == 'phone') { $phoneTypeId = $values[1]['phone_type_id']; $elements["onbehalf_{$fld}-{$locType}-{$phoneTypeId}"] = array( 'type' => 'Text', 'value' => $location[$fld][1][$fld], ); unset($profileFields["{$fld}-{$locType}-{$phoneTypeId}"]); } elseif ($fld == 'im') { $providerId = $values[1]['provider_id']; $elements["onbehalf_{$fld}-{$locType}"] = array( 'type' => 'Text', 'value' => $location[$fld][1][$fld], ); $elements["onbehalf_{$fld}-{$locType}provider_id"] = array( 'type' => 'Select', 'value' => $location[$fld][1]['provider_id'], ); unset($profileFields["{$fld}-{$locType}-{$providerId}"]); } } } if (!empty($website)) { foreach ($website as $key => $val) { $websiteTypeId = $values[1]['website_type_id']; $elements["onbehalf_url-1"] = array( 'type' => 'Text', 'value' => $website[1]['url'], ); $elements["onbehalf_url-1-website_type_id"] = array( 'type' => 'Select', 'value' => $website[1]['website_type_id'], ); unset($profileFields["url-1"]); } } $locTypeId = $location['address'][1]['location_type_id']; $addressFields = array( 'street_address', 'supplemental_address_1', 'supplemental_address_2', 'city', 'postal_code', 'country', 'state_province', ); foreach ($addressFields as $field) { if (array_key_exists($field, $addressSequence)) { $addField = $field; if (in_array($field, array( 'state_province', 'country'))) { $addField = "{$field}_id"; } $elements["onbehalf_{$field}-{$locTypeId}"] = array( 'type' => 'Text', 'value' => $location['address'][1][$addField], ); unset($profileFields["{$field}-{$locTypeId}"]); } } //set custom field defaults $defaults = array(); CRM_Core_BAO_UFGroup::setProfileDefaults($cid, $profileFields, $defaults, TRUE, NULL, NULL, TRUE); if (!empty($defaults)) { foreach ($profileFields as $key => $val) { if (array_key_exists($key, $defaults)) { $htmlType = CRM_Utils_Array::value('html_type', $val); if ($htmlType == 'Radio') { $elements["onbehalf[{$key}]"]['type'] = $htmlType; $elements["onbehalf[{$key}]"]['value'] = $defaults[$key]; } elseif ($htmlType == 'CheckBox') { foreach ($defaults[$key] as $k => $v) { $elements["onbehalf[{$key}][{$k}]"]['type'] = $htmlType; $elements["onbehalf[{$key}][{$k}]"]['value'] = $v; } } elseif ($htmlType == 'Multi-Select') { foreach ($defaults[$key] as $k => $v) { $elements["onbehalf_{$key}"]['type'] = $htmlType; $elements["onbehalf_{$key}"]['value'][$k] = $v; } } elseif ($htmlType == 'Autocomplete-Select') { $elements["onbehalf_{$key}"]['type'] = $htmlType; $elements["onbehalf_{$key}"]['value'] = $defaults[$key]; $elements["onbehalf_{$key}"]['id'] = $defaults["{$key}_id"]; } else { $elements["onbehalf_{$key}"]['type'] = $htmlType; $elements["onbehalf_{$key}"]['value'] = $defaults[$key]; } } else { $elements["onbehalf_{$key}"]['value'] = ''; } } } } echo json_encode($elements); CRM_Utils_System::civiExit(); } function jqState($config) { if (!isset($_GET['_value']) || empty($_GET['_value']) ) { CRM_Utils_System::civiExit(); } $result = CRM_Core_PseudoConstant::stateProvinceForCountry($_GET['_value']); $elements = array(array('name' => ts('- select a state -'), 'value' => '', )); foreach ($result as $id => $name) { $elements[] = array( 'name' => $name, 'value' => $id, ); } echo json_encode($elements); CRM_Utils_System::civiExit(); } function jqCounty($config) { if (CRM_Utils_System::isNull($_GET['_value'])) { $elements = array(array('name' => ts('- select state -'), 'value' => '', )); } else { $result = CRM_Core_PseudoConstant::countyForState($_GET['_value']); $elements = array(array('name' => ts('- select -'), 'value' => '', )); foreach ($result as $id => $name) { $elements[] = array( 'name' => $name, 'value' => $id, ); } if ($elements == array( array('name' => ts('- select -'), 'value' => ''))) { $elements = array(array('name' => ts('- no counties -'), 'value' => '', )); } } echo json_encode($elements); CRM_Utils_System::civiExit(); } function getLocBlock() { // i wish i could retrieve loc block info based on loc_block_id, // Anyway, lets retrieve an event which has loc_block_id set to 'lbid'. if ($_POST['lbid']) { $params = array('1' => array($_POST['lbid'], 'Integer')); $eventId = CRM_Core_DAO::singleValueQuery('SELECT id FROM civicrm_event WHERE loc_block_id=%1 LIMIT 1', $params); } // now lets use the event-id obtained above, to retrieve loc block information. if ($eventId) { $params = array('entity_id' => $eventId, 'entity_table' => 'civicrm_event'); // second parameter is of no use, but since required, lets use the same variable. $location = CRM_Core_BAO_Location::getValues($params, $params); } $result = array(); $addressOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_options', TRUE, NULL, TRUE ); // lets output only required fields. foreach ($addressOptions as $element => $isSet) { if ($isSet && (!in_array($element, array( 'im', 'openid')))) { if (in_array($element, array( 'country', 'state_province', 'county'))) { $element .= '_id'; } elseif ($element == 'address_name') { $element = 'name'; } $fld = "address[1][{$element}]"; $value = CRM_Utils_Array::value($element, $location['address'][1]); $value = $value ? $value : ""; $result[str_replace(array( '][', '[', "]"), array('_', '_', ''), $fld)] = $value; } } foreach (array( 'email', 'phone_type_id', 'phone') as $element) { $block = ($element == 'phone_type_id') ? 'phone' : $element; for ($i = 1; $i < 3; $i++) { $fld = "{$block}[{$i}][{$element}]"; $value = CRM_Utils_Array::value($element, $location[$block][$i]); $value = $value ? $value : ""; $result[str_replace(array( '][', '[', "]"), array('_', '_', ''), $fld)] = $value; } } // set the message if loc block is being used by more than one event. $result['count_loc_used'] = CRM_Event_BAO_Event::countEventsUsingLocBlockId($_POST['lbid']); echo json_encode($result); CRM_Utils_System::civiExit(); } }
Java
// $Id$ // QtLobby released under the GPLv3, see COPYING for details. #include "TLDList.h" QMap<QString, QString>* TLDList::TLDMap; TLDList::TLDList( QObject* parent) : QObject(parent){ if ( TLDMap == NULL ) { TLDMap = new QMap<QString, QString>; QString TLDString = tr("AC:Ascension Island\n" "AD:Andorra\n" "AE:United Arab Emirates\n" "AERO:Aircraft-related\n" "AF:Afghanistan\n" "AG:Antigua and Barbuda\n" "AI:Anguilla\n" "AL:Albania\n" "AM:Armenia\n" "AN:Netherland Antilles\n" "AO:Angola\n" "AQ:Antarctica\n" "AR:Argentina\n" "ARPA:Address and Routing Parameter Area\n" "AS:American Samoa\n" "AT:Austria\n" "AU:Australia\n" "AW:Aruba\n" "AZ:Azerbaijan\n" "BA:Bosnia-Herzegovina\n" "BB:Barbados\n" "BE:Belgium\n" "BF:Burkina Faso\n" "BG:Bulgaria\n" "BH:Bahrain\n" "BI:Burundi\n" "BIz:Business\n" "BJ:Benin\n" "BM:Bermuda\n" "BN:Brunei Darussalam\n" "BO:Bolivia\n" "BR:Brazil\n" "BS:Bahamas\n" "BT:Bhutan\n" "BW:Botswana\n" "BY:Belarus\n" "BZ:Belize\n" "CA:Canada\n" "CC:Cocos (Keeling) Islands\n" "CD:Democratic Republic of Congo\n" "CF:Central African Republic\n" "CG:Congo\n" "CH:Switzerland\n" "CI:Ivory Coast\n" "CK:Cook Islands\n" "CL:Chile\n" "CM:Cameroon\n" "CN:China\n" "CO:Colombia\n" "COM:Commercial\n" "COOP:Cooperative-related\n" "CR:Costa Rica\n" "CU:Cuba\n" "CV:Cape Verde\n" "CX:Christmas Island\n" "CY:Cyprus\n" "CZ:Czech Republic\n" "DE:Germany\n" "DJ:Djibouti\n" "DK:Denmark\n" "DM:Dominica\n" "DO:Dominican Republic\n" "DZ:Algeria\n" "EC:Ecuador\n" "EDU:Educational\n" "EE:Estonia\n" "EG:Egypt\n" "ES:Spain\n" "ET:Ethiopia\n" "FI:Finland\n" "FJ:Fiji\n" "FK:Falkland Islands (Malvinas)\n" "FM:Micronesia\n" "FO:Faroe Islands\n" "FR:France\n" "GB:Great Britan\n" "GA:Gabon\n" "GD:Grenada\n" "GE:Georgia\n" "GF:French Guyana\n" "GH:Ghana\n" "GI:Gibraltar\n" "GL:Greenland\n" "GM:Gambia\n" "GN:Guinea\n" "GOV:Government\n" "GP:Guadeloupe (French)\n" "GQ:Equatorial Guinea\n" "GR:Greece\n" "GT:Guatemala\n" "GU:Guam (US)\n" "GY:Guyana\n" "HK:Hong Kong\n" "HM:Heard and McDonald Islands\n" "HN:Honduras\n" "HR:Croatia (Hrvatska)\n" "HU:Hungary\n" "ID:Indonesia\n" "IE:Ireland\n" "IL:Israel\n" "IN:India\n" "INFO:General-purpose TLD\n" "INT:International\n" "IO:British Indian Ocean Territory\n" "IR:Islamic Republic of Iran\n" "IS:Iceland\n" "IT:Italy\n" "JM:Jamaica\n" "JO:Jordan\n" "JP:Japan\n" "KE:Kenya\n" "KG:Kyrgyzstan\n" "KH:Cambodia\n" "KI:Kiribati\n" "KM:Comoros\n" "KN:Saint Kitts Nevis Anguilla\n" "KR:South Korea\n" "KW:Kuwait\n" "KY:Cayman Islands\n" "KZ:Kazakhstan\n" "LA:Laos (People's Democratic Republic)\n" "LB:Lebanon\n" "LC:Saint Lucia\n" "LI:Liechtenstein\n" "LK:Sri Lanka\n" "LR:Liberia\n" "LS:Lesotho\n" "LT:Lithuania\n" "LU:Luxembourg\n" "LV:Latvia\n" "LY:Libya (Libyan Arab Jamahiriya)\n" "MA:Morocco\n" "MC:Monaco\n" "MD:Moldavia\n" "MG:Madagascar\n" "MH:Marshall Islands\n" "MIL:US Military\n" "MK:Macedonia\n" "ML:Mali\n" "MM:Myanmar\n" "MN:Mongolia\n" "MO:Macau\n" "MP:Northern Mariana Islands\n" "MQ:Martinique (French)\n" "MR:Mauritania\n" "MS:Montserrat\n" "MT:Malta\n" "MU:Mauritius\n" "MUseum:Museum-related\n" "MV:Maldives\n" "MW:Malawi\n" "MX:Mexico\n" "MY:Malaysia\n" "MZ:Mozambique\n" "NA:Namibia\n" "NAME:Personal name\n" "NC:New Caledonia (French)\n" "NE:Niger\n" "NET:Network Infrastructure\n" "NF:Norfolk Island\n" "NG:Nigeria\n" "NI:Nicaragua\n" "NL:Netherlands\n" "NO:Norway\n" "NP:Nepal\n" "NR:Nauru\n" "NU:Niue\n" "NZ:New Zealand\n" "OM:Oman\n" "ORG:Nonprofit\n" "PA:Panama\n" "PE:Peru\n" "PF:French Polynesia\n" "PF:Polynesia (French)\n" "PG:Papua New Guinea\n" "PH:Philippines\n" "PK:Pakistan\n" "PL:Poland\n" "PM:Saint Pierre and Miquelon\n" "PN:Pitcairn\n" "PR:Puerto Rico (US)\n" "PRo:Professional domain\n" "PS:Palestina\n" "PT:Portugal\n" "PW:Palau\n" "PY:Paraguay\n" "QA:Qatar\n" "RE:Reunion (French)\n" "RO:Romania\n" "RU:Russian Federation\n" "RW:Rwanda\n" "SA:Saudi Arabia\n" "SB:Solomon Islands\n" "SC:Seychelles\n" "SE:Sweden\n" "SG:Singapore\n" "SH:Saint Helena\n" "SI:Slovenia\n" "SK:Slovak Republic (Slovakia)\n" "SL:Sierra Leone\n" "SM:San Marino\n" "SN:Senegal\n" "SO:Somalia\n" "SR:Surinam\n" "ST:Saint Tome and Principe\n" "SU:Soviet Union\n" "SV:El Salvador\n" "SZ:Swaziland\n" "TC:Turks and Caicos Islands\n" "TD:Chad\n" "TF:French Southern Territories\n" "TG:Togo\n" "TH:Thailand\n" "TJ:Tajikistan\n" "TK:Tokelau\n" "TM:Turkmenistan\n" "TN:Tunisia\n" "TO:Tonga\n" "TP:East Timor\n" "TR:Turkey\n" "TT:Trinidad and Tobago\n" "TV:Tuvalu\n" "TW:Taiwan\n" "TZ:Tanzania\n" "UA:Ukraine\n" "UG:Uganda\n" "UK:United Kingdom\n" "US:United States of America\n" "UY:Uruguay\n" "UZ:Uzbekistan\n" "VA:Vatican City State\n" "VC:Saint Vincent and the Grenadines\n" "VE:Venezuela\n" "VG:Virgin Islands (British)\n" "VI:Virgin Islands (US)\n" "VN:Vietnam\n" "VU:Vanuatu\n" "WS:Samoa\n" "YE:Yemen\n" "YU:Yugoslavia\n" "ZA:South Africa\n" "ZM:Zambia\n" "ZR:Zaire\n" "ZW:Zimbabwe\n" "XX:?\n" ); QStringList list = TLDString.split( "\n" ); foreach( QString s, list ) { TLDMap->insert( s.section( ":", 0, 0 ), s.section( ":", 1, 1 ) ); } } } TLDList::~TLDList() { }
Java
// qtractorAtomic.h // /**************************************************************************** Copyright (C) 2005-2021, rncbc aka Rui Nuno Capela. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *****************************************************************************/ #ifndef __qtractorAtomic_h #define __qtractorAtomic_h #define HAVE_QATOMIC_H #if defined(HAVE_QATOMIC_H) # include <qatomic.h> #endif #if defined(__cplusplus) extern "C" { #endif #if defined(HAVE_QATOMIC_H) typedef QAtomicInt qtractorAtomic; #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) #define ATOMIC_GET(a) ((a)->loadRelaxed()) #define ATOMIC_SET(a,v) ((a)->storeRelaxed(v)) #elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #define ATOMIC_GET(a) ((a)->load()) #define ATOMIC_SET(a,v) ((a)->store(v)) #else #define ATOMIC_GET(a) ((int) *(a)) #define ATOMIC_SET(a,v) (*(a) = (v)) #endif static inline int ATOMIC_CAS ( qtractorAtomic *pVal, int iOldValue, int iNewValue ) { return pVal->testAndSetOrdered(iOldValue, iNewValue); } #else // !HAVE_QATOMIC_H #if defined(__GNUC__) #if defined(__powerpc__) || defined(__powerpc64__) static inline int ATOMIC_CAS1 ( volatile int *pValue, int iOldValue, int iNewValue ) { register int result; asm volatile ( "# ATOMIC_CAS1 \n" " lwarx r0, 0, %1 \n" " cmpw r0, %2 \n" " bne- 1f \n" " sync \n" " stwcx. %3, 0, %1 \n" " bne- 1f \n" " li %0, 1 \n" " b 2f \n" "1: \n" " li %0, 0 \n" "2: \n" : "=r" (result) : "r" (pValue), "r" (iOldValue), "r" (iNewValue) : "r0" ); return result; } #elif defined(__i386__) || defined(__x86_64__) static inline int ATOMIC_CAS1 ( volatile int *pValue, int iOldValue, int iNewValue ) { register char result; asm volatile ( "# ATOMIC_CAS1 \n" "lock ; cmpxchgl %2, %3 \n" "sete %1 \n" : "=a" (iNewValue), "=qm" (result) : "r" (iNewValue), "m" (*pValue), "0" (iOldValue) : "memory" ); return result; } #else # error "qtractorAtomic.h: unsupported target compiler processor (GNUC)." #endif #elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) static inline int ATOMIC_CAS1 ( volatile int *pValue, int iOldValue, int iNewValue ) { register char result; __asm { push ebx push esi mov esi, pValue mov eax, iOldValue mov ebx, iNewValue lock cmpxchg dword ptr [esi], ebx sete result pop esi pop ebx } return result; } #else # error "qtractorAtomic.h: unsupported target compiler processor (WIN32)." #endif typedef struct { volatile int value; } qtractorAtomic; #define ATOMIC_GET(a) ((a)->value) #define ATOMIC_SET(a,v) ((a)->value = (v)) static inline int ATOMIC_CAS ( qtractorAtomic *pVal, int iOldValue, int iNewValue ) { return ATOMIC_CAS1(&(pVal->value), iOldValue, iNewValue); } #endif // !HAVE_QATOMIC_H // Strict test-and-set primite. static inline int ATOMIC_TAS ( qtractorAtomic *pVal ) { return ATOMIC_CAS(pVal, 0, 1); } // Strict test-and-add primitive. static inline int ATOMIC_ADD ( qtractorAtomic *pVal, int iAddValue ) { volatile int iOldValue, iNewValue; do { iOldValue = ATOMIC_GET(pVal); iNewValue = iOldValue + iAddValue; } while (!ATOMIC_CAS(pVal, iOldValue, iNewValue)); return iNewValue; } #define ATOMIC_INC(a) ATOMIC_ADD((a), (+1)) #define ATOMIC_DEC(a) ATOMIC_ADD((a), (-1)) // Special test-and-zero primitive (invented here:) static inline int ATOMIC_TAZ ( qtractorAtomic *pVal ) { volatile int iOldValue; do { iOldValue = ATOMIC_GET(pVal); } while (iOldValue && !ATOMIC_CAS(pVal, iOldValue, 0)); return iOldValue; } #if defined(__cplusplus) } #endif #endif // __qtractorAtomic_h // end of qtractorAtomic.h
Java
Timeline Component Integration ========== This component will not function properly without the the following hook and container classes. 1. Right after the opening body tag, in your WordPress theme template, add the following hook. Aesop uses this hook to inject markup. ### Pre 1.0.5 `do_action(‘aesop_inside_body_top’);` ### 1.0.5+ `do_action(‘ase_theme_body_inside_top’);` 2. Add this CSS class to your article/container div that holds the actual post. `.aesop-entry-content`
Java
/* * max8698.h -- Voltage regulation for the Maxim 8698 * * Copyright (C) 2009 Samsung Electrnoics * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef REGULATOR_MAX8698 #define REGULATOR_MAX8698 #include <linux/regulator/machine.h> enum { MAX8698_LDO1 = 1, MAX8698_LDO2, MAX8698_LDO3, MAX8698_LDO4, MAX8698_LDO5, MAX8698_LDO6, MAX8698_LDO7, MAX8698_LDO8, MAX8698_LDO9, MAX8698_DCDC1, MAX8698_DCDC2, MAX8698_DCDC3, }; /** * max8698_subdev_data - regulator data * @id: regulator Id * @initdata: regulator init data (contraints, supplies, ...) */ /* old structure struct max8698_subdev_data { int id; struct regulator_init_data *initdata; };*/ struct max8698_subdev_data { int id; // const char *name; void *platform_data; }; /** * max8698_platform_data - platform data for max8698 * @num_regulators: number of regultors used * @regulators: regulator used */ struct max8698_platform_data { int num_regulators; struct max8698_subdev_data *regulators; }; #endif
Java
<?php namespace Drupal\webform_node; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleUninstallValidatorInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; /** * Prevents webform_node module from being uninstalled whilst any webform nodes exist. */ class WebformNodeUninstallValidator implements ModuleUninstallValidatorInterface { use StringTranslationTrait; /** * The entity type manager. * * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ protected $entityTypeManager; /** * Constructs a WebformNodeUninstallValidator. * * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * The string translation service. */ public function __construct(EntityTypeManagerInterface $entity_type_manager, TranslationInterface $string_translation) { $this->entityTypeManager = $entity_type_manager; $this->stringTranslation = $string_translation; } /** * {@inheritdoc} */ public function validate($module) { $reasons = []; if ($module === 'webform_node') { // The webform node type is provided by the Webform node module. Prevent // uninstall if there are any nodes of that type. if ($this->hasWebformNodes()) { $reasons[] = $this->t('To uninstall Webform node, delete all content that has the Webform content type.'); } } return $reasons; } /** * Determines if there is any webform nodes or not. * * @return bool * TRUE if there are webform nodes, FALSE otherwise. */ protected function hasWebformNodes() { $nodes = $this->entityTypeManager->getStorage('node')->getQuery() ->condition('type', 'webform') ->accessCheck(FALSE) ->range(0, 1) ->execute(); return !empty($nodes); } }
Java
<?php /** * Custom template tags for this theme. * * Eventually, some of the functionality here could be replaced by core features. * * @package testwp_ssass */ if ( ! function_exists( 'testwp_ssass_paging_nav' ) ) : /** * Display navigation to next/previous set of posts when applicable. */ function testwp_ssass_paging_nav() { // Don't print empty markup if there's only one page. if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { return; } ?> <nav class="navigation paging-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'testwp_ssass' ); ?></h1> <div class="nav-links"> <?php if ( get_next_posts_link() ) : ?> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'testwp_ssass' ) ); ?></div> <?php endif; ?> <?php if ( get_previous_posts_link() ) : ?> <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'testwp_ssass' ) ); ?></div> <?php endif; ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php } endif; if ( ! function_exists( 'testwp_ssass_post_nav' ) ) : /** * Display navigation to next/previous post when applicable. */ function testwp_ssass_post_nav() { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'testwp_ssass' ); ?></h1> <div class="nav-links"> <?php previous_post_link( '<div class="nav-previous">%link</div>', _x( '<span class="meta-nav">&larr;</span>&nbsp;%title', 'Previous post link', 'testwp_ssass' ) ); next_post_link( '<div class="nav-next">%link</div>', _x( '%title&nbsp;<span class="meta-nav">&rarr;</span>', 'Next post link', 'testwp_ssass' ) ); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php } endif; if ( ! function_exists( 'testwp_ssass_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ function testwp_ssass_posted_on() { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $posted_on = sprintf( _x( 'Posted on %s', 'post date', 'testwp_ssass' ), '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' ); $byline = sprintf( _x( 'by %s', 'post author', 'testwp_ssass' ), '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>' ); echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; } endif; if ( ! function_exists( 'testwp_ssass_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function testwp_ssass_entry_footer() { // Hide category and tag text for pages. if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ', ', 'testwp_ssass' ) ); if ( $categories_list && testwp_ssass_categorized_blog() ) { printf( '<span class="cat-links">' . __( 'Posted in %1$s', 'testwp_ssass' ) . '</span>', $categories_list ); } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', __( ', ', 'testwp_ssass' ) ); if ( $tags_list ) { printf( '<span class="tags-links">' . __( 'Tagged %1$s', 'testwp_ssass' ) . '</span>', $tags_list ); } } if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo '<span class="comments-link">'; comments_popup_link( __( 'Leave a comment', 'testwp_ssass' ), __( '1 Comment', 'testwp_ssass' ), __( '% Comments', 'testwp_ssass' ) ); echo '</span>'; } edit_post_link( __( 'Edit', 'testwp_ssass' ), '<span class="edit-link">', '</span>' ); } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function testwp_ssass_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'testwp_ssass_categories' ) ) ) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'testwp_ssass_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so testwp_ssass_categorized_blog should return true. return true; } else { // This blog has only 1 category so testwp_ssass_categorized_blog should return false. return false; } } /** * Flush out the transients used in testwp_ssass_categorized_blog. */ function testwp_ssass_category_transient_flusher() { // Like, beat it. Dig? delete_transient( 'testwp_ssass_categories' ); } add_action( 'edit_category', 'testwp_ssass_category_transient_flusher' ); add_action( 'save_post', 'testwp_ssass_category_transient_flusher' );
Java
#system_notice_area_dismiss{ color: #FFFFFF; cursor: pointer; } .system_notice_area_style1 { background: #00C348; border: 1px solid green; } .system_notice_area_style0 { background: #FA5A6A; border: 1px solid brown; } .bottonWidth{ width:120px; } .img{ width:20px; height: 20px; } #bottomBorderNone{ border-bottom:none; } .submit{ background:#25A6E1; background:-moz-linear-gradient(top,#25A6E1 0%,#188BC0 100%); background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#25A6E1),color-stop(100%,#188BC0)); background:-webkit-linear-gradient(top,#25A6E1 0%,#188BC0 100%); background:-o-linear-gradient(top,#25A6E1 0%,#188BC0 100%); background:-ms-linear-gradient(top,#25A6E1 0%,#188BC0 100%); background:linear-gradient(top,#25A6E1 0%,#188BC0 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#25A6E1",endColorstr="#188BC0",GradientType=0); padding:1px 13px; color:#ffffff; font-family:"Helvetica Neue",sans-serif; font-size:15px; cursor:pointer; }
Java
<?php /** * Represents the view for the public-facing component of the plugin. * * This typically includes any information, if any, that is rendered to the * frontend of the theme when the plugin is activated. * * @package Changelog * @author averta < > * @license GPL-2.0+ * @link http://example.com * @copyright 2014 */ ?> <!-- This file is used to markup the public facing aspect of the plugin. -->
Java
<?php $orig_post = $post; global $post; $categories = get_the_category($post->ID); if ($categories) { $category_ids = array(); foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id; $args=array( 'category__in' => $category_ids, 'post__not_in' => array($post->ID), 'posts_per_page'=> 4, // Number of related posts that will be shown. 'caller_get_posts'=>1 ); $my_query = new wp_query( $args ); if( $my_query->have_posts() ) { echo '<div id="related_posts" class="bottom-single-related"><h3 class="rs">Также рекомендуем прочитать</h3><ul>'; while( $my_query->have_posts() ) { $my_query->the_post(); $thumb2 = get_post_thumbnail_id();$img_url2 = wp_get_attachment_url( $thumb2,'index-blog' );$image2 = aq_resize( $img_url2, 150,150,true ); ?> <li> <?php if ($image){ ?> <img src="<?php echo $image2; ?>"> <?php } ?> <h2><a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2></li> <?php } echo '</ul></div>'; } } $post = $orig_post; wp_reset_query(); ?>
Java
<?php /** * @package Joomla.Administrator * @subpackage com_config * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Config\Administrator\View\Component; \defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\Component\Config\Administrator\Helper\ConfigHelper; /** * View for the component configuration * * @since 3.2 */ class HtmlView extends BaseHtmlView { /** * The model state * * @var \Joomla\CMS\Object\CMSObject * @since 3.2 */ public $state; /** * The form object * * @var \Joomla\CMS\Form\Form * @since 3.2 */ public $form; /** * An object with the information for the component * * @var \Joomla\CMS\Component\ComponentRecord * @since 3.2 */ public $component; /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise an Error object. * * @see \JViewLegacy::loadTemplate() * @since 3.2 */ public function display($tpl = null) { $form = null; $component = null; try { $component = $this->get('component'); if (!$component->enabled) { return false; } $form = $this->get('form'); $user = Factory::getUser(); } catch (\Exception $e) { Factory::getApplication()->enqueueMessage($e->getMessage(), 'error'); return false; } $this->fieldsets = $form ? $form->getFieldsets() : null; $this->formControl = $form ? $form->getFormControl() : null; // Don't show permissions fieldset if not authorised. if (!$user->authorise('core.admin', $component->option) && isset($this->fieldsets['permissions'])) { unset($this->fieldsets['permissions']); } $this->form = &$form; $this->component = &$component; $this->components = ConfigHelper::getComponentsWithConfig(); $this->userIsSuperAdmin = $user->authorise('core.admin'); $this->currentComponent = Factory::getApplication()->input->get('component'); $this->return = Factory::getApplication()->input->get('return', '', 'base64'); $this->addToolbar(); return parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 3.2 */ protected function addToolbar() { ToolbarHelper::title(Text::_($this->component->option . '_configuration'), 'sliders-h config'); ToolbarHelper::apply('component.apply'); ToolbarHelper::divider(); ToolbarHelper::save('component.save'); ToolbarHelper::divider(); ToolbarHelper::cancel('component.cancel', 'JTOOLBAR_CLOSE'); ToolbarHelper::divider(); $helpUrl = $this->form->getData()->get('helpURL'); $helpKey = (string) $this->form->getXml()->config->help['key']; $helpKey = $helpKey ?: 'JHELP_COMPONENTS_' . strtoupper($this->currentComponent) . '_OPTIONS'; ToolbarHelper::help($helpKey, (boolean) $helpUrl, null, $this->currentComponent); } }
Java
#===================================================================== # SQL-Ledger ERP # Copyright (c) 2006 # # Author: DWS Systems Inc. # Web: http://www.sql-ledger.com # #====================================================================== # # module for preparing Income Statement and Balance Sheet # #====================================================================== require "$form->{path}/arap.pl"; use SL::PE; use SL::RP; 1; # end of main # this is for our long dates # $locale->text('January') # $locale->text('February') # $locale->text('March') # $locale->text('April') # $locale->text('May ') # $locale->text('June') # $locale->text('July') # $locale->text('August') # $locale->text('September') # $locale->text('October') # $locale->text('November') # $locale->text('December') # this is for our short month # $locale->text('Jan') # $locale->text('Feb') # $locale->text('Mar') # $locale->text('Apr') # $locale->text('May') # $locale->text('Jun') # $locale->text('Jul') # $locale->text('Aug') # $locale->text('Sep') # $locale->text('Oct') # $locale->text('Nov') # $locale->text('Dec') # $locale->text('Balance Sheet') # $locale->text('Income Statement') # $locale->text('Trial Balance') # $locale->text('AR Aging') # $locale->text('AP Aging') # $locale->text('Tax collected') # $locale->text('Tax paid') # $locale->text('Receipts') # $locale->text('Payments') # $locale->text('Project Transactions') # $locale->text('Non-taxable Sales') # $locale->text('Non-taxable Purchases') sub report { %report = ( balance_sheet => { title => 'Balance Sheet' }, income_statement => { title => 'Income Statement' }, trial_balance => { title => 'Trial Balance' }, ar_aging => { title => 'AR Aging', vc => 'customer' }, ap_aging => { title => 'AP Aging', vc => 'vendor' }, tax_collected => { title => 'Tax collected', vc => 'customer' }, tax_paid => { title => 'Tax paid' }, nontaxable_sales => { title => 'Non-taxable Sales', vc => 'customer' }, nontaxable_purchases => { title => 'Non-taxable Purchases' }, receipts => { title => 'Receipts', vc => 'customer' }, payments => { title => 'Payments' }, projects => { title => 'Project Transactions' }, reminder => { title => 'Reminder', vc => 'customer' }, ); $form->{title} = $locale->text($report{$form->{report}}->{title}); $form->{nextsub} = "generate_$form->{report}"; $gifi = qq| <tr> <th align=right>|.$locale->text('Accounts').qq|</th> <td><input name=accounttype class=radio type=radio value=standard checked> |.$locale->text('Standard').qq| <input name=accounttype class=radio type=radio value=gifi> |.$locale->text('GIFI').qq| </td> </tr> |; RP->create_links(\%myconfig, \%$form, $report{$form->{report}}->{vc}); # departments if (@{ $form->{all_department} }) { $form->{selectdepartment} = "<option>\n"; for (@{ $form->{all_department} }) { $form->{selectdepartment} .= qq|<option value="|.$form->quote($_->{description}).qq|--$_->{id}">$_->{description}\n| } } $department = qq| <tr> <th align=right nowrap>|.$locale->text('Department').qq|</th> <td colspan=3><select name=department>$form->{selectdepartment}</select></td> </tr> | if $form->{selectdepartment}; if (@{ $form->{all_years} }) { # accounting years $selectaccountingyear = "<option>\n"; for (@{ $form->{all_years} }) { $selectaccountingyear .= qq|<option>$_\n| } $selectaccountingmonth = "<option>\n"; for (sort keys %{ $form->{all_month} }) { $selectaccountingmonth .= qq|<option value=$_>|.$locale->text($form->{all_month}{$_}).qq|\n| } $selectfrom = qq| <tr> <th align=right>|.$locale->text('Period').qq|</th> <td colspan=3> <select name=month>$selectaccountingmonth</select> <select name=year>$selectaccountingyear</select> <input name=interval class=radio type=radio value=0 checked>&nbsp;|.$locale->text('Current').qq| <input name=interval class=radio type=radio value=1>&nbsp;|.$locale->text('Month').qq| <input name=interval class=radio type=radio value=3>&nbsp;|.$locale->text('Quarter').qq| <input name=interval class=radio type=radio value=12>&nbsp;|.$locale->text('Year').qq| </td> </tr> |; $selectto = qq| <tr> <th align=right></th> <td> <select name=month>$selectaccountingmonth</select> <select name=year>$selectaccountingyear</select> </td> </tr> |; } $summary = qq| <tr> <th></th> <td><input name=summary type=radio class=radio value=1 checked> |.$locale->text('Summary').qq| <input name=summary type=radio class=radio value=0> |.$locale->text('Detail').qq| </td> </tr> |; # projects if (@{ $form->{all_project} }) { $form->{selectproject} = "<option>\n"; for (@{ $form->{all_project} }) { $form->{selectproject} .= qq|<option value="|.$form->quote($_->{projectnumber}).qq|--$_->{id}">$_->{projectnumber}\n| } $project = qq| <tr> <th align=right nowrap>|.$locale->text('Project').qq|</th> <td colspan=3><select name=projectnumber>$form->{selectproject}</select></td> </tr>|; } if (@{ $form->{all_language} }) { $form->{selectlanguage} = "\n"; for (@{ $form->{all_language} }) { $form->{selectlanguage} .= qq|$_->{code}--$_->{description}\n| } $lang = qq| <tr> <th align=right nowrap>|.$locale->text('Language').qq|</th> <td colspan=3><select name=language_code>|.$form->select_option($form->{selectlanguage}, $myconfig{countrycode}, undef, 1).qq|</select></td> </tr>|; } $form->{decimalplaces} = $form->{precision}; $method{accrual} = "checked" if $form->{method} eq 'accrual'; $method{cash} = "checked" if $form->{method} eq 'cash'; if ($form->{report} eq 'balance_sheet' || $form->{report} eq 'income_statement') { $form->{currencies} = $form->get_currencies(undef, \%myconfig); if ($form->{currencies}) { @curr = split /:/, $form->{currencies}; $form->{defaultcurrency} = $curr[0]; for (@curr) { $form->{selectcurrency} .= "$_\n" } $curr = qq| <tr> <th align=right>|.$locale->text('Currency').qq|</th> <td><select name=currency>| .$form->select_option($form->{selectcurrency}, $form->{defaultcurrency}) .qq|</select></td> </tr>| .$form->hide_form(defaultcurrency); } } $method = qq| <tr> <th align=right>|.$locale->text('Method').qq|</th> <td colspan=3><input name=method class=radio type=radio value=accrual $method{accrual}>&nbsp;|.$locale->text('Accrual').qq| &nbsp;<input name=method class=radio type=radio value=cash $method{cash}>&nbsp;|.$locale->text('Cash').qq|</td> </tr> |; $form->header; print qq| <body> <form method=post action=$form->{script}> <table width=100%> <tr> <th class=listtop>$form->{title}</th> </tr> <tr height="5"></tr> <tr> <td> <table> $department |; if ($form->{report} eq "projects") { print qq| $project <tr> <th align=right>|.$locale->text('From').qq|</th> <td colspan=3><input name=fromdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)" value=$form->{fromdate}> <b>|.$locale->text('To').qq|</b> <input name=todate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> </tr> $selectfrom </table> </td> </tr> <tr> <td> <table> <tr> <th align=right nowrap>|.$locale->text('Include in Report').qq|</th> <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq| <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|</td> </tr> |; } if ($form->{report} eq "income_statement") { print qq| $project <tr> <th align=right>|.$locale->text('From').qq|</th> <td colspan=3><input name=fromdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)" value=$form->{fromdate}> <b>|.$locale->text('To').qq|</b> <input name=todate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> </tr> |; if ($selectfrom) { print qq| <tr> <th align=right>|.$locale->text('Period').qq|</th> <td colspan=3> <select name=frommonth>$selectaccountingmonth</select> <select name=fromyear>$selectaccountingyear</select> <input name=interval class=radio type=radio value=0 checked>&nbsp;|.$locale->text('Current').qq| <input name=interval class=radio type=radio value=1>&nbsp;|.$locale->text('Month').qq| <input name=interval class=radio type=radio value=3>&nbsp;|.$locale->text('Quarter').qq| <input name=interval class=radio type=radio value=12>&nbsp;|.$locale->text('Year').qq| </td> </tr> |; } print qq| <tr> <th align=right>|.$locale->text('Compare to').qq|</th> </tr> <tr> <th align=right>|.$locale->text('From').qq|</th> <td colspan=3><input name=comparefromdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"> <b>|.$locale->text('To').qq|</b> <input name=comparetodate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> </tr> |; if ($selectto) { print qq| <tr> <th align=right>|.$locale->text('Period').qq|</th> <td> <select name=comparemonth>$selectaccountingmonth</select> <select name=compareyear>$selectaccountingyear</select> </td> </tr> |; } print qq| $curr <tr> <th align=right>|.$locale->text('Decimalplaces').qq|</th> <td><input name=decimalplaces size=3 value=$form->{decimalplaces}></td> </tr> $lang </table> </td> </tr> <tr> <td> <table> $method <tr> <th align=right nowrap>|.$locale->text('Include in Report').qq|</th> <td colspan=3><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq| <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq| <input name=l_accno class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Account Number').qq|</td> </tr> |; } if ($form->{report} eq "balance_sheet") { print qq| <tr> <th align=right>|.$locale->text('as at').qq|</th> <td><input name=asofdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)" value=$form->{asofdate}></td> |; if ($selectfrom) { print qq| <td> <select name=asofmonth>$selectaccountingmonth</select> <select name=asofyear>$selectaccountingyear</select> </td> |; } print qq| </tr> <th align=right nowrap>|.$locale->text('Compare to').qq|</th> <td><input name=compareasofdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> <td> |; if ($selectto) { print qq| <select name=compareasofmonth>$selectaccountingmonth</select> <select name=compareasofyear>$selectaccountingyear</select> </td> |; } print qq| </tr> <tr> $curr <th align=right>|.$locale->text('Decimalplaces').qq|</th> <td><input name=decimalplaces size=3 value=$form->{precision}></td> </tr> $lang </table> </td> </tr> <tr> <td> <table> $method <tr> <th align=right nowrap>|.$locale->text('Include in Report').qq|</th> <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq| <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq| <input name=l_accno class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Account Number').qq|</td> </tr> |; } if ($form->{report} eq "trial_balance") { print qq| <tr> <th align=right>|.$locale->text('From').qq|</th> <td colspan=3><input name=fromdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)" value=$form->{fromdate}> <b>|.$locale->text('To').qq|</b> <input name=todate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> </tr> $selectfrom $lang </table> </td> </tr> <tr> <td> <table> <tr> <th align=right nowrap>|.$locale->text('Include in Report').qq|</th> <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq| <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq| <input name=all_accounts class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('All Accounts').qq|</td> </tr> |; } if ($form->{report} =~ /^tax_/) { $gifi = ""; $form->{db} = ($form->{report} =~ /_collected/) ? "ar" : "ap"; RP->get_taxaccounts(\%myconfig, \%$form); $form->{nextsub} = "generate_tax_report"; print qq| <tr> <th align=right>|.$locale->text('From').qq|</th> <td colspan=3><input name=fromdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)" value=$form->{fromdate}> <b>|.$locale->text('To').qq|</b> <input name=todate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> </tr> $selectfrom $summary <tr> <th align=right>|.$locale->text('Report for').qq|</th> <td colspan=3> |; $checked = "checked"; foreach $ref (@{ $form->{taxaccounts} }) { print qq|<input name=accno class=radio type=radio value="|.$form->quote($ref->{accno}).qq|" $checked>&nbsp;$ref->{description} <input name="$ref->{accno}_description" type=hidden value="|.$form->quote($ref->{description}).qq|">|; $checked = ""; } print qq| <input type=hidden name=db value=$form->{db}> <input type=hidden name=sort value=transdate> </td> </tr> |; if (@{ $form->{gifi_taxaccounts} }) { print qq| <tr> <th align=right>|.$locale->text('GIFI').qq|</th> <td colspan=3> |; foreach $ref (@{ $form->{gifi_taxaccounts} }) { print qq|<input name=accno class=radio type=radio value="|.$form->quote("gifi_$ref->{accno}").qq|">&nbsp;$ref->{description} <input name="gifi_$ref->{accno}_description" type=hidden value="|.$form->quote($ref->{description}).qq|">|; } print qq| </td> </tr> |; } if ($form->{db} eq 'ar') { $vc = qq| <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Customer').qq|</td> <td><input name="l_customernumber" class=checkbox type=checkbox value=Y></td> <td>|.$locale->text('Customer Number').qq|</td>|; } if ($form->{db} eq 'ap') { $vc = qq| <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Vendor').qq|</td> <td><input name="l_vendornumber" class=checkbox type=checkbox value=Y></td> <td>|.$locale->text('Vendor Number').qq|</td>|; } print qq| $method </table> </td> </tr> <tr> <td> <table> <tr> <th align=right>|.$locale->text('Include in Report').qq|</th> <td> <table> <tr> <td><input name="l_id" class=checkbox type=checkbox value=Y></td> <td>|.$locale->text('ID').qq|</td> <td><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Invoice').qq|</td> <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Date').qq|</td> <td><input name="l_description" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Description').qq|</td> </tr> <tr> $vc <td><input name="l_netamount" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Amount').qq|</td> <td><input name="l_tax" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Tax').qq|</td> </tr> <tr> <td><input name="l_subtotal" class=checkbox type=checkbox value=Y></td> <td>|.$locale->text('Subtotal').qq|</td> </tr> </table> </td> </tr> |; } if ($form->{report} =~ /^nontaxable_/) { $gifi = ""; $form->{db} = ($form->{report} =~ /_sales/) ? "ar" : "ap"; $form->{nextsub} = "generate_tax_report"; if ($form->{db} eq 'ar') { $vc = qq| <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Customer').qq|</td> <td><input name="l_customernumber" class=checkbox type=checkbox value=Y></td> <td>|.$locale->text('Customer Number').qq|</td>|; } if ($form->{db} eq 'ap') { $vc = qq| <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Vendor').qq|</td> <td><input name="l_vendornumber" class=checkbox type=checkbox value=Y></td> <td>|.$locale->text('Vendor Number').qq|</td>|; } print qq| <input type=hidden name=db value=$form->{db}> <input type=hidden name=sort value=transdate> <input type=hidden name=report value=$form->{report}> <tr> <th align=right>|.$locale->text('From').qq|</th> <td colspan=3><input name=fromdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)" value=$form->{fromdate}> <b>|.$locale->text('To').qq|</b> <input name=todate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> </tr> $selectfrom $summary $method <tr> <th align=right>|.$locale->text('Include in Report').qq|</th> <td colspan=3> <table> <tr> <td><input name="l_id" class=checkbox type=checkbox value=Y></td> <td>|.$locale->text('ID').qq|</td> <td><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Invoice').qq|</td> <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Date').qq|</td> <td><input name="l_description" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Description').qq|</td> </tr> <tr> $vc <td><input name="l_netamount" class=checkbox type=checkbox value=Y checked></td> <td>|.$locale->text('Amount').qq|</td> </tr> <tr> <td><input name="l_subtotal" class=checkbox type=checkbox value=Y></td> <td>|.$locale->text('Subtotal').qq|</td> </tr> </table> </td> </tr> |; } if (($form->{report} eq "ar_aging") || ($form->{report} eq "ap_aging")) { $gifi = ""; if ($form->{report} eq 'ar_aging') { $vclabel = $locale->text('Customer'); $vcnumber = $locale->text('Customer Number'); $form->{vc} = 'customer'; $form->{sort} = "customernumber" if $form->{namesbynumber}; } else { $vclabel = $locale->text('Vendor'); $vcnumber = $locale->text('Vendor Number'); $form->{vc} = 'vendor'; } $form->{sort} = ($form->{namesbynumber}) ? "$form->{vc}number" : "name"; $form->{type} = "statement"; $form->{format} ||= $myconfig{outputformat}; $form->{media} ||= $myconfig{printer}; # setup vc selection $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP", undef, undef, undef, 1); if (@{ $form->{"all_$form->{vc}"} }) { $vc = qq| <tr> <th align=right nowrap>$vclabel</th> <td colspan=2><select name=$form->{vc}><option>\n|; for (@{ $form->{"all_$form->{vc}"} }) { $vc .= qq|<option value="|.$form->quote($_->{name}).qq|--$_->{id}">$_->{name}\n| } $vc .= qq|</select> </td> </tr> |; } else { $vc = qq| <tr> <th align=right nowrap>$vclabel</th> <td colspan=2><input name=$form->{vc} size=35> </td> </tr> <tr> <th align=right nowrap>$vcnumber</th> <td colspan=3><input name="$form->{vc}number" size=35> </td> </tr> |; } print qq| $vc <tr> <th align=right>|.$locale->text('To').qq|</th> <td><input name=todate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> </tr> $selectto <input type=hidden name=action value="$form->{nextsub}"> $summary <tr> <table> <tr> <th>|.$locale->text('Include in Report').qq|</th> <td> <table> <tr> <td nowrap><input name=overdue type=radio class=radio value=0 checked> |.$locale->text('Aged').qq|</td> <td nowrap><input name=overdue type=radio class=radio value=1> |.$locale->text('Overdue').qq|</td> </tr> <tr> <td nowrap width=70><input name=c0 type=checkbox class=checkbox value=1 checked> |.$locale->text('Current').qq|</td> <td nowrap width=70><input name=c30 type=checkbox class=checkbox value=1 checked> 30</td> <td nowrap width=70><input name=c60 type=checkbox class=checkbox value=1 checked> 60</td> <td nowrap width=70><input name=c90 type=checkbox class=checkbox value=1 checked> 90</td> </tr> <tr> <td nowrap width=70><input name=c15 type=checkbox class=checkbox value=1> 15</td> <td nowrap width=70><input name=c45 type=checkbox class=checkbox value=1> 45</td> <td nowrap width=70><input name=c75 type=checkbox class=checkbox value=1> 75</td> </tr> </table> </td> </tr> </table> </tr> |; $form->hide_form(qw(nextsub type format media sort)); } if ($form->{report} eq 'reminder') { $gifi = ""; $vclabel = $locale->text('Customer'); $vcnumber = $locale->text('Customer Number'); $form->{vc} = 'customer'; $form->{sort} = "customernumber" if $form->{namesbynumber}; $form->{sort} = ($form->{namesbynumber}) ? "$form->{vc}number" : "name"; $form->{type} = "reminder"; $form->{format} ||= $myconfig{outputformat}; $form->{media} ||= $myconfig{printer}; # setup vc selection $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP", undef, undef, undef, 1); if (@{ $form->{"all_$form->{vc}"} }) { $vc = qq| <tr> <th align=right nowrap>$vclabel</th> <td colspan=2><select name=$form->{vc}><option>\n|; for (@{ $form->{"all_$form->{vc}"} }) { $vc .= qq|<option value="|.$form->quote($_->{name}).qq|--$_->{id}">$_->{name}\n| } $vc .= qq|</select> </td> </tr> |; } else { $vc = qq| <tr> <th align=right nowrap>$vclabel</th> <td colspan=2><input name=$form->{vc} size=35> </td> </tr> <tr> <th align=right nowrap>$vcnumber</th> <td colspan=3><input name="$form->{vc}number" size=35> </td> </tr> |; } print qq| $vc <input type=hidden name=action value="$form->{nextsub}"> |; $form->hide_form(qw(type format media sort)); } # above action can be removed if there is more than one input field if ($form->{report} =~ /(receipts|payments)$/) { $form->{nextsub} = "list_payments"; $gifi = ""; $form->{db} = ($form->{report} =~ /payments/) ? "ap" : "ar"; $form->{vc} = ($form->{db} eq 'ar') ? 'customer' : 'vendor'; RP->paymentaccounts(\%myconfig, \%$form); $selectpaymentaccount = "\n"; foreach $ref (@{ $form->{PR} }) { $form->{paymentaccounts} .= "$ref->{accno} "; $selectpaymentaccount .= qq|$ref->{accno}--$ref->{description}\n|; } chop $form->{paymentaccounts}; $form->hide_form(qw(paymentaccounts)); if ($form->{vc} eq 'customer') { $vclabel = $locale->text('Customer'); $vcnumber = $locale->text('Customer Number'); $form->all_vc(\%myconfig, $form->{vc}, "AR"); } else { $form->all_vc(\%myconfig, $form->{vc}, "AP"); $vclabel = $locale->text('Vendor'); $vcnumber = $locale->text('Vendor Number'); } # setup vc selection if ($@{ $form->{"all_$form->{vc}"} }) { $vc = qq| <tr> <th align=right nowrap>$vclabel</th> <td colspan=2><select name=$form->{vc}><option>\n|; for (@{ $form->{"all_$form->{vc}"} }) { $vc .= qq|<option value="|.$form->quote($_->{name}).qq|--$_->{id}">$_->{name}\n| } $vc .= qq|</select> </td> </tr> |; } else { $vc = qq| <tr> <th align=right nowrap>$vclabel</th> <td colspan=2><input name=$form->{vc} size=35> </td> </tr> <tr> <th align=right nowrap>$vcnumber</th> <td colspan=3><input name="$form->{vc}number" size=35> </td> </tr> |; } print qq| <tr> <th align=right nowrap>|.$locale->text('Account').qq|</th> <td colspan=3><select name=account>| .$form->select_option($selectpaymentaccount) .qq|</select> </td> </tr> $vc <tr> <th align=right nowrap>|.$locale->text('Description').qq|</th> <td colspan=3><input name=description size=35></td> </tr> <tr> <th align=right nowrap>|.$locale->text('Source').qq|</th> <td colspan=3><input name=source></td> </tr> <tr> <th align=right nowrap>|.$locale->text('Memo').qq|</th> <td colspan=3><input name=memo size=30></td> </tr> <tr> <th align=right>|.$locale->text('From').qq|</th> <td colspan=3><input name=fromdate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)" value=$form->{fromdate}> <b>|.$locale->text('To').qq|</b> <input name=todate size=11 class=date title="$myconfig{dateformat}" onChange="validateDate(this)"></td> </tr> $selectfrom <tr> <th align=right nowrap>|.$locale->text('Include in Report').qq|</th> <td> <table width=100%> <tr> <td align=right><input type=checkbox class=checkbox name=fx_transaction value=1 checked> |.$locale->text('Exchange Rate Difference').qq|</td> </tr> |; @a = (); push @a, qq|<input name="l_transdate" class=checkbox type=checkbox value=Y checked> |.$locale->text('Date'); push @a, qq|<input name="l_reference" class=checkbox type=checkbox value=Y checked> |.$locale->text('Reference'); push @a, qq|<input name="l_name" class=checkbox type=checkbox value=Y checked> |.$locale->text($vclabel); push @a, qq|<input name="l_$form->{vc}number" class=checkbox type=checkbox value=Y> |.$locale->text($vcnumber); push @a, qq|<input name="l_description" class=checkbox type=checkbox value=Y checked> |.$locale->text('Description'); push @a, qq|<input name="l_paid" class=checkbox type=checkbox value=Y checked> |.$locale->text('Amount'); push @a, qq|<input name="l_source" class=checkbox type=checkbox value=Y checked> |.$locale->text('Source'); push @a, qq|<input name="l_memo" class=checkbox type=checkbox value=Y checked> |.$locale->text('Memo'); while (@a) { print qq|<tr>\n|; for (1 .. 5) { print qq|<td nowrap>|. shift @a; print qq|</td>\n|; } print qq|</tr>\n|; } print qq| <tr> <td><input name=l_subtotal class=checkbox type=checkbox value=Y> |.$locale->text('Subtotal').qq|</td> </tr> </table> </td> </tr> |; $form->{sort} = 'transdate'; $form->hide_form(qw(vc db sort)); } print qq| $gifi </table> </td> </tr> <tr> <td><hr size=3 noshade></td> </tr> </table> <br> <input type=submit class=submit name=action value="|.$locale->text('Continue').qq|"> |; $form->hide_form(qw(title nextsub path login)); print qq| </form> |; if ($form->{menubar}) { require "$form->{path}/menu.pl"; &menubar; } print qq| </body> </html> |; } sub continue { &{$form->{nextsub}} }; sub generate_income_statement { $form->{padding} = "&nbsp;&nbsp;"; $form->{bold} = "<strong>"; $form->{endbold} = "</strong>"; $form->{br} = "<br>"; RP->income_statement(\%myconfig, \%$form); ($form->{department}) = split /--/, $form->{department}; ($form->{projectnumber}) = split /--/, $form->{projectnumber}; $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1); $form->{todate} = $form->current_date(\%myconfig) unless $form->{todate}; # if there are any dates construct a where if ($form->{fromdate} || $form->{todate}) { unless ($form->{todate}) { $form->{todate} = $form->current_date(\%myconfig); } $longtodate = $locale->date(\%myconfig, $form->{todate}, 1); $shorttodate = $locale->date(\%myconfig, $form->{todate}, 0); $longfromdate = $locale->date(\%myconfig, $form->{fromdate}, 1); $shortfromdate = $locale->date(\%myconfig, $form->{fromdate}, 0); $form->{this_period} = "$shortfromdate<br>\n$shorttodate"; $form->{period} = $locale->text('for Period').qq|<br>\n$longfromdate |.$locale->text('To').qq| $longtodate|; } if ($form->{comparefromdate} || $form->{comparetodate}) { $longcomparefromdate = $locale->date(\%myconfig, $form->{comparefromdate}, 1); $shortcomparefromdate = $locale->date(\%myconfig, $form->{comparefromdate}, 0); $longcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 1); $shortcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 0); $form->{last_period} = "$shortcomparefromdate<br>\n$shortcomparetodate"; $form->{period} .= "<br>\n$longcomparefromdate ".$locale->text('To').qq| $longcomparetodate|; } # setup variables for the form $form->format_string(qw(company address businessnumber)); $form->{address} =~ s/\n/<br>/g; $form->{templates} = $myconfig{templates}; $form->{IN} = "income_statement.html"; $form->parse_template; } sub generate_balance_sheet { $form->{padding} = "&nbsp;&nbsp;"; $form->{bold} = "<b>"; $form->{endbold} = "</b>"; $form->{br} = "<br>"; RP->balance_sheet(\%myconfig, \%$form); $form->{asofdate} = $form->current_date(\%myconfig) unless $form->{asofdate}; $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1); ($form->{department}) = split /--/, $form->{department}; # define Current Earnings account $padding = ($form->{l_heading}) ? $form->{padding} : ""; push(@{$form->{equity_account}}, $padding.$locale->text('Current Earnings')); $form->{this_period} = $locale->date(\%myconfig, $form->{asofdate}, 0); $form->{last_period} = $locale->date(\%myconfig, $form->{compareasofdate}, 0); $form->{IN} = "balance_sheet.html"; # setup company variables for the form $form->format_string(qw(company address businessnumber)); $form->{address} =~ s/\n/<br>/g; $form->{templates} = $myconfig{templates}; $form->parse_template; } sub generate_projects { $form->{nextsub} = "generate_projects"; $form->{title} = $locale->text('Project Transactions'); RP->trial_balance(\%myconfig, \%$form); &list_accounts; } # Antonio Gallardo # # D.S. Feb 16, 2001 # included links to display transactions for period entered # added headers and subtotals # sub generate_trial_balance { # get for each account initial balance, debits and credits RP->trial_balance(\%myconfig, \%$form); $form->{nextsub} = "generate_trial_balance"; $form->{title} = $locale->text('Trial Balance') . " / $form->{company}"; $form->{callback} = "$form->{script}?action=generate_trial_balance"; for (qw(login path nextsub fromdate todate month year interval l_heading l_subtotal all_accounts accounttype)) { $form->{callback} .= "&$_=$form->{$_}" } for (qw(department title)) { $form->{callback} .= "&$_=".$form->escape($form->{$_},1) } $form->{callback} = $form->escape($form->{callback}); &list_accounts; } sub list_accounts { $title = $form->escape($form->{title}); if ($form->{department}) { ($department) = split /--/, $form->{department}; $options = $locale->text('Department')." : $department<br>"; $department = $form->escape($form->{department}); } if ($form->{projectnumber}) { ($projectnumber) = split /--/, $form->{projectnumber}; $options .= $locale->text('Project Number')." : $projectnumber<br>"; $projectnumber = $form->escape($form->{projectnumber}); } # if there are any dates if ($form->{fromdate} || $form->{todate}) { if ($form->{fromdate}) { $fromdate = $locale->date(\%myconfig, $form->{fromdate}, 1); } if ($form->{todate}) { $todate = $locale->date(\%myconfig, $form->{todate}, 1); } $form->{period} = "$fromdate - $todate"; } else { $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1); } $options .= $form->{period}; @column_index = qw(accno description begbalance debit credit endbalance); $column_header{accno} = qq|<th class=listheading width=10%>|.$locale->text('Account').qq|</th>|; $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</th>|; $column_header{debit} = qq|<th class=listheading width=10%>|.$locale->text('Debit').qq|</th>|; $column_header{credit} = qq|<th class=listheading width=10%>|.$locale->text('Credit').qq|</th>|; $column_header{begbalance} = qq|<th class=listheading width=10%>|.$locale->text('Beginning Balance').qq|</th>|; $column_header{endbalance} = qq|<th class=listheading width=10%>|.$locale->text('Ending Balance').qq|</th>|; if ($form->{accounttype} eq 'gifi') { $column_header{accno} = qq|<th class=listheading>|.$locale->text('GIFI').qq|</th>|; } $form->header; print qq| <body> <table width=100%> <tr> <th class=listtop>$form->{title}</th> </tr> <tr height="5"></tr> <tr> <td>$options</td> </tr> <tr> <td> <table width=100%> <tr>|; for (@column_index) { print "$column_header{$_}\n" } print qq| </tr> |; # sort the whole thing by account numbers and display foreach $ref (sort { $a->{accno} cmp $b->{accno} } @{ $form->{TB} }) { $description = $form->escape($ref->{description}); $href = qq|ca.pl?path=$form->{path}&action=list_transactions&accounttype=$form->{accounttype}&login=$form->{login}&fromdate=$form->{fromdate}&todate=$form->{todate}&sort=transdate&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&department=$department&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}&prevreport=$form->{callback}|; if ($form->{accounttype} eq 'gifi') { $href .= "&gifi_accno=$ref->{accno}&gifi_description=$description"; $na = $locale->text('N/A'); if (!$ref->{accno}) { for (qw(accno description)) { $ref->{$_} = $na } } } else { $href .= "&accno=$ref->{accno}&description=$description"; } $ml = ($ref->{category} =~ /(A|E)/) ? -1 : 1; $ml *= -1 if $ref->{contra}; $debit = $form->format_amount(\%myconfig, $ref->{debit}, $form->{precision}, "&nbsp;"); $credit = $form->format_amount(\%myconfig, $ref->{credit}, $form->{precision}, "&nbsp;"); $begbalance = $form->format_amount(\%myconfig, $ref->{balance} * $ml, $form->{precision}, "&nbsp;"); $endbalance = $form->format_amount(\%myconfig, ($ref->{balance} + $ref->{amount}) * $ml, $form->{precision}, "&nbsp;"); if ($ref->{charttype} eq "H" && $subtotal && $form->{l_subtotal}) { if ($subtotal) { for (qw(accno begbalance endbalance)) { $column_data{$_} = "<th>&nbsp;</th>" } $subtotalbegbalance = $form->format_amount(\%myconfig, $subtotalbegbalance, $form->{precision}, "&nbsp;"); $subtotalendbalance = $form->format_amount(\%myconfig, $subtotalendbalance, $form->{precision}, "&nbsp;"); $subtotaldebit = $form->format_amount(\%myconfig, $subtotaldebit, $form->{precision}, "&nbsp;"); $subtotalcredit = $form->format_amount(\%myconfig, $subtotalcredit, $form->{precision}, "&nbsp;"); $column_data{description} = "<th class=listsubtotal>$subtotaldescription</th>"; $column_data{begbalance} = "<th align=right class=listsubtotal>$subtotalbegbalance</th>"; $column_data{endbalance} = "<th align=right class=listsubtotal>$subtotalendbalance</th>"; $column_data{debit} = "<th align=right class=listsubtotal>$subtotaldebit</th>"; $column_data{credit} = "<th align=right class=listsubtotal>$subtotalcredit</th>"; print qq| <tr class=listsubtotal> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; } } if ($ref->{charttype} eq "H") { $subtotal = 1; $subtotaldescription = $ref->{description}; $subtotaldebit = $ref->{debit}; $subtotalcredit = $ref->{credit}; $subtotalbegbalance = 0; $subtotalendbalance = 0; if ($form->{l_heading}) { if (! $form->{all_accounts}) { if (($subtotaldebit + $subtotalcredit) == 0) { $subtotal = 0; next; } } } else { $subtotal = 0; if ($form->{all_accounts} || ($form->{l_subtotal} && (($subtotaldebit + $subtotalcredit) != 0))) { $subtotal = 1; } next; } for (qw(accno debit credit begbalance endbalance)) { $column_data{$_} = "<th>&nbsp;</th>" } $column_data{description} = "<th class=listheading>$ref->{description}</th>"; } if ($ref->{charttype} eq "A") { $column_data{accno} = "<td><a href=$href>$ref->{accno}</a></td>"; $column_data{description} = "<td>$ref->{description}</td>"; $column_data{debit} = "<td align=right>$debit</td>"; $column_data{credit} = "<td align=right>$credit</td>"; $column_data{begbalance} = "<td align=right>$begbalance</td>"; $column_data{endbalance} = "<td align=right>$endbalance</td>"; $totaldebit += $ref->{debit}; $totalcredit += $ref->{credit}; $cml = ($ref->{contra}) ? -1 : 1; $subtotalbegbalance += $ref->{balance} * $ml * $cml; $subtotalendbalance += ($ref->{balance} + $ref->{amount}) * $ml * $cml; } if ($ref->{charttype} eq "H") { print qq| <tr class=listheading> |; } if ($ref->{charttype} eq "A") { $i++; $i %= 2; print qq| <tr class=listrow$i> |; } for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; } # print last subtotal if ($subtotal && $form->{l_subtotal}) { for (qw(accno begbalance endbalance)) { $column_data{$_} = "<th>&nbsp;</th>" } $subtotalbegbalance = $form->format_amount(\%myconfig, $subtotalbegbalance, $form->{precision}, "&nbsp;"); $subtotalendbalance = $form->format_amount(\%myconfig, $subtotalendbalance, $form->{precision}, "&nbsp;"); $subtotaldebit = $form->format_amount(\%myconfig, $subtotaldebit, $form->{precision}, "&nbsp;"); $subtotalcredit = $form->format_amount(\%myconfig, $subtotalcredit, $form->{precision}, "&nbsp;"); $column_data{description} = "<th class=listsubtotal>$subtotaldescription</th>"; $column_data{begbalance} = "<th align=right class=listsubtotal>$subtotalbegbalance</th>"; $column_data{endbalance} = "<th align=right class=listsubtotal>$subtotalendbalance</th>"; $column_data{debit} = "<th align=right class=listsubtotal>$subtotaldebit</th>"; $column_data{credit} = "<th align=right class=listsubtotal>$subtotalcredit</th>"; print qq| <tr class=listsubtotal> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; } $totaldebit = $form->format_amount(\%myconfig, $totaldebit, $form->{precision}, "&nbsp;"); $totalcredit = $form->format_amount(\%myconfig, $totalcredit, $form->{precision}, "&nbsp;"); for (qw(accno description begbalance endbalance)) { $column_data{$_} = "<th>&nbsp;</th>" } $column_data{debit} = qq|<th align=right class=listtotal>$totaldebit</th>|; $column_data{credit} = qq|<th align=right class=listtotal>$totalcredit</th>|; print qq| <tr class=listtotal> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> </table> </td> </tr> <tr> <td><hr size=3 noshade></td> </tr> </table> </body> </html> |; } sub generate_ar_aging { # split customer ($form->{customer}) = split(/--/, $form->{customer}); $customer = $form->escape($form->{customer},1); $title = $form->escape($form->{title},1); $media = $form->escape($form->{media},1); $form->{vc} = "customer"; $form->{arap} = "ar"; RP->aging(\%myconfig, \%$form); $form->{callback} = qq|$form->{script}?path=$form->{path}&action=generate_ar_aging&login=$form->{login}&todate=$form->{todate}&customer=$customer&title=$title&type=$form->{type}&format=$form->{format}&media=$media&summary=$form->{summary}|; &aging; } sub generate_ap_aging { # split vendor ($form->{vendor}) = split(/--/, $form->{vendor}); $vendor = $form->escape($form->{vendor},1); $title = $form->escape($form->{title},1); $media = $form->escape($form->{media},1); $form->{vc} = "vendor"; $form->{arap} = "ap"; RP->aging(\%myconfig, \%$form); $form->{callback} = qq|$form->{script}?path=$form->{path}&action=generate_ap_aging&login=$form->{login}&todate=$form->{todate}&vendor=$vendor&title=$title&type=$form->{type}&format=$form->{format}&media=$media&summary=$form->{summary}|; &aging; } sub aging { $form->header; $vcnumber = ($form->{vc} eq 'customer') ? $locale->text('Customer Number') : $locale->text('Vendor Number'); $form->{allbox} = ($form->{allbox}) ? "checked" : ""; $action = ($form->{deselect}) ? "deselect_all" : "select_all"; $column_header{statement} = qq|<th class=listheading width=1%><input name="allbox" type=checkbox class=checkbox value="1" $form->{allbox} onChange="CheckAll(); javascript:document.forms[0].submit()"><input type=hidden name=action value="$action"></th>|; $column_header{vc} = qq|<th class=listheading width=60%>|.$locale->text(ucfirst $form->{vc}).qq|</th>|; $column_header{"$form->{vc}number"} = qq|<th class=listheading>$vcnumber</th>|; $column_header{language} = qq|<th class=listheading>|.$locale->text('Language').qq|</th>|; $column_header{invnumber} = qq|<th class=listheading>|.$locale->text('Invoice').qq|</th>|; $column_header{ordnumber} = qq|<th class=listheading>|.$locale->text('Order').qq|</th>|; $column_header{transdate} = qq|<th class=listheading nowrap>|.$locale->text('Date').qq|</th>|; $column_header{duedate} = qq|<th class=listheading nowrap>|.$locale->text('Due Date').qq|</th>|; $column_header{c0} = qq|<th class=listheading width=10% nowrap>|.$locale->text('Current').qq|</th>|; $column_header{c15} = qq|<th class=listheading width=10% nowrap>15</th>|; $column_header{c30} = qq|<th class=listheading width=10% nowrap>30</th>|; $column_header{c45} = qq|<th class=listheading width=10% nowrap>45</th>|; $column_header{c60} = qq|<th class=listheading width=10% nowrap>60</th>|; $column_header{c75} = qq|<th class=listheading width=10% nowrap>75</th>|; $column_header{c90} = qq|<th class=listheading width=10% nowrap>90</th>|; $column_header{total} = qq|<th class=listheading width=10% nowrap>|.$locale->text('Total').qq|</th>|; @column_index = qw(statement vc); push @column_index, "$form->{vc}number"; if (@{ $form->{all_language} } && $form->{arap} eq 'ar') { push @column_index, "language"; $form->{selectlanguage} = qq|\n|; for (@{ $form->{all_language} }) { $form->{selectlanguage} .= qq|$_->{code}--$_->{description}\n| } } if (!$form->{summary}) { push @column_index, qw(invnumber ordnumber transdate duedate); } @c = qw(c0 c15 c30 c45 c60 c75 c90); for (@c) { if ($form->{$_}) { push @column_index, $_; $form->{callback} .= "&$_=$form->{$_}"; } } push @column_index, "total"; $option = $locale->text('Aged'); if ($form->{overdue}) { $option= $locale->text('Aged Overdue'); $form->{callback} .= "&overdue=$form->{overdue}"; } if ($form->{department}) { $option .= "\n<br>" if $option; ($department) = split /--/, $form->{department}; $option .= $locale->text('Department')." : $department"; $department = $form->escape($form->{department},1); $form->{callback} .= "&department=$department"; } if ($form->{arap} eq 'ar') { if ($form->{customer}) { $option .= "\n<br>" if $option; $option .= $form->{customer}; } } if ($form->{arap} eq 'ap') { shift @column_index; if ($form->{vendor}) { $option .= "\n<br>" if $option; $option .= $form->{vendor}; } } $todate = $locale->date(\%myconfig, $form->{todate}, 1); $option .= "\n<br>" if $option; $option .= $locale->text('for Period')." ".$locale->text('To')." $todate"; $title = "$form->{title} / $form->{company}"; print qq| <script language="JavaScript"> <!-- function CheckAll() { var frm = document.forms[0] var el = frm.elements var re = /statement_/; for (i = 0; i < el.length; i++) { if (el[i].type == 'checkbox' && re.test(el[i].name)) { el[i].checked = frm.allbox.checked } } } // --> </script> <body> <form method=post action=$form->{script}> <table width=100%> <tr> <th class=listtop>$title</th> </tr> <tr height="5"></tr> <tr> <td>$option</td> </tr> <tr> <td> <table width=100%> |; $vc_id = 0; $i = 0; $k = 0; $l = $#{ $form->{AG} }; foreach $ref (@{ $form->{AG} }) { if ($curr ne $ref->{curr}) { $vc_id = 0; for (@column_index) { $column_data{$_} = qq|<th>&nbsp;</th>| } if ($curr) { for (@c) { $column_data{$_} = qq|<th align=right>|.$form->format_amount(\%myconfig, $c{$_}{total}, $form->{precision}, "&nbsp").qq|</th>|; $c{$_}{total} = 0; $c{$_}{subtotal} = 0; } $column_data{total} = qq|<th align=right>|.$form->format_amount(\%myconfig, $total, $form->{precision}, "&nbsp").qq|</th>|; for (qw(vc statement language)) { $column_data{$_} = qq|<td>&nbsp;</td>| } print qq| <tr class=listtotal> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; $total = 0; } print qq| <tr> <td></td> <th>$ref->{curr}</th> </tr> <tr class=listheading> |; for (@column_index) { print "$column_header{$_}\n" } print qq| </tr> |; } $curr = $ref->{curr}; $k++; if ($vc_id != $ref->{vc_id}) { $i++; $column_data{vc} = qq|<td><a href=ct.pl?path=$form->{path}&login=$form->{login}&action=edit&id=$ref->{vc_id}&db=$form->{vc}&callback=$callback>$ref->{name}</a></td>|; $column_data{"$form->{vc}number"} = qq|<td>$ref->{"$form->{vc}number"}</td>|; if ($form->{selectlanguage}) { $column_data{language} = qq|<td><select name="language_code_$i">|.$form->select_option($form->{selectlanguage}, $form->{"language_code_$i"}, undef, 1).qq|</select></td>|; } $column_data{statement} = qq|<td><input name="statement_$i" type=checkbox class=checkbox value=1 $ref->{checked}> <input type=hidden name="$form->{vc}_id_$i" value=$ref->{vc_id}> <input type=hidden name="curr_$i" value="|.$form->quote($ref->{curr}).qq|"> </td>|; $linetotal = 0; } $vc_id = $ref->{vc_id}; for (@c) { $ref->{$_} = $form->round_amount($ref->{$_} / $ref->{exchangerate}, $form->{precision}); $c{$_}{total} += $ref->{$_}; $c{$_}{subtotal} += $ref->{$_}; $linetotal += $ref->{$_}; $total += $ref->{$_}; $column_data{$_} = qq|<td align=right>|.$form->format_amount(\%myconfig, $ref->{$_}, $form->{precision}, "&nbsp;").qq|</td>|; } $column_data{total} = qq|<td align=right>|.$form->format_amount(\%myconfig, $linetotal, $form->{precision}, "&nbsp;").qq|</td>|; $href = qq|$ref->{module}.pl?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&callback=|.$form->escape($form->{callback}); $column_data{invnumber} = qq|<td><a href=$href>$ref->{invnumber}</a></td>|; $column_data{ordnumber} = qq|<td>$ref->{ordnumber}</td>|; for (qw(transdate duedate)) { $column_data{$_} = qq|<td nowrap>$ref->{$_}</td>| } if (!$form->{summary}) { $j++; $j %= 2; print qq| <tr class=listrow$j> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; for (qw(vc statement language)) { $column_data{$_} = qq|<td>&nbsp;</td>| } } # print subtotal if ($l > 0) { if ($k <= $l) { $nextid = $form->{AG}->[$k]->{vc_id}; $nextcurr = $form->{AG}->[$k]->{curr}; } else { $nextid = 0; $nextcurr = ""; } } if ($vc_id != $nextid || $curr ne $nextcurr) { for (@c) { $c{$_}{subtotal} = $form->format_amount(\%myconfig, $c{$_}{subtotal}, $form->{precision}, "&nbsp"); } if ($form->{summary}) { for (@c) { $column_data{$_} = qq|<td align=right>$c{$_}{subtotal}</th>|; $c{$_}{subtotal} = 0; } $j++; $j %= 2; print qq| <tr class=listrow$j> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; } else { for (@column_index) { $column_data{$_} = qq|<th>&nbsp;</th>| } for (@c) { $column_data{$_} = qq|<th class=listsubtotal align=right>$c{$_}{subtotal}</th>|; $c{$_}{subtotal} = 0; } # print subtotals print qq| <tr class=listsubtotal> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; } } } print qq| </tr> <tr class=listtotal> |; for (@column_index) { $column_data{$_} = qq|<th>&nbsp;</th>| } for (@c) { $column_data{$_} = qq|<th align=right class=listtotal>|.$form->format_amount(\%myconfig, $c{$_}{total}, $form->{precision}, "&nbsp;").qq|</th>|; } $column_data{total} = qq|<th align=right class=listtotal>|.$form->format_amount(\%myconfig, $total, $form->{precision}, "&nbsp;").qq|</th>|; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> <input type=hidden name=rowcount value=$i> </table> </td> </tr> <tr> <td> |; &print_options if ($form->{arap} eq 'ar'); print qq| </td> </tr> <tr> <td><hr size=3 noshade></td> </tr> </table> |; if ($form->{arap} eq 'ar') { $form->hide_form(qw(todate title summary overdue callback arap vc department path login type report)); $form->hide_form(@c, "$form->{vc}"); %button = ('Select all' => { ndx => 1, key => 'A', value => $locale->text('Select all') }, 'Deselect all' => { ndx => 2, key => 'A', value => $locale->text('Deselect all') }, 'Print' => { ndx => 3, key => 'P', value => $locale->text('Print') }, 'E-mail' => { ndx => 5, key => 'E', value => $locale->text('E-mail') }, ); if ($form->{deselect}) { delete $button{'Select all'}; } else { delete $button{'Deselect all'}; } for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) } } if ($form->{menubar}) { require "$form->{path}/menu.pl"; &menubar; } print qq| </form> </body> </html> |; } sub select_all { &{ "select_all_$form->{type}" } } sub select_all_statement { RP->aging(\%myconfig, \%$form); for (@{ $form->{AG} }) { $_->{checked} = "checked" } $form->{allbox} = "checked"; $form->{deselect} = 1; &aging; } sub select_all_reminder { RP->reminder(\%myconfig, \%$form); for (@{ $form->{AG} }) { $form->{"ndx_$_->{id}"} = "checked" } $form->{allbox} = "checked"; $form->{deselect} = 1; &reminder; } sub deselect_all { &{ "deselect_all_$form->{type}" } } sub deselect_all_statement { RP->aging(\%myconfig, \%$form); for (@{ $form->{AG} }) { $_->{checked} = "" } $form->{allbox} = ""; &aging; } sub deselect_all_reminder { RP->reminder(\%myconfig, \%$form); for (@{ $form->{AG} }) { $_->{checked} = "" } $form->{allbox} = ""; &reminder; } sub generate_reminder { # split customer ($form->{customer}) = split(/--/, $form->{customer}); $form->{vc} = "customer"; $form->{arap} = "ar"; $form->{initcallback} = qq|$form->{script}?action=generate_reminder|; RP->reminder(\%myconfig, \%$form); &reminder; } sub reminder { $form->{callback} = $form->{initcallback}; for (qw(path login type format)) { $form->{callback} .= "&$_=$form->{$_}" } for (qw(title media report)) { $form->{callback} .= qq|&$_=|.$form->escape($form->{$_},1) } $form->{callback} .= qq|&$form->{vc}=|.$form->escape($form->{"$form->{vc}"},1); $vcnumber = $locale->text('Customer Number'); $form->{allbox} = ($form->{allbox}) ? "checked" : ""; $action = ($form->{deselect}) ? "deselect_all" : "select_all"; $column_header{ndx} = qq|<th class=listheading width=1%><input name="allbox" type=checkbox class=checkbox value="1" $form->{allbox} onChange="CheckAll(); javascript:document.forms[0].submit()"><input type=hidden name=action value="$action"></th>|; $column_header{vc} = qq|<th class=listheading width=60%>|.$locale->text(ucfirst $form->{vc}).qq|</th>|; $column_header{"$form->{vc}number"} = qq|<th class=listheading>$vcnumber</th>|; $column_header{level} = qq|<th class=listheading>|.$locale->text('Level').qq|</th>|; $column_header{language} = qq|<th class=listheading>|.$locale->text('Language').qq|</th>|; $column_header{invnumber} = qq|<th class=listheading>|.$locale->text('Invoice').qq|</th>|; $column_header{ordnumber} = qq|<th class=listheading>|.$locale->text('Order').qq|</th>|; $column_header{transdate} = qq|<th class=listheading nowrap>|.$locale->text('Date').qq|</th>|; $column_header{duedate} = qq|<th class=listheading nowrap>|.$locale->text('Due Date').qq|</th>|; $column_header{due} = qq|<th class=listheading nowrap>|.$locale->text('Due').qq|</th>|; @column_index = qw(ndx vc); push @column_index, "$form->{vc}number"; push @column_index, "level"; $form->{selectlevel} = "\n1\n2\n3"; if (@{ $form->{all_language} }) { push @column_index, "language"; $form->{selectlanguage} = qq|\n|; $form->{language_code} ||= ""; for (@{ $form->{all_language} }) { $form->{selectlanguage} .= qq|$_->{code}--$_->{description}\n| } } push @column_index, qw(invnumber ordnumber transdate duedate due); if ($form->{department}) { $option .= "\n<br>" if $option; ($department) = split /--/, $form->{department}; $option .= $locale->text('Department')." : $department"; $department = $form->escape($form->{department},1); $form->{callback} .= "&department=$department"; } if ($form->{customer}) { $option .= "\n<br>" if $option; $option .= $form->{customer}; } $title = "$form->{title} / $form->{company}"; $form->header; print qq| <script language="JavaScript"> <!-- function CheckAll() { var frm = document.forms[0] var el = frm.elements var re = /statement_/; for (i = 0; i < el.length; i++) { if (el[i].type == 'checkbox' && re.test(el[i].name)) { el[i].checked = frm.allbox.checked } } } // --> </script> <body> <form method=post action=$form->{script}> <table width=100%> <tr> <th class=listtop>$title</th> </tr> <tr height="5"></tr> <tr> <td>$option</td> </tr> <tr> <td> <table width=100%> |; $curr = ""; $form->{ids} = ""; $callback = $form->escape($form->{callback},1); for $ref (@{ $form->{AG} }) { if ($curr ne $ref->{curr}) { for (@column_index) { $column_data{$_} = qq|<th>&nbsp;</th>| } if ($curr) { print qq| <tr class=listtotal> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; } print qq| <tr> <td></td> <th>$ref->{curr}</th> </tr> <tr class=listheading> |; for (@column_index) { print "$column_header{$_}\n" } print qq| </tr> |; } $curr = $ref->{curr}; $column_data{vc} = qq|<td><a href=ct.pl?path=$form->{path}&login=$form->{login}&action=edit&id=$ref->{vc_id}&db=$form->{vc}&callback=$callback>$ref->{name}</a></td> <input type=hidden name="vc_$ref->{id}" value="$ref->{vc_id}">|; $column_data{"$form->{vc}number"} = qq|<td>$ref->{"$form->{vc}number"}</td>|; if (exists $form->{"level_$ref->{id}"}) { $ref->{level} = $form->{"level_$ref->{id}"}; } $column_data{level} = qq|<td><select name="level_$ref->{id}">|.$form->select_option($form->{selectlevel}, $ref->{level}).qq|</select></td>|; if ($form->{selectlanguage}) { if (exists $form->{"language_code_$ref->{id}"}) { $ref->{language_code} = $form->{"language_code_$ref->{id}"}; } $column_data{language} = qq|<td><select name="language_code_$ref->{id}">|.$form->select_option($form->{selectlanguage}, $ref->{language_code}, undef, 1).qq|</select></td>|; } $checked = ($form->{"ndx_$ref->{id}"}) ? "checked" : ""; $column_data{ndx} = qq|<td><input name="ndx_$ref->{id}" type=checkbox class=checkbox value=1 $checked></td>|; $form->{ids} .= "$ref->{id} "; $href = qq|$ref->{module}.pl?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&callback=|.$form->escape($form->{callback}); $column_data{invnumber} = qq|<td><a href=$href>$ref->{invnumber}</a></td>|; $column_data{ordnumber} = qq|<td>$ref->{ordnumber}</td>|; for (qw(transdate duedate)) { $column_data{$_} = qq|<td nowrap>$ref->{$_}</td>| } $column_data{due} = qq|<td align=right>|.$form->format_amount(\%myconfig, $ref->{due} / $ref->{exchangerate}, $form->{precision}).qq|</td>|; $j++; $j %= 2; print qq| <tr class=listrow$j> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; for (qw(vc ndx language level)) { $column_data{$_} = qq|<td>&nbsp;</td>| } $column_data{"$form->{vc}number"} = qq|<td>&nbsp;</td>|; } print qq| </tr> <tr class=listtotal> |; for (@column_index) { $column_data{$_} = qq|<th>&nbsp;</th>| } for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> </table> </td> </tr> <tr> <td> |; &print_options; print qq| </td> </tr> <tr> <td><hr size=3 noshade></td> </tr> </table> |; chop $form->{ids}; $form->hide_form(qw(title initcallback callback vc department path login ids)); $form->hide_form($form->{vc}); $form->hide_form(qw(type report)); %button = ('Select all' => { ndx => 1, key => 'A', value => $locale->text('Select all') }, 'Deselect all' => { ndx => 2, key => 'A', value => $locale->text('Deselect all') }, 'Preview' => { ndx => 3, key => 'V', value => $locale->text('Preview') }, 'Print' => { ndx => 4, key => 'P', value => $locale->text('Print') }, 'E-mail' => { ndx => 5, key => 'E', value => $locale->text('E-mail') }, 'Save Level' => { ndx => 6, key => 'L', value => $locale->text('Save Level') }, ); if ($form->{deselect}) { delete $button{'Select all'}; } else { delete $button{'Deselect all'}; } for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) } if ($form->{menubar}) { require "$form->{path}/menu.pl"; &menubar; } print qq| </form> </body> </html> |; } sub save_level { if (RP->save_level(\%myconfig, \%$form)) { $form->redirect; } $form->error($locale->text('Could not save reminder level!')); } sub print_options { $form->{copies} ||= 1; $form->{PD}{$form->{type}} = "selected"; if ($myconfig{printer}) { $form->{format} ||= "postscript"; } else { $form->{format} ||= "pdf"; } $form->{media} ||= $myconfig{printer}; $form->{sendmode} = "attachment"; $form->{format} = "pdf" if ($latex && $form->{media} eq 'email'); if ($form->{media} eq 'email') { $media = qq|<select name=sendmode> <option value=attachment>|.$locale->text('Attachment').qq| <option value=inline>|.$locale->text('In-line') .qq|</select>|; if ($form->{selectlanguage}) { $lang = qq|<select name="language_code_1">|.$form->select_option($form->{selectlanguage}, $form->{language_code_1}, undef, 1).qq|</select>|; } } else { $media = qq|<select name=media> <option value=screen>|.$locale->text('Screen'); if (%printer && $latex) { for (sort keys %printer) { $media .= qq| <option value="$_">$_| } } } $format = qq|<select name=format> <option value="html">html|; $formname{statement} = $locale->text('Statement'); $formname{reminder} = $locale->text('Reminder'); $type = qq|<select name=type> <option value="$form->{type}" $form->{PD}{$form->{type}}>$formname{$form->{type}} </select>|; $media .= qq|</select>|; $media =~ s/(<option value="\Q$form->{media}\E")/$1 selected/; if ($latex) { $format .= qq| <option value="postscript">|.$locale->text('Postscript').qq| <option value="pdf">|.$locale->text('PDF'); } $format .= qq|</select>|; $format =~ s/(<option value="\Q$form->{format}\E")/$1 selected/; print qq| <table> <tr> <td>$type</td> <td>$lang</td> <td>$format</td> <td>$media</td> |; if (%printer && $latex && $form->{media} ne 'email') { print qq| <td nowrap>|.$locale->text('Copies').qq| <input name=copies size=2 value=$form->{copies}></td> |; } $form->{selectlanguage} = $form->escape($form->{selectlanguage},1); $form->hide_form(qw(selectlanguage)); print qq| </tr> </table> |; } sub e_mail { # get name and email addresses for $i (1 .. $form->{rowcount}) { if ($form->{"statement_$i"}) { $form->{"$form->{vc}_id"} = $form->{"$form->{vc}_id_$i"}; $form->{"statement_1"} = 1; $form->{"language_code_1"} = $form->{"language_code_$i"}; $form->{"curr_1"} = $form->{"curr_$i"}; RP->get_customer(\%myconfig, \%$form); $selected = 1; last; } } $form->error($locale->text('Nothing selected!')) unless $selected; if ($myconfig{role} =~ /(admin|manager)/) { $bcc = qq| <th align=right nowrap=true>|.$locale->text('Bcc').qq|</th> <td><input name=bcc size=30 value="$form->{bcc}"></td> |; } $title = $locale->text('E-mail Statement to')." $form->{$form->{vc}}"; $form->{media} = "email"; $form->header; print qq| <body> <form method=post action=$form->{script}> <table width=100%> <tr class=listtop> <th>$title</th> </tr> <tr height="5"></tr> <tr> <td> <table width=100%> <tr> <th align=right nowrap>|.$locale->text('E-mail').qq|</th> <td><input name=email size=30 value="$form->{email}"></td> <th align=right nowrap>|.$locale->text('Cc').qq|</th> <td><input name=cc size=30 value="$form->{cc}"></td> </tr> <tr> <th align=right nowrap>|.$locale->text('Subject').qq|</th> <td><input name=subject size=30 value="|.$form->quote($form->{subject}).qq|"></td> $bcc </tr> </table> </td> </tr> <tr> <td> <table width=100%> <tr> <th align=left nowrap>|.$locale->text('Message').qq|</th> </tr> <tr> <td><textarea name=message rows=15 cols=60 wrap=soft>$form->{message}</textarea></td> </tr> </table> </td> </tr> <tr> <td> |; &print_options; for (qw(email cc bcc subject message type sendmode format action nextsub)) { delete $form->{$_} } $form->hide_form; print qq| </td> </tr> <tr> <td><hr size=3 noshade></td> </tr> </table> <input type=hidden name=nextsub value=send_email> <br> <input name=action class=submit type=submit value="|.$locale->text('Continue').qq|"> </form> </body> </html> |; } sub send_email { $form->{OUT} = "$sendmail"; $form->isblank("email", $locale->text('E-mail address missing!')); RP->aging(\%myconfig, \%$form); $form->{subject} = $locale->text('Statement').qq| - $form->{todate}| unless $form->{subject}; &print_form; $form->redirect($locale->text('Statement sent to')." $form->{$form->{vc}}"); } sub print { &{ "print_$form->{type}" } } sub print_statement { if ($form->{media} !~ /(screen|email)/) { $form->error($locale->text('Select postscript or PDF!')) if ($form->{format} !~ /(postscript|pdf)/); } for $i (1 .. $form->{rowcount}) { if ($form->{"statement_$i"}) { $form->{"$form->{vc}_id"} = $form->{"$form->{vc}_id_$i"}; $language_code = $form->{"language_code_$i"}; $curr = $form->{"curr_$i"}; $selected = 1; last; } } $form->error($locale->text('Nothing selected!')) unless $selected; if ($form->{media} !~ /(screen|email)/) { $form->{OUT} = "| $printer{$form->{media}}"; $form->{"$form->{vc}_id"} = ""; $SIG{INT} = 'IGNORE'; } else { $form->{"statement_1"} = 1; $form->{"language_code_1"} = $language_code; $form->{"curr_1"} = $curr; } RP->aging(\%myconfig, \%$form); @c = qw(c0 c15 c30 c45 c60 c75 c90); $item = $c[0]; @{$ag} = (); for (@c) { if ($form->{$_}) { $item = $_; } push @{ $ag{$item} }, $_; } for (keys %ag) { shift @{ $ag{$_} }; } for (keys %ag) { for $item (@{ $ag{$_} }) { $c{$_} += $c{$item}; } } for (@c) { # $column_data{$_} = qq|<th align=right>|.$form->format_amount(\%myconfig, $c{$_}{total}, $form->{precision}, "&nbsp").qq|</th>|; } &print_form; $form->redirect($locale->text('Statements sent to printer!')) if ($form->{media} !~ /(screen|email)/); } sub print_reminder { @ids = split / /, $form->{ids}; for (@ids) { if ($form->{"ndx_$_"}) { $selected = "ndx_$_"; last; } } $form->error($locale->text('Nothing selected!')) unless $selected; if ($form->{media} eq 'screen') { for (@ids) { $form->{"ndx_$_"} = ""; } $form->{$selected} = 1; } if ($form->{media} !~ /(screen|email)/) { $form->{"$form->{vc}_id"} = ""; $SIG{INT} = 'IGNORE'; } RP->reminder(\%myconfig, \%$form); if ($form->{media} !~ /(screen|email)/) { $form->{OUT} = qq~| $form->{"$form->{media}_printer"}~; } &do_print_reminder; if ($form->{callback}) { for (split / /, $form->{ids}) { if ($form->{"ndx_$_"}) { $form->{callback} .= qq|&ndx_$_=1&level_$_=$form->{"level_$_"}&language_code_$_=|.$form->escape($form->{"language_code_$_"},1); } } } $form->redirect($locale->text('Reminders sent to printer!')) if ($form->{media} !~ /(screen|email)/); } sub do_print_reminder { $out = $form->{OUT}; $form->{todate} ||= $form->current_date(\%myconfig); $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1); $form->{templates} = "$myconfig{templates}"; for (qw(name email)) { $form->{"user$_"} = $myconfig{$_} } # setup variables for the form $form->format_string(qw(company address businessnumber username useremail tel fax)); @a = qw(name address1 address2 city state zipcode country contact typeofcontact salutation firstname lastname); push @a, "$form->{vc}number", "$form->{vc}phone", "$form->{vc}fax", "$form->{vc}taxnumber"; push @a, 'email' if ! $form->{media} eq 'email'; push @a, map { "shipto$_" } qw(name address1 address2 city state zipcode country contact phone fax email); while (@{ $form->{AG} }) { $ref = shift @{ $form->{AG} }; $form->{OUT} = $out; if ($form->{"ndx_$ref->{id}"}) { for (@a) { $form->{$_} = $ref->{$_} } $form->format_string(@a); $form->{IN} = qq|$form->{type}$form->{"level_$ref->{id}"}.html|; if ($form->{format} =~ /(ps|pdf)/) { $form->{IN} =~ s/html$/tex/; } $form->{$form->{vc}} = $form->{name}; $form->{"$form->{vc}_id"} = $ref->{vc_id}; $form->{language_code} = $form->{"language_code_$ref->{id}"}; $form->{currency} = $ref->{curr}; for (qw(invnumber ordnumber ponumber notes invdate duedate invdescription)) { $form->{$_} = () } $ref->{invdate} = $ref->{transdate}; my @a = qw(invnumber ordnumber ponumber notes invdate duedate invdescription); for (@a) { $form->{"${_}_1"} = $ref->{$_} } $form->format_string(map { "${_}_1" } qw(invnumber ordnumber ponumber notes invdescription)); for (@a) { $form->{$_} = $form->{"${_}_1"} } $ref->{exchangerate} ||= 1; $form->{due} = $form->format_amount(\%myconfig, $ref->{due} / $ref->{exchangerate}, $form->{precision}); $form->parse_template(\%myconfig, $userspath); } } } sub print_form { $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1); $form->{templates} = "$myconfig{templates}"; for (qw(name email)) { $form->{"user$_"} = $myconfig{$_} } # setup variables for the form $form->format_string(qw(company address businessnumber username useremail tel fax)); $form->{IN} = "$form->{type}.html"; if ($form->{format} =~ /(postscript|pdf)/) { $form->{IN} =~ s/html$/tex/; } @a = qw(name address1 address2 city state zipcode country contact typeofcontact salutation firstname lastname); push @a, "$form->{vc}number", "$form->{vc}phone", "$form->{vc}fax", "$form->{vc}taxnumber"; push @a, 'email' if ! $form->{media} eq 'email'; push @a, map { "shipto$_" } qw(name address1 address2 city state zipcode country contact phone fax email); $i = 0; while (@{ $form->{AG} }) { $ref = shift @{ $form->{AG} }; if ($vc_id != $ref->{vc_id}) { $vc_id = $ref->{vc_id}; $i++; if ($form->{"statement_$i"}) { for (@a) { $form->{$_} = $ref->{$_} } $form->format_string(@a); $form->{$form->{vc}} = $form->{name}; $form->{"$form->{vc}_id"} = $ref->{vc_id}; $form->{language_code} = $form->{"language_code_$i"}; $form->{currency} = $form->{"curr_$i"}; for (qw(invnumber ordnumber ponumber notes invdate duedate invdescription)) { $form->{$_} = () } $form->{total} = 0; foreach $item (qw(c0 c15 c30 c45 c60 c75 c90)) { $form->{$item} = (); $form->{"${item}total"} = 0; } &statement_details($ref) if $ref->{curr} eq $form->{currency}; while ($ref) { if (scalar (@{ $form->{AG} }) > 0) { # one or more left to go if ($vc_id == $form->{AG}->[0]->{vc_id}) { $ref = shift @{ $form->{AG} }; &statement_details($ref) if $ref->{curr} eq $form->{currency}; # any more? $ref = scalar (@{ $form->{AG} }); } else { $ref = 0; } } else { # set initial ref to 0 $ref = 0; } } for ("c0", "c15", "c30", "c45", "c60", "c75", "c90", "") { $form->{"${_}total"} = $form->format_amount(\%myconfig, $form->{"${_}total"}, $form->{precision}) } $form->parse_template(\%myconfig, $userspath); } } } } sub statement_details { my ($ref) = @_; $ref->{invdate} = $ref->{transdate}; my @a = qw(invnumber ordnumber ponumber notes invdate duedate invdescription); for (@a) { $form->{"${_}_1"} = $ref->{$_} } $form->format_string(qw(invnumber_1 ordnumber_1 ponumber_1 notes_1 invdescription_1)); for (@a) { push @{ $form->{$_} }, $form->{"${_}_1"} } foreach $item (qw(c0 c15 c30 c45 c60 c75 c90)) { eval { $ref->{$item} = $form->round_amount($ref->{$item} / $ref->{exchangerate}, $form->{precision}) }; $form->{"${item}total"} += $ref->{$item}; $form->{total} += $ref->{$item}; push @{ $form->{$item} }, $form->format_amount(\%myconfig, $ref->{$item}, $form->{precision}); } } sub generate_tax_report { RP->tax_report(\%myconfig, \%$form); $descvar = "$form->{accno}_description"; $description = $form->escape($form->{$descvar}); if ($form->{accno} =~ /^gifi_/) { $descvar = "gifi_$form->{accno}_description"; $description = $form->escape($form->{$descvar}); } $department = $form->escape($form->{department}); # construct href $href = "$form->{script}?path=$form->{path}&direction=$form->{direction}&oldsort=$form->{oldsort}&action=generate_tax_report&login=$form->{login}&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&summary=$form->{summary}&accno=$form->{accno}&$descvar=$description&department=$department&report=$form->{report}"; # construct callback $description = $form->escape($form->{$descvar},1); $department = $form->escape($form->{department},1); $form->sort_order(); $callback = "$form->{script}?path=$form->{path}&direction=$form->{direction}&oldsort=$form->{oldsort}&action=generate_tax_report&login=$form->{login}&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&summary=$form->{summary}&accno=$form->{accno}&$descvar=$description&department=$department&report=$form->{report}"; $form->{title} = $locale->text('GIFI')." - " if ($form->{accno} =~ /^gifi_/); $title = $form->escape($form->{title}); $href .= "&title=$title"; $title = $form->escape($form->{title},1); $callback .= "&title=$title"; $form->{title} = qq|$form->{title} $form->{"$form->{accno}_description"} / $form->{company}|; if ($form->{db} eq 'ar') { $name = $locale->text('Customer'); $vcnumber = $locale->text('Customer Number'); $invoice = 'is.pl'; $arap = 'ar.pl'; $form->{vc} = "customer"; } if ($form->{db} eq 'ap') { $name = $locale->text('Vendor'); $vcnumber = $locale->text('Vendor Number'); $invoice = 'ir.pl'; $arap = 'ap.pl'; $form->{vc} = "vendor"; } @columns = qw(id transdate invnumber description name); push @columns, "$form->{vc}number"; push @columns, qw(netamount tax); @columns = $form->sort_columns(@columns); foreach $item (@columns) { if ($form->{"l_$item"} eq "Y") { push @column_index, $item; # add column to href and callback $callback .= "&l_$item=Y"; $href .= "&l_$item=Y"; } } if ($form->{l_subtotal} eq 'Y') { $callback .= "&l_subtotal=Y"; $href .= "&l_subtotal=Y"; } if ($form->{department}) { ($department) = split /--/, $form->{department}; $option = $locale->text('Department')." : $department"; } # if there are any dates if ($form->{fromdate} || $form->{todate}) { if ($form->{fromdate}) { $fromdate = $locale->date(\%myconfig, $form->{fromdate}, 1); } if ($form->{todate}) { $todate = $locale->date(\%myconfig, $form->{todate}, 1); } $form->{period} = "$fromdate - $todate"; } else { $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1); } $option .= "<br>" if $option; $option .= $locale->text('Cash') if ($form->{method} eq 'cash'); $option .= $locale->text('Accrual') if ($form->{method} eq 'accrual'); $option .= "<br>$form->{period}"; $column_header{id} = qq|<th><a class=listheading href=$href&sort=id>|.$locale->text('ID').qq|</th>|; $column_header{invnumber} = qq|<th><a class=listheading href=$href&sort=invnumber>|.$locale->text('Invoice').qq|</th>|; $column_header{transdate} = qq|<th nowrap><a class=listheading href=$href&sort=transdate>|.$locale->text('Date').qq|</th>|; $column_header{netamount} = qq|<th class=listheading>|.$locale->text('Amount').qq|</th>|; $column_header{tax} = qq|<th class=listheading>|.$locale->text('Tax').qq|</th>|; $column_header{name} = qq|<th><a class=listheading href=$href&sort=name>$name</th>|; $column_header{"$form->{vc}number"} = qq|<th><a class=listheading href=$href&sort=$form->{vc}number>$vcnumber</th>|; $column_header{description} = qq|<th><a class=listheading href=$href&sort=description>|.$locale->text('Description').qq|</th>|; $form->header; print qq| <body> <table width=100%> <tr> <th class=listtop colspan=$colspan>$form->{title}</th> </tr> <tr height="5"></tr> <tr> <td>$option</td> </tr> <tr> <td> <table width=100%> <tr class=listheading> |; for (@column_index) { print "$column_header{$_}\n" } print qq| </tr> |; # add sort and escape callback $callback = $form->escape($callback . "&sort=$form->{sort}"); if (@{ $form->{TR} }) { $sameitem = $form->{TR}->[0]->{$form->{sort}}; } foreach $ref (@{ $form->{TR} }) { $module = ($ref->{invoice}) ? $invoice : $arap; $module = 'ps.pl' if $ref->{till}; if ($form->{l_subtotal} eq 'Y') { if ($sameitem ne $ref->{$form->{sort}}) { &tax_subtotal; $sameitem = $ref->{$form->{sort}}; } } $totalnetamount += $ref->{netamount}; $totaltax += $ref->{tax}; $subtotalnetamount += $ref->{netamount}; $subtotaltax += $ref->{tax}; for (qw(netamount tax)) { $ref->{$_} = $form->format_amount(\%myconfig, $ref->{$_}, $form->{precision}, "&nbsp;"); } $column_data{id} = qq|<td>$ref->{id}</td>|; $column_data{invnumber} = qq|<td><a href=$module?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&callback=$callback>$ref->{invnumber}</a></td>|; $column_data{transdate} = qq|<td nowrap>$ref->{transdate}</td>|; for (qw(id partnumber description)) { $column_data{$_} = qq|<td>$ref->{$_}</td>| } $column_data{"$form->{vc}number"} = qq|<td>$ref->{"$form->{vc}number"}</td>|; $column_data{name} = qq|<td><a href=ct.pl?path=$form->{path}&login=$form->{login}&action=edit&id=$ref->{vc_id}&db=$form->{vc}&callback=$callback>$ref->{name}</a></td>|; for (qw(netamount tax)) { $column_data{$_} = qq|<td align=right>$ref->{$_}</td>| } $i++; $i %= 2; print qq| <tr class=listrow$i> |; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> |; } if ($form->{l_subtotal} eq 'Y') { &tax_subtotal; } for (@column_index) { $column_data{$_} = qq|<th>&nbsp;</th>| } print qq| </tr> <tr class=listtotal> |; $totalnetamount = $form->format_amount(\%myconfig, $totalnetamount, $form->{precision}, "&nbsp;"); $totaltax = $form->format_amount(\%myconfig, $totaltax, $form->{precision}, "&nbsp;"); $column_data{netamount} = qq|<th class=listtotal align=right>$totalnetamount</th>|; $column_data{tax} = qq|<th class=listtotal align=right>$totaltax</th>|; for (@column_index) { print "$column_data{$_}\n" } print qq| </tr> </table> </td> </tr> <tr> <td><hr size=3 noshade></td> </tr> </table> </body> </html> |; } sub tax_subtotal { for (@column_index) { $column_data{$_} = "<td>&nbsp;</td>" } $subtotalnetamount = $form->format_amount(\%myconfig, $subtotalnetamount, $form->{precision}, "&nbsp;"); $subtotaltax = $form->format_amount(\%myconfig, $subtotaltax, $form->{precision}, "&nbsp;"); $column_data{netamount} = "<th class=listsubtotal align=right>$subtotalnetamount</th>"; $column_data{tax} = "<th class=listsubtotal align=right>$subtotaltax</th>"; $subtotalnetamount = 0; $subtotaltax = 0; print qq| <tr class=listsubtotal> |; for (@column_index) { print "\n$column_data{$_}" } print qq| </tr> |; } sub list_payments { if ($form->{account}) { ($form->{paymentaccounts}) = split /--/, $form->{account}; } if ($form->{department}) { ($department, $form->{department_id}) = split /--/, $form->{department}; $option = $locale->text('Department')." : $department"; } RP->payments(\%myconfig, \%$form); @columns = (qw(transdate reference description name)); @columns = $form->sort_columns(@columns); push @columns, "$form->{vc}number"; push @columns, (qw(paid source memo)); if ($form->{till}) { @columns = (qw(transdate reference name)); @columns = $form->sort_columns(@columns); push @columns, "$form->{vc}number"; push @columns, (qw(description paid curr source till)); if ($myconfig{role} ne 'user') { push @columns, "employee"; } } # construct href $form->{paymentaccounts} =~ s/ /%20/g; $href = "$form->{script}?action=list_payments"; @a = (qw(path direction sort oldsort till login fromdate todate fx_transaction db l_subtotal prepayment paymentaccounts vc db)); for (@a) { $href .= "&$_=$form->{$_}" } $href .= "&title=".$form->escape($form->{title}); $form->sort_order(); $callback = "$form->{script}?action=list_payments"; for (@a) { $callback .= "&$_=$form->{$_}" } $callback .= "&title=".$form->escape($form->{title},1); if ($form->{account}) { $callback .= "&account=".$form->escape($form->{account},1); $href .= "&account=".$form->escape($form->{account}); $option .= "\n<br>" if ($option); $option .= $locale->text('Account')." : $form->{account}"; } if ($form->{department}) { $callback .= "&department=".$form->escape($form->{department},1); $href .= "&department=".$form->escape($form->{department}); $option .= "\n<br>" if ($option); $option .= $locale->text('Department')." : $form->{department}"; } %vc = ( customer => { name => 'Customer', 'number' => 'Customer Number' }, vendor => { name => 'Vendor', 'number' => 'Vendor Number' } ); if ($form->{$form->{vc}}) { $callback .= "&$form->{vc}=".$form->escape($form->{$form->{vc}},1); $href .= "&$form->{vc}=".$form->escape($form->{$form->{vc}}); $option .= "\n<br>" if ($option); $option .= $locale->text($vc{$form->{vc}}{name})." : $form->{$form->{vc}}"; } if ($form->{"$form->{vc}number"}) { $callback .= qq|&$form->{vc}number=|.$form->escape($form->{"$form->{vc}number"},1); $href .= qq|&$form->{vc}number=|.$form->escape($form->{"$form->{vc}number"}); $option .= "\n<br>" if ($option); $option .= $locale->text($vc{$form->{vc}}{number}).qq| : $form->{"$form->{vc}number"}|; } if ($form->{reference}) { $callback .= "&reference=".$form->escape($form->{reference},1); $href .= "&reference=".$form->escape($form->{reference}); $option .= "\n<br>" if ($option); $option .= $locale->text('Reference')." : $form->{reference}"; } if ($form->{description}) { $callback .= "&description=".$form->escape($form->{description},1); $href .= "&description=".$form->escape($form->{description}); $option .= "\n<br>" if ($option); $option .= $locale->text('Description')." : $form->{description}"; } if ($form->{source}) { $callback .= "&source=".$form->escape($form->{source},1); $href .= "&source=".$form->escape($form->{source}); $option .= "\n<br>" if ($option); $option .= $locale->text('Source')." : $form->{source}"; } if ($form->{memo}) { $callback .= "&memo=".$form->escape($form->{memo},1); $href .= "&memo=".$form->escape($form->{memo}); $option .= "\n<br>" if ($option); $option .= $locale->text('Memo')." : $form->{memo}"; } if ($form->{fromdate}) { $callback .= "&fromdate=$form->{fromdate}"; $href .= "&fromdate=$form->{fromdate}"; $option .= "\n<br>" if ($option); $option .= $locale->text('From')."&nbsp;".$locale->date(\%myconfig, $form->{fromdate}, 1); } if ($form->{todate}) { $callback .= "&todate=$form->{todate}"; $href .= "&todate=$form->{todate}"; $option .= "\n<br>" if ($option); $option .= $locale->text('To')."&nbsp;".$locale->date(\%myconfig, $form->{todate}, 1); } @column_index = (); for (@columns) { if ($form->{"l_$_"} eq 'Y') { push @column_index, $_; $callback .= "&l_$_=Y"; $href .= "&l_$_=Y"; } } $colspan = $#column_index + 1; $form->{callback} = $callback; $callback = $form->escape($form->{callback}); $column_header{name} = "<th><a class=listheading href=$href&sort=name>".$locale->text($vc{$form->{vc}}{name})."</a></th>"; $column_header{"$form->{vc}number"} = "<th><a class=listheading href=$href&sort=$form->{vc}number>".$locale->text($vc{$form->{vc}}{number})."</a></th>"; $column_header{reference} = "<th><a class=listheading href=$href&sort=reference>".$locale->text('Reference')."</a></th>"; $column_header{description} = "<th><a class=listheading href=$href&sort=description>".$locale->text('Description')."</a></th>"; $column_header{transdate} = "<th nowrap><a class=listheading href=$href&sort=transdate>".$locale->text('Date')."</a></th>"; $column_header{paid} = "<th class=listheading>".$locale->text('Amount')."</a></th>"; $column_header{curr} = "<th class=listheading>".$locale->text('Curr')."</a></th>"; $column_header{source} = "<th><a class=listheading href=$href&sort=source>".$locale->text('Source')."</a></th>"; $column_header{memo} = "<th><a class=listheading href=$href&sort=memo>".$locale->text('Memo')."</a></th>"; $employee = ($form->{db} eq 'ar') ? $locale->text('Salesperson') : $locale->text('Employee'); $column_header{employee} = "<th><a class=listheading href=$href&sort=employee>$employee</a></th>"; $column_header{till} = "<th><a class=listheading href=$href&sort=till>".$locale->text('Till')."</a></th>"; $title = "$form->{title} / $form->{company}"; $form->header; print qq| <body> <table width=100%> <tr> <th class=listtop>$title</th> </tr> <tr height="5"></tr> <tr> <td>$option</td> </tr> <tr> <td> <table width=100%> <tr class=listheading> |; for (@column_index) { print "\n$column_header{$_}" } print qq| </tr> |; $isir = ($form->{db} eq 'ar') ? 'is' : 'ir'; foreach $ref (sort { $a->{accno} cmp $b->{accno} } @{ $form->{PR} }) { next unless @{ $form->{$ref->{id}} }; print qq| <tr> <th colspan=$colspan align=left>$ref->{accno}--$ref->{description}</th> </tr> |; if (@{ $form->{$ref->{id}} }) { $sameitem = $form->{$ref->{id}}[0]->{$form->{sort}}; } foreach $payment (@{ $form->{$ref->{id}} }) { if ($form->{l_subtotal}) { if ($payment->{$form->{sort}} ne $sameitem) { # print subtotal &payment_subtotal; } } next if ($form->{till} && ! $payment->{till}); $href = ($payment->{vcid}) ? "<a href=ct.pl?action=edit&id=$payment->{vcid}&db=$form->{vc}&login=$form->{login}&path=$form->{path}&callback=$callback>" : ""; $column_data{name} = "<td>$href$payment->{name}</a>&nbsp;</td>"; $column_data{"$form->{vc}number"} = qq|<td>$payment->{"$form->{vc}number"}&nbsp;</td>|; $column_data{description} = "<td>$payment->{description}&nbsp;</td>"; $column_data{transdate} = "<td nowrap>$payment->{transdate}&nbsp;</td>"; $column_data{paid} = "<td align=right>".$form->format_amount(\%myconfig, $payment->{paid}, $form->{precision}, "&nbsp;")."</td>"; $column_data{curr} = "<td>$payment->{curr}</td>"; if ($payment->{module} eq 'gl') { $module = $payment->{module}; } else { if ($payment->{invoice}) { $module = ($payment->{till}) ? 'ps' : $isir; } else { $module = $form->{db}; } } $href = "<a href=${module}.pl?action=edit&id=$payment->{trans_id}&login=$form->{login}&path=$form->{path}&callback=$callback>"; $column_data{source} = "<td>$payment->{source}&nbsp;</td>"; $column_data{reference} = "<td>$href$payment->{reference}&nbsp;</a></td>"; $column_data{memo} = "<td>$payment->{memo}&nbsp;</td>"; $column_data{employee} = "<td>$payment->{employee}&nbsp;</td>"; $column_data{till} = "<td>$payment->{till}&nbsp;</td>"; $subtotalpaid += $payment->{paid}; $accounttotalpaid += $payment->{paid}; $totalpaid += $payment->{paid}; $i++; $i %= 2; print qq| <tr class=listrow$i> |; for (@column_index) { print "\n$column_data{$_}" } print qq| </tr> |; $sameitem = $payment->{$form->{sort}}; } &payment_subtotal if $form->{l_subtotal}; # print account totals for (@column_index) { $column_data{$_} = "<td>&nbsp;</td>" } $column_data{paid} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $accounttotalpaid, $form->{precision}, "&nbsp;")."</th>"; print qq| <tr class=listtotal> |; for (@column_index) { print "\n$column_data{$_}" } print qq| </tr> |; $accounttotalpaid = 0; } # print total for (@column_index) { $column_data{$_} = "<td>&nbsp;</td>" } $column_data{paid} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalpaid, $form->{precision}, "&nbsp;")."</th>"; print qq| <tr class=listtotal> |; for (@column_index) { print "\n$column_data{$_}" } print qq| </tr> </table> </td> </tr> <tr> <td><hr size=3 noshade></td> </tr> </table> |; ################ # &print_report_options; if ($form->{menubar}) { require "$form->{path}/menu.pl"; &menubar; } print qq| </body> </html> |; } sub payment_subtotal { if ($subtotalpaid != 0) { for (@column_index) { $column_data{$_} = "<td>&nbsp;</td>" } $column_data{paid} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalpaid, $form->{precision}, "&nbsp;")."</th>"; print qq| <tr class=listsubtotal> |; for (@column_index) { print "\n$column_data{$_}" } print qq| </tr> |; } $subtotalpaid = 0; } sub print_report_options { $form->{format} ||= "pdf"; $form->{media} ||= "screen"; $media = qq|<select name=media> <option value=screen $form->{MD}{screen}>|.$locale->text('Screen').qq| <option value=file $form->{MD}{file}>|.$locale->text('File'); $format = qq|<select name=format> <option value=csv $form->{DF}{csv}>CSV|; $media =~ s/(<option value="\Q$form->{media}\E")/$1 selected/; $media .= qq|</select>|; if ($latex) { $format .= qq| <option value=pdf $form->{DF}{pdf}>|.$locale->text('PDF').qq| <option value=postscript $form->{DF}{postscript}>|.$locale->text('Postscript'); } $format .= qq|</select>|; print qq| <form method=post action=$form->{script}> <table> <tr> <td>$format</td> <td>$media</td> |; print qq| </tr> </table> <p> <input class=submit type=submit name=action value="|.$locale->text('Print Report').qq|">|; $form->{action} = "print_report"; $form->{nextsub} = ""; $form->hide_form; print qq| </form> |; } sub print_report { $form->debug; }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <META name="GENERATOR" content="hevea 1.10"> <LINK rel="stylesheet" type="text/css" href="cascmd_en.css"> <TITLE>Zeros of an expression : zeros</TITLE> </HEAD> <BODY > <A HREF="cascmd_en106.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A> <A HREF="index.html"><IMG SRC="contents_motif.gif" ALT="Up"></A> <A HREF="cascmd_en108.html"><IMG SRC="next_motif.gif" ALT="Next"></A> <HR> <H3 CLASS="subsection"><A NAME="htoc121">2.12.11</A>  Zeros of an expression : <TT>zeros</TT></H3><P><A NAME="@default172"></A> <TT>zeros</TT> takes as argument an expression depending on <I>x</I>.<BR> <TT>zeros</TT> returns a list of values of <I>x</I> where the expression vanishes. The list may be incomplete in exact mode if the expression is not polynomial or if intermediate factorizations have irreducible factors of order strictly greater than 2.<BR> In real mode, (complex box unchecked in the Cas configuration or <TT>complex_mode:=0</TT>), only reals zeros are returned. In (<TT>complex_mode:=1</TT>) reals and complex zeros are returned. See also <TT>cZeros</TT> to get complex zeros in real mode.<BR> Input in real mode : </P><DIV CLASS="center"><TT>zeros(x</TT><CODE><TT>^</TT></CODE><TT>2+4)</TT></DIV><P> Output : </P><DIV CLASS="center"><TT>[]</TT></DIV><P> Input in complex mode : </P><DIV CLASS="center"><TT>zeros(x</TT><CODE><TT>^</TT></CODE><TT>2+4)</TT></DIV><P> Output : </P><DIV CLASS="center"><TT>[-2*i,2*i]</TT></DIV><P> Input in real mode : </P><DIV CLASS="center"><TT>zeros(ln(x)</TT><CODE><TT>^</TT></CODE><TT>2-2)</TT></DIV><P> Output : </P><DIV CLASS="center"><TT>[exp(sqrt(2)),exp(-(sqrt(2)))]</TT></DIV><P> Input in real mode : </P><DIV CLASS="center"><TT>zeros(ln(y)</TT><CODE><TT>^</TT></CODE><TT>2-2,y)</TT></DIV><P> Output : </P><DIV CLASS="center"><TT>[exp(sqrt(2)),exp(-(sqrt(2)))]</TT></DIV><P> Input in real mode : </P><DIV CLASS="center"><TT>zeros(x*(exp(x))</TT><CODE><TT>^</TT></CODE><TT>2-2*x-2*(exp(x))</TT><CODE><TT>^</TT></CODE><TT>2+4)</TT></DIV><P> Output : </P><DIV CLASS="center"><TT>[[log(sqrt(2)),2]</TT></DIV><HR> <A HREF="cascmd_en106.html"><IMG SRC="previous_motif.gif" ALT="Previous"></A> <A HREF="index.html"><IMG SRC="contents_motif.gif" ALT="Up"></A> <A HREF="cascmd_en108.html"><IMG SRC="next_motif.gif" ALT="Next"></A> </BODY> </HTML>
Java
package com.oinux.lanmitm.service; import com.oinux.lanmitm.R; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.os.IBinder; public class BaseService extends Service { public static final int HTTP_SERVER_NOTICE = 1; public static final int HIJACK_NOTICE = 2; public static final int SNIFFER_NOTICE = 3; public static final int INJECT_NOTICE = 4; public static final int ARPSPOOF_NOTICE = 0; @Override public IBinder onBind(Intent intent) { return null; } @SuppressWarnings("deprecation") protected void notice(String tickerText, int id, Class<?> cls) { NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Notification n = new Notification(R.drawable.ic_launch_notice, getString(R.string.app_name), System.currentTimeMillis()); n.flags = Notification.FLAG_NO_CLEAR; Intent intent = new Intent(this, cls); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent contentIntent = PendingIntent.getActivity(this, R.string.app_name, intent, PendingIntent.FLAG_UPDATE_CURRENT); n.setLatestEventInfo(this, this.getString(R.string.app_name), tickerText, contentIntent); nm.notify(id, n); } }
Java