source: rtems-libbsd/rtemsbsd/rtems/rtems-kernel-bus-root.c

6-freebsd-12
Last change on this file was 0237319, checked in by Sebastian Huber <sebastian.huber@…>, on 05/23/17 at 11:18:31

Update due to Newlib 2017-06-07 changes

The following files are now provided by Newlib:

  • arpa/inet.h
  • net/if.h
  • netinet/in.h
  • netinet/tcp.h
  • sys/socket.h
  • sys/uio.h
  • sys/un.h

The <sys/param.h> and <sys/cpuset.h> are now compatible enough to be
used directly.

Update #2833.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup rtems_bsd_rtems
5 *
6 * @brief TODO.
7 */
8
9/*-
10 * Copyright (c) 2012-2013 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Dornierstr. 4
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 *    notice, this list of conditions, and the following disclaimer,
23 *    without modification, immediately at the beginning of the file.
24 * 2. The name of the author may not be used to endorse or promote products
25 *    derived from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
31 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#include <machine/rtems-bsd-kernel-space.h>
41
42#include <sys/param.h>
43#include <sys/bus.h>
44
45#include <rtems/bsd.h>
46
47int
48rtems_bsd_bus_root_attach(void)
49{
50        int err;
51        device_t dev;
52
53        dev = device_find_child(root_bus, "nexus", 0);
54        if (dev != NULL) {
55                err = device_probe_and_attach(dev);
56        } else {
57                err = ENOENT;
58        }
59
60        return (err);
61}
62
63int
64rtems_bsd_bus_root_suspend(void)
65{
66
67        return (DEVICE_SUSPEND(root_bus));
68}
69
70int
71rtems_bsd_bus_root_resume(void)
72{
73
74        return (DEVICE_RESUME(root_bus));
75}
76
77int
78rtems_bsd_bus_root_detach(void)
79{
80        int err;
81        device_t dev;
82
83        dev = device_find_child(root_bus, "nexus", 0);
84        if (dev != NULL) {
85                err = device_detach(dev);
86        } else {
87                err = ENOENT;
88        }
89
90        return (err);
91}
Note: See TracBrowser for help on using the repository browser.