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

5
Last change on this file since ede1a41 was ede1a41, checked in by Sebastian Huber <sebastian.huber@…>, on 06/21/16 at 11:12:31

Make rtems/print.h independent of rtems/bspIo.h

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[d883ce2]1/**
2 * @file
3 *
4 * @brief Retrieves and Prints all the Device Registered in System
5 * @ingroup DevFsDeviceTable Define Device Table Type
6 */
7
[d40da79b]8/*
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
[c499856]11 *  http://www.rtems.org/license/LICENSE.
[d40da79b]12 */
13
14#if HAVE_CONFIG_H
[3b7c123]15  #include "config.h"
[d40da79b]16#endif
17
18#include "devfs.h"
19
[ede1a41]20#include <rtems/bspIo.h>
21
[3b7c123]22void devFS_Show(void)
[d40da79b]23{
[3b7c123]24  rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location;
[d40da79b]25
[da154e14]26  if (rootloc->mt_entry->ops == &devFS_ops) {
[3b7c123]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;
[d40da79b]31
[3b7c123]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      }
[d40da79b]49    }
50  }
51}
Note: See TracBrowser for help on using the repository browser.