Beispiel #1
0
_f_int
_COUNT0_4(DopeVectorType * mask,
	_f_int	*dimension)
{
	void __count();
	DopeVectorType  result, *res_ptr;
	_f_int		intres;
	
	res_ptr = (DopeVectorType *) &result;
        res_ptr->base_addr.a.ptr = &intres;
        res_ptr->base_addr.a.el_len = sizeof(_f_int) * BITS_PER_BYTE;
	res_ptr->assoc = 1;
	res_ptr->ptr_alloc = 0;
	res_ptr->p_or_a = NOT_P_OR_A;
	res_ptr->n_dim = 0;
	res_ptr->type_lens.type = DVTYPE_INTEGER;
        res_ptr->type_lens.dpflag = 0;
        res_ptr->type_lens.kind_or_star = DVD_DEFAULT;
	res_ptr->type_lens.int_len = sizeof(_f_int4) * BITS_PER_BYTE;
        res_ptr->type_lens.dec_len = 0;
        res_ptr->orig_base = res_ptr->base_addr.a.ptr;
        res_ptr->orig_size = 0;
	__count (res_ptr, mask, dimension);
	return (*(_f_int4 *) res_ptr->base_addr.a.ptr);
}
Beispiel #2
0
void
_COUNT_4 (DopeVectorType * result,
	DopeVectorType * mask,
	_f_int	*dimension)
{
	void __count();
	(void) __count (result, mask, dimension);
}
Beispiel #3
0
static inline int __get_count(struct mcuio_i2c_dev *i2cd)
{
	int stat;
	u32 s;

	stat = __get_status(i2cd, &s);
	if (stat < 0)
		return stat;
	return __count(s);
}
Beispiel #4
0
/**
 * Find |L(PUQ)|, where Q is the patterns in a.
 */
_cnt_size
fa_countstr_plusplus(int m, fa * a, set * P)
{
    _cnt_size cnt;
    if (*(a->regex) != '\0')
    {
        *(a->__regex_end) = '|';
        *(a->__regex_end + 1) = '\0';
    }
    strcat(a->regex, patternset_to_regex(P));
    cnt = __count(m, a->regex);
    *(a->__regex_end) = '\0';
    return cnt;
}
Beispiel #5
0
static irqreturn_t mcuio_i2c_irq_handler(int irq, void *devid)
{
	/* Read status register and complete current transaction */
	struct mcuio_i2c_dev *i2cd = devid;
	u32 v;
	u8 flags, count, space;
	int stat;

	BUG_ON(!i2cd || !i2cd->map_dw);
	stat = __get_status(i2cd, &v);
	if (stat < 0) {
		dev_err(&i2cd->mdev->dev, "error reading i2c status\n");
		/* This will make the transaction end with -EIO */
		v = NAK_RECEIVED;
	}
	dev_dbg(&i2cd->mdev->dev, "%s: status = 0x%08x\n", __func__, v);

	flags = __flags(v);
	count = __count(v);
	space = __space(v);

	if (!flags) {
		dev_err(&i2cd->mdev->dev, "spurious irq\n");
		return IRQ_HANDLED;
	}

	if ((flags & NAK_RECEIVED) || (flags & TRANSACTION_OK)) {
		i2cd->xfer_status = (stat < 0 || (v & NAK_RECEIVED)) ? -EIO : 0;
		dev_dbg(&i2cd->mdev->dev, "%s: flags = 0x%04x\n", __func__,
			i2cd->flags);
		if ((i2cd->flags & I2C_M_RD) && !i2cd->xfer_status) {
			dev_dbg(&i2cd->mdev->dev, "%s: reading ibuf\n",
				__func__);
			__get_ibuf(i2cd);
		}
		complete(&i2cd->xfer_complete);
		return IRQ_HANDLED;
	}
	if ((flags & OBUF_LO_WM_REACHED) && space && (i2cd->olen - i2cd->sent))
		___send_obuf(i2cd, space);
	if ((flags & IBUF_HI_WM_REACHED) && count &&
	    (i2cd->ilen - i2cd->received))
		___get_ibuf(i2cd, count);
	dev_dbg(&i2cd->mdev->dev, "%s: xfer_status = %d\n", __func__,
		i2cd->xfer_status);
	return IRQ_HANDLED;
}
Beispiel #6
0
static int __count(avltree_t* me, int idx)
{
  if (me->size <= idx || !me->nodes[idx].key)
    return 0;
  return __count(me, __child_l(idx)) + __count(me, __child_r(idx)) + 1;
}
Beispiel #7
0
/* Find |L(P)| where P is the patterns in a. */
_cnt_size fa_countstr(int m, fa * a) { return __count(m, a->regex); }