Deleted Added
full compact
kernel.c (236884) kernel.c (247265)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 31 unchanged lines hidden (view full) ---

40/*
41 * Emulation of kernel services in userland.
42 */
43
44int aok;
45uint64_t physmem;
46vnode_t *rootdir = (vnode_t *)0xabcd1234;
47char hw_serial[HW_HOSTID_LEN];
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 31 unchanged lines hidden (view full) ---

40/*
41 * Emulation of kernel services in userland.
42 */
43
44int aok;
45uint64_t physmem;
46vnode_t *rootdir = (vnode_t *)0xabcd1234;
47char hw_serial[HW_HOSTID_LEN];
48#ifdef illumos
49kmutex_t cpu_lock;
50#endif
48
49struct utsname utsname = {
50 "userland", "libzpool", "1", "1", "na"
51};
52
53/* this only exists to have its address taken */
54struct proc p0;
55

--- 781 unchanged lines hidden (view full) ---

837 char *end;
838
839 *result = strtoull(str, &end, base);
840 if (*result == 0)
841 return (errno);
842 return (0);
843}
844
51
52struct utsname utsname = {
53 "userland", "libzpool", "1", "1", "na"
54};
55
56/* this only exists to have its address taken */
57struct proc p0;
58

--- 781 unchanged lines hidden (view full) ---

840 char *end;
841
842 *result = strtoull(str, &end, base);
843 if (*result == 0)
844 return (errno);
845 return (0);
846}
847
848#ifdef illumos
849/* ARGSUSED */
850cyclic_id_t
851cyclic_add(cyc_handler_t *hdlr, cyc_time_t *when)
852{
853 return (1);
854}
855
856/* ARGSUSED */
857void
858cyclic_remove(cyclic_id_t id)
859{
860}
861
862/* ARGSUSED */
863int
864cyclic_reprogram(cyclic_id_t id, hrtime_t expiration)
865{
866 return (1);
867}
868#endif
869
845/*
846 * =========================================================================
847 * kernel emulation setup & teardown
848 * =========================================================================
849 */
850static int
851umem_out_of_memory(void)
852{

--- 17 unchanged lines hidden (view full) ---

870 (void) snprintf(hw_serial, sizeof (hw_serial), "%lu",
871 (mode & FWRITE) ? (unsigned long)gethostid() : 0);
872
873 VERIFY((random_fd = open("/dev/random", O_RDONLY)) != -1);
874 VERIFY((urandom_fd = open("/dev/urandom", O_RDONLY)) != -1);
875
876 system_taskq_init();
877
870/*
871 * =========================================================================
872 * kernel emulation setup & teardown
873 * =========================================================================
874 */
875static int
876umem_out_of_memory(void)
877{

--- 17 unchanged lines hidden (view full) ---

895 (void) snprintf(hw_serial, sizeof (hw_serial), "%lu",
896 (mode & FWRITE) ? (unsigned long)gethostid() : 0);
897
898 VERIFY((random_fd = open("/dev/random", O_RDONLY)) != -1);
899 VERIFY((urandom_fd = open("/dev/urandom", O_RDONLY)) != -1);
900
901 system_taskq_init();
902
903#ifdef illumos
904 mutex_init(&cpu_lock, NULL, MUTEX_DEFAULT, NULL);
905#endif
906
878 spa_init(mode);
879}
880
881void
882kernel_fini(void)
883{
884 spa_fini();
885

--- 161 unchanged lines hidden ---
907 spa_init(mode);
908}
909
910void
911kernel_fini(void)
912{
913 spa_fini();
914

--- 161 unchanged lines hidden ---