diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/kmem.c | 10 | ||||
-rw-r--r-- | kern/llsync.c | 4 | ||||
-rw-r--r-- | kern/panic.c | 8 | ||||
-rw-r--r-- | kern/percpu.c | 10 | ||||
-rw-r--r-- | kern/printf.c (renamed from kern/printk.c) | 24 | ||||
-rw-r--r-- | kern/printf.h (renamed from kern/printk.h) | 8 | ||||
-rw-r--r-- | kern/sref.c | 2 | ||||
-rw-r--r-- | kern/syscnt.c | 6 | ||||
-rw-r--r-- | kern/task.c | 6 | ||||
-rw-r--r-- | kern/work.c | 6 |
10 files changed, 42 insertions, 42 deletions
diff --git a/kern/kmem.c b/kern/kmem.c index d9ca7e4..60b8db9 100644 --- a/kern/kmem.c +++ b/kern/kmem.c @@ -57,7 +57,7 @@ #include <kern/mutex.h> #include <kern/panic.h> #include <kern/param.h> -#include <kern/printk.h> +#include <kern/printf.h> #include <kern/sprintf.h> #include <kern/thread.h> #include <machine/cpu.h> @@ -441,7 +441,7 @@ kmem_cache_error(struct kmem_cache *cache, void *buf, int error, void *arg) { struct kmem_buftag *buftag; - printk("kmem: error: cache: %s, buffer: %p\n", cache->name, buf); + printf("kmem: error: cache: %s, buffer: %p\n", cache->name, buf); switch(error) { case KMEM_ERR_INVALID: @@ -1111,7 +1111,7 @@ kmem_cache_info(struct kmem_cache *cache) mutex_lock(&cache->lock); - printk("kmem: name: %s\n" + printf("kmem: name: %s\n" "kmem: flags: 0x%x%s\n" "kmem: obj_size: %zu\n" "kmem: align: %zu\n" @@ -1286,7 +1286,7 @@ kmem_info(void) struct kmem_cache *cache; size_t mem_usage, mem_reclaimable; - printk("kmem: cache obj slab bufs objs bufs " + printf("kmem: cache obj slab bufs objs bufs " " total reclaimable\n" "kmem: name size size /slab usage count " " memory memory\n"); @@ -1299,7 +1299,7 @@ kmem_info(void) mem_usage = (cache->nr_slabs * cache->slab_size) >> 10; mem_reclaimable = (cache->nr_free_slabs * cache->slab_size) >> 10; - printk("kmem: %-19s %6zu %3zuk %4lu %6lu %6lu %7zuk %10zuk\n", + printf("kmem: %-19s %6zu %3zuk %4lu %6lu %6lu %7zuk %10zuk\n", cache->name, cache->obj_size, cache->slab_size >> 10, cache->bufs_per_slab, cache->nr_objs, cache->nr_bufs, mem_usage, mem_reclaimable); diff --git a/kern/llsync.c b/kern/llsync.c index 023548a..0c81c0f 100644 --- a/kern/llsync.c +++ b/kern/llsync.c @@ -46,7 +46,7 @@ #include <kern/mutex.h> #include <kern/param.h> #include <kern/percpu.h> -#include <kern/printk.h> +#include <kern/printf.h> #include <kern/spinlock.h> #include <kern/sprintf.h> #include <kern/syscnt.h> @@ -123,7 +123,7 @@ llsync_process_global_checkpoint(void) /* TODO Handle hysteresis */ if (!llsync_data.no_warning && (nr_works >= LLSYNC_NR_PENDING_WORKS_WARN)) { llsync_data.no_warning = 1; - printk("llsync: warning: large number of pending works\n"); + printf("llsync: warning: large number of pending works\n"); } if (llsync_data.nr_registered_cpus == 0) { diff --git a/kern/panic.c b/kern/panic.c index a9599f2..470c421 100644 --- a/kern/panic.c +++ b/kern/panic.c @@ -19,7 +19,7 @@ #include <kern/atomic.h> #include <kern/panic.h> -#include <kern/printk.h> +#include <kern/printf.h> #include <machine/cpu.h> #include <machine/strace.h> @@ -42,10 +42,10 @@ panic(const char *format, ...) cpu_intr_disable(); cpu_halt_broadcast(); - printk("\npanic: "); + printf("\npanic: "); va_start(list, format); - vprintk(format, list); - printk("\n"); + vprintf(format, list); + printf("\n"); strace_dump(); cpu_halt(); diff --git a/kern/percpu.c b/kern/percpu.c index ad00772..6008b64 100644 --- a/kern/percpu.c +++ b/kern/percpu.c @@ -26,7 +26,7 @@ #include <kern/panic.h> #include <kern/param.h> #include <kern/percpu.h> -#include <kern/printk.h> +#include <kern/printf.h> #include <machine/cpu.h> #include <vm/vm_kmem.h> #include <vm/vm_page.h> @@ -50,7 +50,7 @@ percpu_setup(void) unsigned int order; percpu_area_size = &_percpu_end - &_percpu; - printk("percpu: max_cpus: %u, section size: %zuk\n", X15_MAX_CPUS, + printf("percpu: max_cpus: %u, section size: %zuk\n", X15_MAX_CPUS, percpu_area_size >> 10); assert(vm_page_aligned(percpu_area_size)); @@ -77,7 +77,7 @@ percpu_add(unsigned int cpu) if (cpu >= ARRAY_SIZE(percpu_areas)) { if (!percpu_skip_warning) { - printk("percpu: ignoring processor beyond id %zu\n", + printf("percpu: ignoring processor beyond id %zu\n", ARRAY_SIZE(percpu_areas) - 1); percpu_skip_warning = 1; } @@ -86,7 +86,7 @@ percpu_add(unsigned int cpu) } if (percpu_areas[cpu] != NULL) { - printk("percpu: error: id %u ignored, already registered\n", cpu); + printf("percpu: error: id %u ignored, already registered\n", cpu); return ERROR_INVAL; } @@ -98,7 +98,7 @@ percpu_add(unsigned int cpu) page = vm_page_alloc(order, VM_PAGE_SEL_DIRECTMAP, VM_PAGE_KERNEL); if (page == NULL) { - printk("percpu: error: unable to allocate percpu area\n"); + printf("percpu: error: unable to allocate percpu area\n"); return ERROR_NOMEM; } diff --git a/kern/printk.c b/kern/printf.c index dd5cc87..6cd6464 100644 --- a/kern/printk.c +++ b/kern/printf.c @@ -15,7 +15,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <kern/printk.h> +#include <kern/printf.h> #include <kern/spinlock.h> #include <kern/sprintf.h> #include <machine/cpu.h> @@ -30,44 +30,44 @@ */ extern void console_write_byte(char c); -static char printk_buffer[PRINTK_BUFSIZE]; -static struct spinlock printk_lock; +static char printf_buffer[PRINTK_BUFSIZE]; +static struct spinlock printf_lock; int -printk(const char *format, ...) +printf(const char *format, ...) { va_list ap; int length; va_start(ap, format); - length = vprintk(format, ap); + length = vprintf(format, ap); va_end(ap); return length; } int -vprintk(const char *format, va_list ap) +vprintf(const char *format, va_list ap) { unsigned long flags; int length; char *ptr; - spinlock_lock_intr_save(&printk_lock, &flags); + spinlock_lock_intr_save(&printf_lock, &flags); - length = vsnprintf(printk_buffer, sizeof(printk_buffer), format, ap); + length = vsnprintf(printf_buffer, sizeof(printf_buffer), format, ap); - for (ptr = printk_buffer; *ptr != '\0'; ptr++) { + for (ptr = printf_buffer; *ptr != '\0'; ptr++) { console_write_byte(*ptr); } - spinlock_unlock_intr_restore(&printk_lock, flags); + spinlock_unlock_intr_restore(&printf_lock, flags); return length; } void -printk_setup(void) +printf_setup(void) { - spinlock_init(&printk_lock); + spinlock_init(&printf_lock); } diff --git a/kern/printk.h b/kern/printf.h index 02173b3..efaf2f9 100644 --- a/kern/printk.h +++ b/kern/printf.h @@ -17,7 +17,7 @@ * * Formatted output functions. * - * The printk() and vprintk() functions internally use a statically + * The printf() and vprintf() functions internally use a statically * allocated buffer. They won't produce output larger than 1 KiB. They can * be used safely in any context. * @@ -31,8 +31,8 @@ #include <kern/macros.h> -int printk(const char *format, ...) __format_printf(1, 2); -int vprintk(const char *format, va_list ap) __format_printf(1, 0); -void printk_setup(void); +int printf(const char *format, ...) __format_printf(1, 2); +int vprintf(const char *format, va_list ap) __format_printf(1, 0); +void printf_setup(void); #endif /* _KERN_PRINTK_H */ diff --git a/kern/sref.c b/kern/sref.c index 23fb0ad..9c2ddea 100644 --- a/kern/sref.c +++ b/kern/sref.c @@ -503,7 +503,7 @@ sref_end_epoch(struct sref_queue *queue) if (!sref_data.no_warning && (sref_review_queue_size() >= SREF_NR_COUNTERS_WARN)) { sref_data.no_warning = 1; - printk("sref: warning: large number of counters in review queue\n"); + printf("sref: warning: large number of counters in review queue\n"); } if (sref_data.nr_registered_cpus == 1) { diff --git a/kern/syscnt.c b/kern/syscnt.c index 4336ef1..74559ea 100644 --- a/kern/syscnt.c +++ b/kern/syscnt.c @@ -21,7 +21,7 @@ #include <kern/init.h> #include <kern/list.h> #include <kern/mutex.h> -#include <kern/printk.h> +#include <kern/printf.h> #include <kern/spinlock.h> #include <kern/syscnt.h> @@ -61,7 +61,7 @@ syscnt_info(const char *prefix) prefix_length = (prefix == NULL) ? 0 : strlen(prefix); - printk("syscnt: name value\n"); + printf("syscnt: name value\n"); mutex_lock(&syscnt_lock); @@ -77,7 +77,7 @@ syscnt_info(const char *prefix) value = syscnt_read(syscnt); - printk("syscnt: %-30s %17llu\n", syscnt->name, + printf("syscnt: %-30s %17llu\n", syscnt->name, (unsigned long long)value); } diff --git a/kern/task.c b/kern/task.c index c7caeb4..d2aaa80 100644 --- a/kern/task.c +++ b/kern/task.c @@ -131,7 +131,7 @@ task_info(struct task *task) spinlock_lock(&task_list_lock); list_for_each_entry(&task_list, task, node) { - printk("task: %s\n", task->name); + printf("task: %s\n", task->name); } spinlock_unlock(&task_list_lock); @@ -141,7 +141,7 @@ task_info(struct task *task) spinlock_lock(&task->lock); - printk("task: name: %s, threads:\n", task->name); + printf("task: name: %s, threads:\n", task->name); /* * Don't grab any lock when accessing threads, so that the function @@ -150,7 +150,7 @@ task_info(struct task *task) * so holding the task lock is enough to guarantee existence. */ list_for_each_entry(&task->threads, thread, task_node) { - printk(TASK_INFO_ADDR_FMT " %c %8s:" TASK_INFO_ADDR_FMT + printf(TASK_INFO_ADDR_FMT " %c %8s:" TASK_INFO_ADDR_FMT " %.2s:%02hu %02u %s\n", (unsigned long)thread, thread_state_to_chr(thread), diff --git a/kern/work.c b/kern/work.c index f6309e7..a81e8de 100644 --- a/kern/work.c +++ b/kern/work.c @@ -27,7 +27,7 @@ #include <kern/panic.h> #include <kern/param.h> #include <kern/percpu.h> -#include <kern/printk.h> +#include <kern/printf.h> #include <kern/spinlock.h> #include <kern/sprintf.h> #include <kern/syscnt.h> @@ -375,7 +375,7 @@ work_process(void *arg) if (error) { work_pool_free_id(pool, id); - printk("work: warning: unable to create worker thread\n"); + printf("work: warning: unable to create worker thread\n"); } } } @@ -491,7 +491,7 @@ work_setup(void) work_pool_init(&work_pool_highprio, WORK_INVALID_CPU, WORK_PF_GLOBAL | WORK_PF_HIGHPRIO); - printk("work: threads per pool (per-cpu/global): %u/%u, spare: %u\n", + printf("work: threads per pool (per-cpu/global): %u/%u, spare: %u\n", percpu_var(work_pool_cpu_main.max_threads, 0), work_pool_main.max_threads, WORK_THREADS_SPARE); } |