diff --git a/audio/audio.c b/audio/audio.c index 8b353681744..184ef74a6f7 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -832,7 +832,7 @@ static void audio_callback(FAR void *handle, uint16_t reason, default: { - auderr("Unknown callback reason code %d\n", reason); + auderr("ERROR: Unknown callback reason code %d\n", reason); break; } } @@ -885,7 +885,7 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev) upper = (FAR struct audio_upperhalf_s *)kmm_zalloc(sizeof(struct audio_upperhalf_s)); if (!upper) { - auderr("Allocation failed\n"); + auderr("ERROR: Allocation failed\n"); return -ENOMEM; } diff --git a/audio/pcm_decode.c b/audio/pcm_decode.c index 28dafc41a97..a9d739dd44b 100644 --- a/audio/pcm_decode.c +++ b/audio/pcm_decode.c @@ -259,23 +259,23 @@ static void pcm_callback(FAR void *arg, uint16_t reason, #ifdef CONFIG_PCM_DEBUG static void pcm_dump(FAR const struct wav_header_s *wav) { - err("Wave file header\n"); - err(" Header Chunk:\n"); - err(" Chunk ID: 0x%08x\n", wav->hdr.chunkid); - err(" Chunk Size: %u\n", wav->hdr.chunklen); - err(" Format: 0x%08x\n", wav->hdr.format); - err(" Format Chunk:\n"); - err(" Chunk ID: 0x%08x\n", wav->fmt.chunkid); - err(" Chunk Size: %u\n", wav->fmt.chunklen); - err(" Audio Format: 0x%04x\n", wav->fmt.format); - err(" Num. Channels: %d\n", wav->fmt.nchannels); - err(" Sample Rate: %u\n", wav->fmt.samprate); - err(" Byte Rate: %u\n", wav->fmt.byterate); - err(" Block Align: %d\n", wav->fmt.align); - err(" Bits Per Sample: %d\n", wav->fmt.bpsamp); - err(" Data Chunk:\n"); - err(" Chunk ID: 0x%08x\n", wav->data.chunkid); - err(" Chunk Size: %u\n", wav->data.chunklen); + info("Wave file header\n"); + info(" Header Chunk:\n"); + info(" Chunk ID: 0x%08x\n", wav->hdr.chunkid); + info(" Chunk Size: %u\n", wav->hdr.chunklen); + info(" Format: 0x%08x\n", wav->hdr.format); + info(" Format Chunk:\n"); + info(" Chunk ID: 0x%08x\n", wav->fmt.chunkid); + info(" Chunk Size: %u\n", wav->fmt.chunklen); + info(" Audio Format: 0x%04x\n", wav->fmt.format); + info(" Num. Channels: %d\n", wav->fmt.nchannels); + info(" Sample Rate: %u\n", wav->fmt.samprate); + info(" Byte Rate: %u\n", wav->fmt.byterate); + info(" Block Align: %d\n", wav->fmt.align); + info(" Bits Per Sample: %d\n", wav->fmt.bpsamp); + info(" Data Chunk:\n"); + info(" Chunk ID: 0x%08x\n", wav->data.chunkid); + info(" Chunk Size: %u\n", wav->data.chunklen); } #endif @@ -691,7 +691,7 @@ static int pcm_getcaps(FAR struct audio_lowerhalf_s *dev, int type, ret = lower->ops->getcaps(lower, type, caps); if (ret < 0) { - auderr("Lower getcaps() failed: %d\n", ret); + auderr("ERROR: Lower getcaps() failed: %d\n", ret); return ret; } diff --git a/crypto/crypto.c b/crypto/crypto.c index e0095ef6d1e..fef0a918971 100644 --- a/crypto/crypto.c +++ b/crypto/crypto.c @@ -81,7 +81,7 @@ int up_cryptoinitialize(void) res = crypto_test(); if (res) { - cryptllerr("crypto test failed\n"); + cryptllerr("ERROR: crypto test failed\n"); } else { diff --git a/crypto/testmngr.c b/crypto/testmngr.c index f95628f4a99..12db7541a3b 100644 --- a/crypto/testmngr.c +++ b/crypto/testmngr.c @@ -86,7 +86,7 @@ static int do_test_aes(FAR struct cipher_testvec *test, int mode, int encrypt) #define AES_CYPHER_TEST_ENCRYPT(mode, mode_str, count, template) \ for (i = 0; i < count; i++) { \ if (do_test_aes(template + i, mode, CYPHER_ENCRYPT)) { \ - cryptllerr("Failed " mode_str " encrypt test #%i\n", i); \ + cryptllerr("ERROR: Failed " mode_str " encrypt test #%i\n", i); \ return -1; \ } \ } @@ -94,7 +94,7 @@ static int do_test_aes(FAR struct cipher_testvec *test, int mode, int encrypt) #define AES_CYPHER_TEST_DECRYPT(mode, mode_str, count, template) \ for (i = 0; i < count; i++) { \ if (do_test_aes(template + i, mode, CYPHER_DECRYPT)) { \ - cryptllerr("Failed " mode_str " decrypt test #%i\n", i); \ + cryptllerr("ERROR: Failed " mode_str " decrypt test #%i\n", i); \ return -1; \ } \ } diff --git a/libnx/nxfonts/nxfonts_getfont.c b/libnx/nxfonts/nxfonts_getfont.c index 86cdc98bfb0..1e8f80edc2a 100644 --- a/libnx/nxfonts/nxfonts_getfont.c +++ b/libnx/nxfonts/nxfonts_getfont.c @@ -475,7 +475,7 @@ static inline FAR const struct nx_fontset_s * fontset = &package->font8; #else - gerr("8-bit font support disabled: %d\n", ch); + gwarn("WARNING: 8-bit font support disabled: %d\n", ch); return NULL; #endif } @@ -483,7 +483,7 @@ static inline FAR const struct nx_fontset_s * { /* Someday, perhaps 16-bit fonts will go here */ - gerr("16-bit font not currently supported\n"); + gerr("ERROR: 16-bit font not currently supported\n"); return NULL; } @@ -494,7 +494,7 @@ static inline FAR const struct nx_fontset_s * return fontset; } - gerr("No bitmap for code %02x\n", ch); + gerr("ERROR: No bitmap for code %02x\n", ch); return NULL; } diff --git a/libnx/nxmu/nx_bitmap.c b/libnx/nxmu/nx_bitmap.c index d59e237ef69..0d8ec93f405 100644 --- a/libnx/nxmu/nx_bitmap.c +++ b/libnx/nxmu/nx_bitmap.c @@ -133,7 +133,7 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest, if (ret != OK) { - gerr("sem_init failed: %d\n", errno); + gerr("ERROR: sem_init failed: %d\n", errno); return ret; } diff --git a/libnx/nxmu/nx_connect.c b/libnx/nxmu/nx_connect.c index b5a5ab83edd..7b2db2808f0 100644 --- a/libnx/nxmu/nx_connect.c +++ b/libnx/nxmu/nx_connect.c @@ -160,7 +160,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) #endif if (conn->crdmq == (mqd_t)-1) { - gerr("mq_open(%s) failed: %d\n", climqname, errno); + gerr("ERROR: mq_open(%s) failed: %d\n", climqname, errno); goto errout_with_conn; } @@ -173,7 +173,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) conn->cwrmq = mq_open(svrmqname, O_WRONLY|O_CREAT, 0666, &attr); if (conn->cwrmq == (mqd_t)-1) { - gerr("mq_open(%s) failed: %d\n", svrmqname, errno); + gerr("ERROR: mq_open(%s) failed: %d\n", svrmqname, errno); goto errout_with_rmq; } @@ -185,7 +185,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) ret = nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_s)); if (ret < 0) { - gerr("nxmu_sendserver failed: %d\n", errno); + gerr("ERROR: nxmu_sendserver failed: %d\n", errno); goto errout_with_wmq; } @@ -201,7 +201,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) ret = nx_eventhandler((NXHANDLE)conn); if (ret < 0) { - gerr("nx_message failed: %d\n", errno); + gerr("ERROR: nx_message failed: %d\n", errno); goto errout_with_wmq; } usleep(300000); diff --git a/libnx/nxmu/nx_eventhandler.c b/libnx/nxmu/nx_eventhandler.c index da32903e258..fbc694826d2 100644 --- a/libnx/nxmu/nx_eventhandler.c +++ b/libnx/nxmu/nx_eventhandler.c @@ -164,7 +164,7 @@ int nx_eventhandler(NXHANDLE handle) } else { - gerr("mq_receive failed: %d\n", errno); + gerr("ERROR: mq_receive failed: %d\n", errno); return ERROR; } } @@ -254,7 +254,8 @@ int nx_eventhandler(NXHANDLE handle) break; default: - gerr("Unrecognized message opcode: %d\n", ((FAR struct nxsvrmsg_s *)buffer)->msgid); + gerr("ERROR: Unrecognized message opcode: %d\n", + ((FAR struct nxsvrmsg_s *)buffer)->msgid); break; } diff --git a/libnx/nxmu/nx_getrectangle.c b/libnx/nxmu/nx_getrectangle.c index 9fd53d9fcf9..3bac5a3ae9b 100644 --- a/libnx/nxmu/nx_getrectangle.c +++ b/libnx/nxmu/nx_getrectangle.c @@ -127,7 +127,7 @@ int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, if (ret != OK) { - gerr("sem_init failed: %d\n", errno); + gerr("ERROR: sem_init failed: %d\n", errno); return ret; } diff --git a/libnx/nxmu/nxmu_sendserver.c b/libnx/nxmu/nxmu_sendserver.c index 6400cf07bbe..59bd5b795df 100644 --- a/libnx/nxmu/nxmu_sendserver.c +++ b/libnx/nxmu/nxmu_sendserver.c @@ -105,7 +105,7 @@ int nxmu_sendserver(FAR struct nxfe_conn_s *conn, FAR const void *msg, ret = mq_send(conn->cwrmq, msg, msglen, NX_SVRMSG_PRIO); if (ret < 0) { - gerr("mq_send failed: %d\n", errno); + gerr("ERROR: mq_send failed: %d\n", errno); } return ret; diff --git a/libxx/libxx_new.cxx b/libxx/libxx_new.cxx index 953da41fd04..83d2b000099 100644 --- a/libxx/libxx_new.cxx +++ b/libxx/libxx_new.cxx @@ -93,7 +93,7 @@ void *operator new(unsigned int nbytes) // Oh my.. we are required to return a valid pointer and // we cannot throw an exception! We are bad. - err("Failed to allocate\n"); + err("ERROR: Failed to allocate\n"); } #endif diff --git a/libxx/libxx_newa.cxx b/libxx/libxx_newa.cxx index cc8d9a18696..3dfb53dbd25 100644 --- a/libxx/libxx_newa.cxx +++ b/libxx/libxx_newa.cxx @@ -93,7 +93,7 @@ void *operator new[](unsigned int nbytes) // Oh my.. we are required to return a valid pointer and // we cannot throw an exception! We are bad. - err("Failed to allocate\n"); + err("ERROR: Failed to allocate\n"); } #endif diff --git a/libxx/libxx_stdthrow.cxx b/libxx/libxx_stdthrow.cxx index 12eae86485e..18960a266f6 100644 --- a/libxx/libxx_stdthrow.cxx +++ b/libxx/libxx_stdthrow.cxx @@ -56,25 +56,25 @@ namespace std { void __throw_out_of_range(const char*) { - err("C++: Vector .at() with argument out of range\n"); + err("ERROR: C++: Vector .at() with argument out of range\n"); abort(); } void __throw_length_error(const char*) { - err("C++: Vector resize to excessive length\n"); + err("ERROR: C++: Vector resize to excessive length\n"); abort(); } void __throw_bad_alloc() { - err("C++: Bad allocation\n"); + err("ERROR: C++: Bad allocation\n"); abort(); } void __throw_bad_function_call() { - err("C++: Bad function call\n"); + err("ERROR: C++: Bad function call\n"); abort(); } } diff --git a/mm/mm_gran/mm_gran.h b/mm/mm_gran/mm_gran.h index 46857886113..fb7378ac587 100644 --- a/mm/mm_gran/mm_gran.h +++ b/mm/mm_gran/mm_gran.h @@ -64,18 +64,22 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG_GRAM # define granerr(format, ...) err(format, ##__VA_ARGS__) +# define granwarn(format, ...) warn(format, ##__VA_ARGS__) # define graninfo(format, ...) info(format, ##__VA_ARGS__) # else # define granerr(format, ...) merr(format, ##__VA_ARGS__) +# define granwarn(format, ...) mwarn(format, ##__VA_ARGS__) # define graninfo(format, ...) minfo(format, ##__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG_GRAM # define granerr err +# define granwarn warn # define graninfo info # else -# define granerr (void) -# define graninfo (void) +# define granerr merr +# define granwarn mwarn +# define graninfo minfo # endif #endif diff --git a/mm/mm_gran/mm_pgalloc.c b/mm/mm_gran/mm_pgalloc.c index 64e1a0ede8a..f65e0b89829 100644 --- a/mm/mm_gran/mm_pgalloc.c +++ b/mm/mm_gran/mm_pgalloc.c @@ -67,18 +67,22 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG_PGALLOC # define pgaerr(format, ...) err(format, ##__VA_ARGS__) +# define pgawarn(format, ...) warn(format, ##__VA_ARGS__) # define pgainfo(format, ...) info(format, ##__VA_ARGS__) # else # define pgaerr(format, ...) merr(format, ##__VA_ARGS__) +# define pgawarn(format, ...) mwarn(format, ##__VA_ARGS__) # define pgainfo(format, ...) minfo(format, ##__VA_ARGS__) # endif #else # ifdef CONFIG_DEBUG_PGALLOC # define pgaerr err +# define pgawarn warn # define pgainfo info # else -# define pgaerr (void) -# define pgainfo (void) +# define pgaerr merr +# define pgawarn mwarn +# define pgainfo minfo # endif #endif diff --git a/mm/mm_heap/mm_initialize.c b/mm/mm_heap/mm_initialize.c index bb76d765440..d92a8d8de76 100644 --- a/mm/mm_heap/mm_initialize.c +++ b/mm/mm_heap/mm_initialize.c @@ -96,7 +96,7 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart, heapend = MM_ALIGN_DOWN((uintptr_t)heapstart + (uintptr_t)heapsize); heapsize = heapend - heapbase; - mllerr("Region %d: base=%p size=%u\n", IDX+1, heapstart, heapsize); + mllinfo("Region %d: base=%p size=%u\n", IDX+1, heapstart, heapsize); /* Add the size of this region to the total size of the heap */ @@ -157,7 +157,7 @@ void mm_initialize(FAR struct mm_heap_s *heap, FAR void *heapstart, { int i; - mllerr("Heap: start=%p size=%u\n", heapstart, heapsize); + mllinfo("Heap: start=%p size=%u\n", heapstart, heapsize); /* The following two lines have cause problems for some older ZiLog * compilers in the past (but not the more recent). Life is easier if we diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c index 84457eef774..3efa15259f7 100644 --- a/mm/mm_heap/mm_malloc.c +++ b/mm/mm_heap/mm_malloc.c @@ -186,7 +186,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) #ifdef CONFIG_DEBUG_MM if (!ret) { - merr("Allocation failed, size %d\n", size); + mwarn("WARNING: Allocation failed, size %d\n", size); } else { diff --git a/mm/mm_heap/mm_sem.c b/mm/mm_heap/mm_sem.c index d0b67758541..bd39606b5c5 100644 --- a/mm/mm_heap/mm_sem.c +++ b/mm/mm_heap/mm_sem.c @@ -157,7 +157,7 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap) { /* Take the semaphore (perhaps waiting) */ - msemerr("PID=%d taking\n", my_pid); + mseminfo("PID=%d taking\n", my_pid); while (sem_wait(&heap->mm_semaphore) != 0) { /* The only case that an error should occur here is if @@ -173,7 +173,7 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap) heap->mm_counts_held = 1; } - msemerr("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held); + mseminfo("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held); } /**************************************************************************** @@ -201,13 +201,13 @@ void mm_givesemaphore(FAR struct mm_heap_s *heap) /* Yes, just release one count and return */ heap->mm_counts_held--; - msemerr("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held); + mseminfo("Holder=%d count=%d\n", heap->mm_holder, heap->mm_counts_held); } else { /* Nope, this is the last reference I have */ - msemerr("PID=%d giving\n", my_pid); + mseminfo("PID=%d giving\n", my_pid); heap->mm_holder = -1; heap->mm_counts_held = 0; diff --git a/mm/shm/shm_initialize.c b/mm/shm/shm_initialize.c index 38c82f2b935..f20e7b0873f 100644 --- a/mm/shm/shm_initialize.c +++ b/mm/shm/shm_initialize.c @@ -127,7 +127,7 @@ int shm_group_initialize(FAR struct task_group_s *group) if (!group->tg_shm.gs_handle) { - shmerr("gran_initialize() failed\n"); + shmerr("ERROR: gran_initialize() failed\n"); return -ENOMEM; } diff --git a/mm/shm/shmat.c b/mm/shm/shmat.c index bec7c5e87ab..6b677e5ddd0 100644 --- a/mm/shm/shmat.c +++ b/mm/shm/shmat.c @@ -136,7 +136,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmerr("sem_wait failed: %d\n", ret); + shmerr("ERROR: sem_wait failed: %d\n", ret); goto errout; } @@ -146,7 +146,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) region->sr_ds.shm_segsz); if (vaddr == 0) { - shmerr("gran_alloc() failed\n"); + shmerr("ERROR: gran_alloc() failed\n"); ret = -ENOMEM; goto errout_with_semaphore; } @@ -160,7 +160,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) ret = up_shmat(region->sr_pages, npages, vaddr); if (ret < 0) { - shmerr("up_shmat() failed\n"); + shmerr("ERROR: up_shmat() failed\n"); goto errout_with_vaddr; } diff --git a/mm/shm/shmctl.c b/mm/shm/shmctl.c index e5eea7abcc9..4e5ac13c5f6 100644 --- a/mm/shm/shmctl.c +++ b/mm/shm/shmctl.c @@ -134,7 +134,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmerr("sem_wait failed: %d\n", ret); + shmerr("ERROR: sem_wait failed: %d\n", ret); return ret; } @@ -190,7 +190,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf) break; default: - shmerr("Unrecognized command: %d\n", cmd); + shmerr("ERROR: Unrecognized command: %d\n", cmd); ret = -EINVAL; goto errout_with_semaphore; } diff --git a/mm/shm/shmdt.c b/mm/shm/shmdt.c index 2014674ed20..55c2fd05544 100644 --- a/mm/shm/shmdt.c +++ b/mm/shm/shmdt.c @@ -106,7 +106,7 @@ int shmdt(FAR const void *shmaddr) if (shmid >= CONFIG_ARCH_SHM_MAXREGIONS) { - shmerr("No region matching this virtual address: %p\n", shmaddr); + shmerr("ERROR: No region matching this virtual address: %p\n", shmaddr); ret = -EINVAL; goto errout_with_errno; } @@ -121,7 +121,7 @@ int shmdt(FAR const void *shmaddr) ret = sem_wait(®ion->sr_sem); if (ret < 0) { - shmerr("sem_wait failed: %d\n", ret); + shmerr("ERROR: sem_wait failed: %d\n", ret); goto errout; } @@ -141,7 +141,7 @@ int shmdt(FAR const void *shmaddr) ret = up_shmdt((uintptr_t)shmaddr, npages); if (ret < 0) { - shmerr("up_shmdt() failed\n"); + shmerr("ERROR: up_shmdt() failed\n"); } /* Indicate that there is no longer any mapping for this region. */ diff --git a/mm/shm/shmget.c b/mm/shm/shmget.c index 10d5e3ed2b0..460850605aa 100644 --- a/mm/shm/shmget.c +++ b/mm/shm/shmget.c @@ -188,7 +188,7 @@ static int shm_extend(int shmid, size_t size) region->sr_pages[pgalloc] = mm_pgalloc(1); if (region->sr_pages[pgalloc] == 0) { - shmerr("mm_pgalloc(1) failed\n"); + shmerr("ERROR: mm_pgalloc(1) failed\n"); break; } @@ -249,7 +249,7 @@ static int shm_create(key_t key, size_t size, int shmflg) ret = shm_reserve(key, shmflg); if (ret < 0) { - shmerr("shm_reserve failed: %d\n", ret); + shmerr("ERROR: shm_reserve failed: %d\n", ret); return ret; } @@ -400,7 +400,7 @@ int shmget(key_t key, size_t size, int shmflg) ret = shm_create(key, size, shmflg); if (ret < 0) { - shmerr("shm_create failed: %d\n", ret); + shmerr("ERROR: shm_create failed: %d\n", ret); goto errout_with_semaphore; } @@ -443,7 +443,7 @@ int shmget(key_t key, size_t size, int shmflg) ret = shm_extend(shmid, size); if (ret < 0) { - shmerr("shm_create failed: %d\n", ret); + shmerr("ERROR: shm_create failed: %d\n", ret); goto errout_with_semaphore; } }