Changeset b678410 in mainline for uspace/srv


Ignore:
Timestamp:
2011-04-27T20:01:13Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a6dffb8
Parents:
628d548 (diff), 933cadf (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 mainline changes.

Location:
uspace/srv
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    r628d548 rb678410  
    3939#include <devmap.h>
    4040#include <str_error.h>
     41#include <stdio.h>
    4142
    4243#include "devman.h"
     
    555556}
    556557
    557 /** Remember the driver's phone.
    558  *
    559  * @param driver        The driver.
    560  * @param phone         The phone to the driver.
    561  */
    562 void set_driver_phone(driver_t *driver, sysarg_t phone)
    563 {
    564         fibril_mutex_lock(&driver->driver_mutex);
    565         assert(driver->state == DRIVER_STARTING);
    566         driver->phone = phone;
    567         fibril_mutex_unlock(&driver->driver_mutex);
    568 }
    569 
    570558/** Notify driver about the devices to which it was assigned.
    571559 *
     
    685673        list_initialize(&drv->devices);
    686674        fibril_mutex_initialize(&drv->driver_mutex);
     675        drv->phone = -1;
    687676}
    688677
  • uspace/srv/devman/devman.h

    r628d548 rb678410  
    8888       
    8989        /** Phone asociated with this driver. */
    90         sysarg_t phone;
     90        int phone;
    9191        /** Name of the device driver. */
    9292        char *name;
     
    316316
    317317extern driver_t *find_driver(driver_list_t *, const char *);
    318 extern void set_driver_phone(driver_t *, sysarg_t);
    319318extern void initialize_running_driver(driver_t *, dev_tree_t *);
    320319
  • uspace/srv/devman/main.c

    r628d548 rb678410  
    9595        /* Find driver structure. */
    9696        driver = find_driver(&drivers_list, drv_name);
    97        
    9897        if (driver == NULL) {
    9998                log_msg(LVL_ERROR, "No driver named `%s' was found.", drv_name);
     
    107106        drv_name = NULL;
    108107       
     108        fibril_mutex_lock(&driver->driver_mutex);
     109       
     110        if (driver->phone >= 0) {
     111                /* We already have a connection to the driver. */
     112                log_msg(LVL_ERROR, "Driver '%s' already started.\n",
     113                    driver->name);
     114                fibril_mutex_unlock(&driver->driver_mutex);
     115                async_answer_0(iid, EEXISTS);
     116                return NULL;
     117        }
     118       
     119        switch (driver->state) {
     120        case DRIVER_NOT_STARTED:
     121                /* Somebody started the driver manually. */
     122                log_msg(LVL_NOTE, "Driver '%s' started manually.\n",
     123                    driver->name);
     124                driver->state = DRIVER_STARTING;
     125                break;
     126        case DRIVER_STARTING:
     127                /* The expected case */
     128                break;
     129        case DRIVER_RUNNING:
     130                /* Should not happen since we do not have a connected phone */
     131                assert(false);
     132        }
     133       
    109134        /* Create connection to the driver. */
    110135        log_msg(LVL_DEBUG, "Creating connection to the `%s' driver.",
     
    113138        ipc_callid_t callid = async_get_call(&call);
    114139        if (IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) {
     140                fibril_mutex_unlock(&driver->driver_mutex);
    115141                async_answer_0(callid, ENOTSUP);
    116142                async_answer_0(iid, ENOTSUP);
     
    119145       
    120146        /* Remember driver's phone. */
    121         set_driver_phone(driver, IPC_GET_ARG5(call));
     147        driver->phone = IPC_GET_ARG5(call);
     148       
     149        fibril_mutex_unlock(&driver->driver_mutex);
    122150       
    123151        log_msg(LVL_NOTE,
     
    578606                method = DRIVER_CLIENT;
    579607       
    580         if (driver->phone <= 0) {
     608        if (driver->phone < 0) {
    581609                log_msg(LVL_ERROR,
    582610                    "Could not forward to driver `%s' (phone is %d).",
     
    618646        dev = fun->dev;
    619647       
    620         if (dev->state != DEVICE_USABLE || dev->drv->phone <= 0) {
     648        if (dev->state != DEVICE_USABLE || dev->drv->phone < 0) {
    621649                async_answer_0(iid, EINVAL);
    622650                return;
  • uspace/srv/fs/fat/fat_fat.c

    r628d548 rb678410  
    4747#include <assert.h>
    4848#include <fibril_synch.h>
     49#include <malloc.h>
    4950#include <mem.h>
    5051
  • uspace/srv/fs/fat/fat_idx.c

    r628d548 rb678410  
    4444#include <assert.h>
    4545#include <fibril_synch.h>
     46#include <malloc.h>
    4647
    4748/** Each instance of this type describes one interval of freed VFS indices. */
  • uspace/srv/fs/fat/fat_ops.c

    r628d548 rb678410  
    5555#include <sys/mman.h>
    5656#include <align.h>
     57#include <malloc.h>
    5758
    5859#define FAT_NODE(node)  ((node) ? (fat_node_t *) (node)->data : NULL)
     
    722723                    (str_cmp((char *) d->name, FAT_NAME_DOT)) == 0) {
    723724                        memset(d, 0, sizeof(fat_dentry_t));
    724                         str_cpy((char *) d->name, 8, FAT_NAME_DOT);
    725                         str_cpy((char *) d->ext, 3, FAT_EXT_PAD);
     725                        memcpy(d->name, FAT_NAME_DOT, FAT_NAME_LEN);
     726                        memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN);
    726727                        d->attr = FAT_ATTR_SUBDIR;
    727728                        d->firstc = host2uint16_t_le(childp->firstc);
     
    732733                    (str_cmp((char *) d->name, FAT_NAME_DOT_DOT) == 0)) {
    733734                        memset(d, 0, sizeof(fat_dentry_t));
    734                         str_cpy((char *) d->name, 8, FAT_NAME_DOT_DOT);
    735                         str_cpy((char *) d->ext, 3, FAT_EXT_PAD);
     735                        memcpy(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN);
     736                        memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN);
    736737                        d->attr = FAT_ATTR_SUBDIR;
    737738                        d->firstc = (parentp->firstc == FAT_CLST_ROOT) ?
  • uspace/srv/hw/irc/apic/apic.c

    r628d548 rb678410  
    5656static int apic_enable_irq(sysarg_t irq)
    5757{
    58         /* FIXME: TODO */
     58        // FIXME: TODO
    5959        return ENOTSUP;
    6060}
  • uspace/srv/hw/netif/ne2000/dp8390.c

    r628d548 rb678410  
    5353#include <byteorder.h>
    5454#include <errno.h>
     55#include <stdio.h>
    5556#include <libarch/ddi.h>
    5657#include <net/packet.h>
  • uspace/srv/loader/arch/ia64/_link.ld.in

    r628d548 rb678410  
    2828       
    2929        .got : {
    30                 _gp = .;
     30                /* Tell the linker where we expect GP to point. */
     31                __gp = .;
    3132                *(.got .got.*);
    3233        } :data
  • uspace/srv/net/il/ip/ip.c

    r628d548 rb678410  
    365365               
    366366                if (ip_netif->dhcp) {
    367                         /* TODO dhcp */
     367                        // TODO dhcp
    368368                        net_free_settings(configuration, data);
    369369                        return ENOTSUP;
     
    398398                        }
    399399                } else {
    400                         /* TODO ipv6 in separate module */
     400                        // TODO ipv6 in separate module
    401401                        net_free_settings(configuration, data);
    402402                        return ENOTSUP;
     
    517517            ip_netif->dhcp ? "dhcp" : "static");
    518518       
    519         /* TODO ipv6 addresses */
     519        // TODO ipv6 addresses
    520520       
    521521        char address[INET_ADDRSTRLEN];
     
    946946
    947947        /* Greatest multiple of 8 lower than content */
    948         /* TODO even fragmentation? */
     948        // TODO even fragmentation?
    949949        length = length & ~0x7;
    950950       
     
    12121212        }
    12131213       
    1214         /* Ff the local host is the destination */
     1214        /* If the local host is the destination */
    12151215        if ((route->address.s_addr == dest->s_addr) &&
    12161216            (dest->s_addr != IPV4_LOCALHOST_ADDRESS)) {
     
    12791279        in_addr_t destination;
    12801280
    1281         /* TODO search set ipopt route? */
     1281        // TODO search set ipopt route?
    12821282        destination.s_addr = header->destination_address;
    12831283        return destination;
     
    13211321        if ((header->flags & IPFLAG_MORE_FRAGMENTS) ||
    13221322            IP_FRAGMENT_OFFSET(header)) {
    1323                 /* TODO fragmented */
     1323                // TODO fragmented
    13241324                return ENOTSUP;
    13251325        }
     
    14371437                phone = ip_prepare_icmp_and_get_phone(0, packet, header);
    14381438                if (phone >= 0) {
    1439                         /* ttl exceeded ICMP */
     1439                        /* TTL exceeded ICMP */
    14401440                        icmp_time_exceeded_msg(phone, ICMP_EXC_TTL, packet);
    14411441                }
     
    17771777                if ((type != ICMP_DEST_UNREACH) ||
    17781778                    (code != ICMP_HOST_UNREACH)) {
    1779                         /* No, something else */
     1779                        /* No, something else */
    17801780                        break;
    17811781                }
  • uspace/srv/ns/clonable.c

    r628d548 rb678410  
    7878        if (list_empty(&cs_req)) {
    7979                /* There was no pending connection request. */
    80                 printf(NAME ": Unexpected clonable server.\n");
     80                printf("%s: Unexpected clonable server.\n", NAME);
    8181                ipc_answer_0(callid, EBUSY);
    8282                return;
  • uspace/srv/ns/service.c

    r628d548 rb678410  
    3535#include <assert.h>
    3636#include <errno.h>
     37#include <stdio.h>
     38#include <malloc.h>
    3739#include "service.h"
    3840#include "ns.h"
  • uspace/srv/ns/task.c

    r628d548 rb678410  
    3939#include <stdio.h>
    4040#include <macros.h>
     41#include <malloc.h>
    4142#include "task.h"
    4243#include "ns.h"
  • uspace/srv/vfs/vfs_file.c

    r628d548 rb678410  
    258258        if ((fd >= 0) && (fd < MAX_OPEN_FILES)) {
    259259                vfs_file_t *file = FILES[fd];
    260                 vfs_file_addref(file);
    261                 fibril_mutex_unlock(&VFS_DATA->lock);
    262                 return file;
     260                if (file != NULL) {
     261                        vfs_file_addref(file);
     262                        fibril_mutex_unlock(&VFS_DATA->lock);
     263                        return file;
     264                }
    263265        }
    264266        fibril_mutex_unlock(&VFS_DATA->lock);
  • uspace/srv/vfs/vfs_ops.c

    r628d548 rb678410  
    611611void vfs_open_node(ipc_callid_t rid, ipc_call_t *request)
    612612{
    613         /* FIXME: check for sanity of the supplied fs, dev and index */
     613        // FIXME: check for sanity of the supplied fs, dev and index
    614614       
    615615        /*
Note: See TracChangeset for help on using the changeset viewer.