Deleted Added
full compact
openpromio.c (126080) openpromio.c (130585)
1/*-
2 * Copyright (c) 2003 Jake Burkholder.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003 Jake Burkholder.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/ofw/openpromio.c 126080 2004-02-21 21:10:55Z phk $");
29__FBSDID("$FreeBSD: head/sys/dev/ofw/openpromio.c 130585 2004-06-16 09:47:26Z phk $");
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/conf.h>
34#include <sys/errno.h>
35#include <sys/fcntl.h>
36#include <sys/ioccom.h>
37#include <sys/kernel.h>

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

62 .d_flags = D_NEEDGIANT,
63 .d_open = openprom_open,
64 .d_close = openprom_close,
65 .d_ioctl = openprom_ioctl,
66 .d_name = "openprom",
67};
68
69static int openprom_is_open;
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/conf.h>
34#include <sys/errno.h>
35#include <sys/fcntl.h>
36#include <sys/ioccom.h>
37#include <sys/kernel.h>

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

62 .d_flags = D_NEEDGIANT,
63 .d_open = openprom_open,
64 .d_close = openprom_close,
65 .d_ioctl = openprom_ioctl,
66 .d_name = "openprom",
67};
68
69static int openprom_is_open;
70static dev_t openprom_dev;
70static struct cdev *openprom_dev;
71static phandle_t openprom_node;
72
73static int
71static phandle_t openprom_node;
72
73static int
74openprom_open(dev_t dev, int oflags, int devtype, struct thread *td)
74openprom_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
75{
76
77 if (openprom_is_open != 0)
78 return (EBUSY);
79 openprom_is_open = 1;
80 return (0);
81}
82
83static int
75{
76
77 if (openprom_is_open != 0)
78 return (EBUSY);
79 openprom_is_open = 1;
80 return (0);
81}
82
83static int
84openprom_close(dev_t dev, int fflag, int devtype, struct thread *td)
84openprom_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
85{
86
87 openprom_is_open = 0;
88 return (0);
89}
90
91static int
85{
86
87 openprom_is_open = 0;
88 return (0);
89}
90
91static int
92openprom_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
92openprom_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
93 struct thread *td)
94{
95 struct openpromio *oprom;
96 phandle_t node;
97 uint32_t len;
98 size_t done;
99 int proplen;
100 char *prop;

--- 122 unchanged lines hidden ---
93 struct thread *td)
94{
95 struct openpromio *oprom;
96 phandle_t node;
97 uint32_t len;
98 size_t done;
99 int proplen;
100 char *prop;

--- 122 unchanged lines hidden ---