Changeset b678410 in mainline for uspace/lib/c/generic/assert.c


Ignore:
Timestamp:
2011-04-27T20:01:13Z (13 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.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/assert.c

    r628d548 rb678410  
    11/*
    2  * Copyright (c) 2007 Jan Hudecek
    3  * Copyright (c) 2008 Martin Decky
     2 * Copyright (c) 2011 Martin Decky
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
    30 /** @addtogroup genericproc
     29/** @addtogroup libc
    3130 * @{
    3231 */
    33 /** @file tasklet.c
    34  *  @brief Tasklet implementation
    35  */
    3632
    37 #include <proc/tasklet.h>
    38 #include <synch/spinlock.h>
    39 #include <mm/slab.h>
    40 #include <config.h>
     33#include <assert.h>
     34#include <stdio.h>
     35#include <stdlib.h>
     36#include <stacktrace.h>
    4137
    42 /** Spinlock protecting list of tasklets */
    43 SPINLOCK_INITIALIZE(tasklet_lock);
    44 
    45 /** Array of tasklet lists for every CPU */
    46 tasklet_descriptor_t **tasklet_list;
    47 
    48 void tasklet_init(void)
     38void assert_abort(const char *cond, const char *file, unsigned int line)
    4939{
    50         unsigned int i;
    51        
    52         tasklet_list = malloc(sizeof(tasklet_descriptor_t *) * config.cpu_count, 0);
    53         if (!tasklet_list)
    54                 panic("Error initializing tasklets.");
    55        
    56         for (i = 0; i < config.cpu_count; i++)
    57                 tasklet_list[i] = NULL;
    58        
    59         spinlock_initialize(&tasklet_lock, "tasklet_lock");
     40        printf("Assertion failed (%s) in file \"%s\", line %u.\n",
     41            cond, file, line);
     42        stacktrace_print();
     43        abort();
    6044}
    61 
    6245
    6346/** @}
Note: See TracChangeset for help on using the changeset viewer.