Changeset b910455 in mainline for uspace/lib/drv/generic/log.c
- Timestamp:
- 2011-04-07T09:46:11Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6639ae1
- Parents:
- f6bffee (diff), 8e80d3f (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/log.c
rf6bffee rb910455 1 1 /* 2 * Copyright (c) 2007 Jan Hudecek 3 * Copyright (c) 2008 Martin Decky 2 * Copyright (c) 2011 Jiri Svoboda 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 30 /** @addtogroup genericproc29 /** @addtogroup libdrv 31 30 * @{ 32 31 */ 33 /** @file tasklet.c 34 * @brief Tasklet implementation 32 33 #include <io/log.h> 34 #include <stdarg.h> 35 36 #include <ddf/log.h> 37 38 /** Initialize the logging system. 39 * 40 * @param drv_name Driver name, will be printed as part of message 41 * @param level Minimum message level to print 35 42 */ 36 37 #include <proc/tasklet.h> 38 #include <synch/spinlock.h> 39 #include <mm/slab.h> 40 #include <config.h> 41 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) 43 int ddf_log_init(const char *drv_name, log_level_t level) 49 44 { 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"); 45 return log_init(drv_name, level); 60 46 } 61 47 48 /** Log a driver message. 49 * 50 * @param level Message verbosity level. Message is only printed 51 * if verbosity is less than or equal to current 52 * reporting level. 53 * @param fmt Format string (no trailing newline) 54 */ 55 void ddf_msg(log_level_t level, const char *fmt, ...) 56 { 57 va_list args; 58 59 va_start(args, fmt); 60 log_msgv(level, fmt, args); 61 va_end(args); 62 } 62 63 63 64 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.