Changeset b9f1585 in mainline for uspace


Ignore:
Timestamp:
2019-01-03T06:53:22Z (7 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
043d464f
Parents:
b4a4ad94 (diff), 7acd787 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge upstream changes

Location:
uspace
Files:
9 added
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile

    rb4a4ad94 rb9f1585  
    6767        app/netecho \
    6868        app/nterm \
     69        app/pci \
    6970        app/perf \
    7071        app/redir \
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    rb4a4ad94 rb9f1585  
    199199
    200200        /* Populate the directory list. */
    201         if (ls.recursive) {
     201        if (ls.recursive && nbdirs > 0) {
    202202                tmp = (struct dir_elem_t *) realloc(*dir_list_ptr,
    203203                    nbdirs * sizeof(struct dir_elem_t));
  • uspace/drv/bus/pci/pciintel/Makefile

    rb4a4ad94 rb9f1585  
    3232
    3333SOURCES = \
     34        ctl.c \
    3435        pci.c
    3536
  • uspace/drv/bus/pci/pciintel/pci.c

    rb4a4ad94 rb9f1585  
    11/*
     2 * Copyright (c) 2019 Jiri Svoboda
    23 * Copyright (c) 2010 Lenka Trochtova
    3  * Copyright (c) 2018 Jiri Svoboda
    44 * All rights reserved.
    55 *
     
    5858#include <pci_dev_iface.h>
    5959
     60#include "ctl.h"
    6061#include "pci.h"
     62#include "pci_regs.h"
    6163
    6264#define NAME "pciintel"
     
    7375
    7476/** Obtain PCI bus soft-state from DDF device node */
    75 #if 0
    76 static pci_bus_t *pci_bus(ddf_dev_t *dnode)
     77pci_bus_t *pci_bus(ddf_dev_t *dnode)
    7778{
    7879        return ddf_dev_data_get(dnode);
    7980}
    80 #endif
    8181
    8282/** Obtain PCI bus soft-state from function soft-state */
     
    448448
    449449        /* TODO add subsys ids, but those exist only in header type 0 */
     450}
     451
     452/** Get first PCI function.
     453 *
     454 * @param bus PCI bus
     455 * @return First PCI function on @a bus or @c NULL if there is none
     456 */
     457pci_fun_t *pci_fun_first(pci_bus_t *bus)
     458{
     459        link_t *link;
     460
     461        link = list_first(&bus->funs);
     462        if (link == NULL)
     463                return NULL;
     464
     465        return list_get_instance(link, pci_fun_t, lfuns);
     466}
     467
     468/** Get next PCI function.
     469 *
     470 * @param cur Current function
     471 * @return Next PCI function on the same bus or @c NULL if there is none
     472 */
     473pci_fun_t *pci_fun_next(pci_fun_t *cur)
     474{
     475        link_t *link;
     476
     477        link = list_next(&cur->lfuns, &cur->busptr->funs);
     478        if (link == NULL)
     479                return NULL;
     480
     481        return list_get_instance(link, pci_fun_t, lfuns);
    450482}
    451483
     
    691723                                continue;
    692724                        }
     725
     726                        list_append(&fun->lfuns, &bus->funs);
    693727                }
    694728        }
     
    718752                goto fail;
    719753        }
     754
     755        list_initialize(&bus->funs);
    720756        fibril_mutex_initialize(&bus->conf_mutex);
    721757
     
    802838        }
    803839
     840        ddf_fun_set_conn_handler(ctl, pci_ctl_connection);
     841
    804842        /* Enumerate functions. */
    805843        ddf_msg(LVL_DEBUG, "Enumerating the bus");
     
    816854        }
    817855
     856        rc = ddf_fun_add_to_category(ctl, "pci");
     857        if (rc != EOK) {
     858                ddf_msg(LVL_ERROR, "Failed adding control function to category "
     859                    "'pci'.");
     860                goto fail;
     861        }
     862
    818863        hw_res_clean_resource_list(&hw_resources);
    819864
  • uspace/drv/bus/pci/pciintel/pci.h

    rb4a4ad94 rb9f1585  
    3737#define PCI_H_
    3838
     39#include <adt/list.h>
     40#include <ddi.h>
    3941#include <ddf/driver.h>
    40 #include "pci_regs.h"
     42#include <fibril_synch.h>
    4143
    4244#define PCI_MAX_HW_RES 10
     
    5052        pio_window_t pio_win;
    5153        fibril_mutex_t conf_mutex;
     54        /** List of functions (of pci_fun_t) */
     55        list_t funs;
    5256} pci_bus_t;
    5357
     
    5559        pci_bus_t *busptr;
    5660        ddf_fun_t *fnode;
     61        /** Link to @c busptr->funs */
     62        link_t lfuns;
    5763
    5864        int bus;
     
    7177} pci_fun_t;
    7278
     79extern pci_bus_t *pci_bus(ddf_dev_t *);
     80
    7381extern void pci_fun_create_match_ids(pci_fun_t *);
     82extern pci_fun_t *pci_fun_first(pci_bus_t *);
     83extern pci_fun_t *pci_fun_next(pci_fun_t *);
    7484
    7585extern uint8_t pci_conf_read_8(pci_fun_t *, int);
  • uspace/lib/c/Makefile

    rb4a4ad94 rb9f1585  
    165165        generic/assert.c \
    166166        generic/bsearch.c \
     167        generic/pci.c \
    167168        generic/pio_trace.c \
    168169        generic/qsort.c \
  • uspace/lib/c/generic/io/chargrid.c

    rb4a4ad94 rb9f1585  
    263263void chargrid_set_cursor(chargrid_t *scrbuf, sysarg_t col, sysarg_t row)
    264264{
     265        if (col >= scrbuf->cols || row >= scrbuf->rows)
     266                return;
     267
    265268        scrbuf->col = col;
    266269        scrbuf->row = row;
  • uspace/lib/clui/tinput.c

    rb4a4ad94 rb9f1585  
    5656} seek_dir_t;
    5757
     58static void tinput_update_origin(tinput_t *);
    5859static void tinput_init(tinput_t *);
    5960static void tinput_insert_string(tinput_t *, const char *);
     
    7172static void tinput_console_set_lpos(tinput_t *ti, unsigned lpos)
    7273{
    73         console_set_pos(ti->console, LIN_TO_COL(ti, lpos),
    74             LIN_TO_ROW(ti, lpos));
     74        unsigned col = LIN_TO_COL(ti, lpos);
     75        unsigned row = LIN_TO_ROW(ti, lpos);
     76
     77        assert(col < ti->con_cols);
     78        assert(row < ti->con_rows);
     79        console_set_pos(ti->console, col, row);
    7580}
    7681
     
    163168static void tinput_position_caret(tinput_t *ti)
    164169{
     170        tinput_update_origin(ti);
    165171        tinput_console_set_lpos(ti, ti->text_coord + ti->pos);
    166172}
     
    232238
    233239        tinput_display_tail(ti, ti->pos - 1, 0);
    234         tinput_update_origin(ti);
    235240        tinput_position_caret(ti);
    236241}
     
    276281
    277282        tinput_display_tail(ti, ti->pos - ilen, 0);
    278         tinput_update_origin(ti);
    279283        tinput_position_caret(ti);
    280284}
  • uspace/srv/locsrv/locsrv.c

    rb4a4ad94 rb9f1585  
    13901390        categ_dir_add_cat(&cdir, cat);
    13911391
     1392        cat = category_new("pci");
     1393        categ_dir_add_cat(&cdir, cat);
     1394
    13921395        return true;
    13931396}
  • uspace/srv/vfs/vfs_ops.c

    rb4a4ad94 rb9f1585  
    892892        rc = vfs_fd_alloc(&file, false, out_fd);
    893893        if (rc != EOK) {
     894                fibril_rwlock_read_unlock(&namespace_rwlock);
    894895                vfs_node_put(node);
    895896                vfs_file_put(parent);
Note: See TracChangeset for help on using the changeset viewer.