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

5
Last change on this file since e8020d1 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • 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 "devfs.h"
19
20void devFS_Show(void)
21{
22  rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location;
23
24  if (rootloc->mt_entry->ops == &devFS_ops) {
25    const devFS_data *data = devFS_get_data(rootloc);
26    size_t i = 0;
27    size_t n = data->count;
28    devFS_node *nodes = data->nodes;
29
30    for (i = 0; i < n; ++i) {
31      devFS_node *current = nodes + i;
32
33      if (current->name != NULL) {
34        size_t j = 0;
35        size_t m = current->namelen;
36
37        printk("/");
38        for (j = 0; j < m; ++j) {
39          printk("%c", current->name [j]);
40        }
41        printk(
42          " %lu %lu\n",
43          (unsigned long) current->major,
44          (unsigned long) current->minor
45        );
46      }
47    }
48  }
49}
Note: See TracBrowser for help on using the repository browser.