Ejemplo n.º 1
0
void
load_room (void)
{
  load_floor ();
  load_broken_floor ();
  load_skeleton_floor ();
  load_loose_floor ();
  load_opener_floor ();
  load_closer_floor ();
  load_spikes_floor ();
  load_wall ();
  load_pillar ();
  load_big_pillar ();
  load_door ();
  load_level_door ();
  load_chopper ();
  load_bricks ();
  load_torch ();
  load_window ();
  load_balcony ();
  load_arch ();
  load_carpet ();
  load_stars ();
  load_mirror ();
}
Ejemplo n.º 2
0
static int
cryptoadm_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *c,
    int *rval)
{
	int error;
#define	ARG	((caddr_t)arg)

	switch (cmd) {
	case CRYPTO_LOAD_DEV_DISABLED:
	case CRYPTO_LOAD_SOFT_DISABLED:
	case CRYPTO_LOAD_SOFT_CONFIG:
	case CRYPTO_UNLOAD_SOFT_MODULE:
	case CRYPTO_POOL_CREATE:
	case CRYPTO_POOL_WAIT:
	case CRYPTO_POOL_RUN:
	case CRYPTO_LOAD_DOOR:
	case CRYPTO_FIPS140_SET:
		if ((error = drv_priv(c)) != 0)
			return (error);
	default:
		break;
	}

	switch (cmd) {
	case CRYPTO_GET_DEV_LIST:
		return (get_dev_list(dev, ARG, mode, rval));

	case CRYPTO_GET_DEV_INFO:
		return (get_dev_info(dev, ARG, mode, rval));

	case CRYPTO_GET_SOFT_LIST:
		return (get_soft_list(dev, ARG, mode, rval));

	case CRYPTO_GET_SOFT_INFO:
		return (get_soft_info(dev, ARG, mode, rval));

	case CRYPTO_LOAD_DEV_DISABLED:
		return (load_dev_disabled(dev, ARG, mode, rval));

	case CRYPTO_LOAD_SOFT_DISABLED:
		return (load_soft_disabled(dev, ARG, mode, rval));

	case CRYPTO_LOAD_SOFT_CONFIG:
		return (load_soft_config(dev, ARG, mode, rval));

	case CRYPTO_UNLOAD_SOFT_MODULE:
		return (unload_soft_module(dev, ARG, mode, rval));

	case CRYPTO_POOL_CREATE:
		/*
		 * The framework allocates and initializes the pool.
		 * So, this is a no op. We are keeping this ioctl around
		 * to be used for any future threadpool related work.
		 */
		if (audit_active)
			audit_cryptoadm(CRYPTO_POOL_CREATE, NULL, NULL,
			    0, 0, 0, 0);
		return (0);

	case CRYPTO_POOL_WAIT: {
		int nthrs = 0, err;

		if ((err = kcf_svc_wait(&nthrs)) == 0) {
			if (copyout((caddr_t)&nthrs, ARG, sizeof (int))
			    == -1)
				err = EFAULT;
		}
		if (audit_active)
			audit_cryptoadm(CRYPTO_POOL_WAIT, NULL, NULL,
			    0, 0, 0, err);
		return (err);
	}

	case CRYPTO_POOL_RUN: {
		int err;

		err = kcf_svc_do_run();
		if (audit_active)
			audit_cryptoadm(CRYPTO_POOL_RUN, NULL, NULL,
			    0, 0, 0, err);
		return (err);
	}

	case CRYPTO_LOAD_DOOR:
		return (load_door(dev, ARG, mode, rval));
	case CRYPTO_FIPS140_STATUS:
		return (fips140_actions(dev, ARG, mode, rval, cmd));
	case CRYPTO_FIPS140_SET: {
		int err;

		err = fips140_actions(dev, ARG, mode, rval, cmd);
		if (audit_active)
			audit_cryptoadm(CRYPTO_FIPS140_SET, NULL, NULL,
			    0, 0, 0, err);
		return (err);
	}
	}

	return (EINVAL);
}