Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 424558a in mainline


Ignore:
Timestamp:
2010-12-17T21:29:22Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
0bff73a
Parents:
87b4baa
Message:

Add null char device and test for it

Currently, the test only verifies whether connection through devmap
to devman drivers work (it does not).

Location:
uspace
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/Makefile

    r87b4baa r424558a  
    5151        loop/loop1.c \
    5252        mm/malloc1.c \
     53        hw/misc/virtchar1.c \
    5354        hw/serial/serial1.c
    5455
  • uspace/app/tester/tester.c

    r87b4baa r424558a  
    6565#include "mm/malloc1.def"
    6666#include "hw/serial/serial1.def"
     67#include "hw/misc/virtchar1.def"
    6768        {NULL, NULL, NULL, false}
    6869};
  • uspace/app/tester/tester.h

    r87b4baa r424558a  
    8282extern const char *test_malloc1(void);
    8383extern const char *test_serial1(void);
     84extern const char *test_virtchar1(void);
    8485
    8586extern test_t tests[];
  • uspace/drv/rootvirt/devices.def

    r87b4baa r424558a  
    1717        .match_id = "virtual&test2"
    1818},
     19{
     20        .name = "null",
     21        .match_id = "virtual&test1"
     22},
    1923#endif
  • uspace/drv/test1/Makefile

    r87b4baa r424558a  
    3333
    3434SOURCES = \
     35        char.c \
    3536        test1.c
    3637
  • uspace/drv/test1/test1.c

    r87b4baa r424558a  
    3434#include <errno.h>
    3535#include <str_error.h>
    36 #include <driver.h>
    37 
    38 #define NAME "test1"
     36#include "test1.h"
    3937
    4038static int add_device(device_t *dev);
     
    9896        add_device_to_class(dev, "virtual");
    9997
    100         if (dev->parent == NULL) {
     98        if (str_cmp(dev->name, "null") == 0) {
     99                dev->ops = &char_device_ops;
     100        } else if (dev->parent == NULL) {
    101101                register_child_verbose(dev, "cloning myself ;-)", "clone",
    102102                    "virtual&test1", 10);
     
    117117}
    118118
    119 
Note: See TracChangeset for help on using the changeset viewer.