diff options
| author | Arda <[email protected]> | 2015-03-10 12:01:25 +0800 |
|---|---|---|
| committer | Arda <[email protected]> | 2015-03-10 12:01:25 +0800 |
| commit | 4a9c3fae2900da71cdf026063679d2c25f266fd7 (patch) | |
| tree | 2fba8aec09a671cc36d281365351003a988eb57d /src | |
| parent | 5fe489a3949cdbb947d3c719a7ef958a37e8d826 (diff) | |
| parent | 89ceb7dc27895225bc221d22c035d5cc8802a256 (diff) | |
Merge pull request #3 from RT-Thread/master
sync with official source
Diffstat (limited to 'src')
| -rw-r--r-- | src/kservice.c | 8 | ||||
| -rw-r--r-- | src/memheap.c | 2 | ||||
| -rw-r--r-- | src/module.c | 2 | ||||
| -rw-r--r-- | src/object.c | 8 |
4 files changed, 11 insertions, 9 deletions
diff --git a/src/kservice.c b/src/kservice.c index 12878e67d1..b5dc92b091 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -513,7 +513,7 @@ void rt_show_version(void) rt_kprintf("- RT - Thread Operating System\n"); rt_kprintf(" / | \\ %d.%d.%d build %s\n", RT_VERSION, RT_SUBVERSION, RT_REVISION, __DATE__); - rt_kprintf(" 2006 - 2013 Copyright by rt-thread team\n"); + rt_kprintf(" 2006 - 2015 Copyright by rt-thread team\n"); } RTM_EXPORT(rt_show_version); @@ -1114,11 +1114,11 @@ void rt_kprintf(const char *fmt, ...) } else { - rt_uint16_t old_flag = _console_device->flag; + rt_uint16_t old_flag = _console_device->open_flag; - _console_device->flag |= RT_DEVICE_FLAG_STREAM; + _console_device->open_flag |= RT_DEVICE_FLAG_STREAM; rt_device_write(_console_device, 0, rt_log_buf, length); - _console_device->flag = old_flag; + _console_device->open_flag = old_flag; } #else rt_hw_console_output(rt_log_buf); diff --git a/src/memheap.c b/src/memheap.c index e19c83a08c..adb5c86053 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -517,6 +517,8 @@ void rt_memheap_free(void *ptr) /* check magic */ RT_ASSERT((header_ptr->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC); + /* check whether this block of memory has been over-written. */ + RT_ASSERT((header_ptr->next->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC); /* get pool ptr */ heap = header_ptr->pool_ptr; diff --git a/src/module.c b/src/module.c index 5d5d02c580..1c20de731d 100644 --- a/src/module.c +++ b/src/module.c @@ -82,7 +82,7 @@ static struct rt_module_symtab *_rt_module_symtab_end = RT_NULL; */ int rt_system_module_init(void) { -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__CC_ARM) extern int __rtmsymtab_start; extern int __rtmsymtab_end; diff --git a/src/object.c b/src/object.c index 32dc0f2384..6c5a1a026f 100644 --- a/src/object.c +++ b/src/object.c @@ -417,7 +417,7 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type) { const char *name_ptr; int module_name_length; - + name_ptr = name; while ((*name_ptr != '\0') && (*name_ptr != '/')) name_ptr ++; @@ -434,13 +434,13 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type) /* find module */ information = &rt_object_container[RT_Object_Class_Module]; - for (node = information->object_list.next; + for (node = information->object_list.next; node != &(information->object_list); node = node->next) { object = rt_list_entry(node, struct rt_object, list); if ((rt_strncmp(object->name, name, module_name_length) == 0) && - module_name_length == RT_NAME_MAX || object->name[module_name_length] == '\0') + (module_name_length == RT_NAME_MAX || object->name[module_name_length] == '\0')) { /* get module */ module = (struct rt_module*)object; @@ -450,7 +450,7 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type) rt_exit_critical(); /* there is no this module inside the system */ - if (module == RT_NULL) return RT_NULL; + if (module == RT_NULL) return RT_NULL; /* get the object pool of module */ information = &(module->module_object[type]); |
