Exemplo n.º 1
0
Arquivo: select.c Projeto: ArcEye/RTAI
int xnselect_mount(void)
{
	initq(&xnselectors);
	xnselect_apc = rthal_apc_alloc("xnselectors_destroy",
				       xnselector_destroy_loop, NULL);
	if (xnselect_apc < 0)
		return xnselect_apc;

	return 0;
}
Exemplo n.º 2
0
int pse51_apc_pkg_init(void)
{
	pse51_lostage_apc = rthal_apc_alloc("pse51_lostage_handler",
					    &pse51_lostage_handle_request, NULL);

	if (pse51_lostage_apc < 0)
		printk("Unable to allocate APC: %d !\n", pse51_lostage_apc);

	return pse51_lostage_apc < 0;
}
Exemplo n.º 3
0
int xnpipe_mount(void)
{
	struct xnpipe_state *state;
	int i;

	for (state = &xnpipe_states[0];
	     state < &xnpipe_states[XNPIPE_NDEVS]; state++) {
		inith(&state->slink);
		inith(&state->alink);
		state->status = 0;
		state->asyncq = NULL;
		initq(&state->inq);
		initq(&state->outq);
	}

	initq(&xnpipe_sleepq);
	initq(&xnpipe_asyncq);

	xnpipe_class = class_create(THIS_MODULE, "rtpipe");
	if (IS_ERR(xnpipe_class)) {
		xnlogerr("error creating rtpipe class, err=%ld.\n",
			 PTR_ERR(xnpipe_class));
		return -EBUSY;
	}

	for (i = 0; i < XNPIPE_NDEVS; i++) {
		DECLARE_DEVHANDLE(cldev);
		cldev = wrap_device_create(xnpipe_class, NULL,
					   MKDEV(XNPIPE_DEV_MAJOR, i),
					   NULL, "rtp%d", i);
		if (IS_ERR(cldev)) {
			xnlogerr
			    ("can't add device class, major=%d, minor=%d, err=%ld\n",
			     XNPIPE_DEV_MAJOR, i, PTR_ERR(cldev));
			class_destroy(xnpipe_class);
			return -EBUSY;
		}
	}

	if (register_chrdev(XNPIPE_DEV_MAJOR, "rtpipe", &xnpipe_fops)) {
		xnlogerr
		    ("unable to reserve major #%d for message pipe support.\n",
		     XNPIPE_DEV_MAJOR);
		return -EBUSY;
	}

	xnpipe_wakeup_apc =
	    rthal_apc_alloc("pipe_wakeup", &xnpipe_wakeup_proc, NULL);

	return 0;
}