source: rtems/cpukit/libfs/src/devfs/devfs_show.c @ 0ec9bbc

5
Last change on this file since 0ec9bbc was 339069fc, checked in by Sebastian Huber <sebastian.huber@…>, on 12/13/17 at 07:02:09

devfs: Include <rtems/devfs.h>

Prepare for header file move to common include directory.

Update #3254.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file
3 *
4 * @brief Retrieves and Prints all the Device Registered in System
5 * @ingroup DevFsDeviceTable Define Device Table Type
6 */
7
8/*
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.org/license/LICENSE.
12 */
13
14#if HAVE_CONFIG_H
15  #include "config.h"
16#endif
17
18#include <rtems/devfs.h>
19
20#include <rtems/bspIo.h>
21
22void devFS_Show(void)
23{
24  rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location;
25
26  if (rootloc->mt_entry->ops == &devFS_ops) {
27    const devFS_data *data = devFS_get_data(rootloc);
28    size_t i = 0;
29    size_t n = data->count;
30    devFS_node *nodes = data->nodes;
31
32    for (i = 0; i < n; ++i) {
33      devFS_node *current = nodes + i;
34
35      if (current->name != NULL) {
36        size_t j = 0;
37        size_t m = current->namelen;
38
39        printk("/");
40        for (j = 0; j < m; ++j) {
41          printk("%c", current->name [j]);
42        }
43        printk(
44          " %lu %lu\n",
45          (unsigned long) current->major,
46          (unsigned long) current->minor
47        );
48      }
49    }
50  }
51}
Note: See TracBrowser for help on using the repository browser.