serial: do onthing if the size of read/write is zero

Return early if the size is 0 as there is nothing to do.
serial: set the errno if and only if in thread context

The errno is associated with threads. It will crash the thread if we set
it in interrupt context.
k60: add rt_interrupt_{enter,leave} in IRQHandler
Merge pull request #186 from grissiom/serial-fix

Serial fix
Revert "serial: set the errno if and only if in thread context"

This reverts commit 07bd09fc0fc256e5c53ad3c6157802fd94c9910c.
The validation of the context is done with in `rt_set_errno`. So it's
safe to call it here.
Merge pull request #187 from grissiom/serial-fix

Revert "serial: set the errno if and only if in thread context"
simulatr: print error messages when RTT_RTGUI is invalid
Merge pull request #188 from prife/master

simulatr: print error messages when RTT_RTGUI is invalid
Fix hardfault bug for gcc port

for 2013-02-20 aozima commmit "port for gcc", but the commit is
not tested,and the kernel is breakdown in context_gcc.S, the file
is a copy from cortex-m3,but not port for cortex-m0, so i complete
this port for aozima, test it in stm32f0discovery board ,
and it works fine.
Merge pull request #189 from bright-pan/master

Fix hardfault bug for gcc port
add modbus master to freemodbus

Signed-off-by: armink <armink.ztl@gmail.com>
add SConscript for freemodbus

Signed-off-by: armink <armink.ztl@gmail.com>
Merge pull request #192 from armink/master

net: add freemodbus master and slave v1.6.0
freemodbus: fix eol

On Windows platform, please set `autocrlf = true` and on Linux, please
set `autocrlf = input`.
Merge pull request #194 from grissiom/eol-issue

freemodbus: fix eol
It is a big patch for stm32f0x, see the fellow :

    1. fix heap management for stm32f0xx(SRAM=8k)
    2. add USART1, USART2 driver for stm32f051R8
    3. fix finsh support for stm32f0x
    4. fix board components initial for stm32f0x and open debug msg
    5. add led driver(pc9) and test thread for stm32f0discovery board
    6. add init thread for stm32f0x do components initial
    7. add rcc initial for stm32f0x in rt_hw_board_init()
    8. add print rcc freq information function

the console output example is:
    SYSCLK_Frequency is 48000000HZ
    PCLK_Frequency is 48000000HZ
    HCLK_Frequency is 48000000HZ
    CECCLK_Frequency is 32786HZ
    ADCCLK_Frequency is 14000000HZ
    USART1CLK_Frequency is 48000000HZ
    I2C1CLK_Frequency is 8000000HZ
    SystemCoreClock is 48000000HZ
    initialize rti_start:0 done

    \ | /
    - RT -     Thread Operating System
    / | \     1.2.0 build Nov 15 2013
    2006 - 2013 Copyright by rt-thread team
    do components intialization.
    initialize rti_board_end:0 done
    initialize rt_hw_led_init:32768 done
    initialize finsh_system_init:0 done
    finsh>>
cortex-r4: let svc mode reuse the stack of IRQ on startup

As the svc stack is the stack of threads, there is no need to allocate a
separate stack for the startup. Reuse the IRQ stack should be OK.

Tested on rm48 board.
cortex-r4: use byte to allocate the stack

Unit of "byte" is more intuitive than "long".
Merge pull request #200 from grissiom/cortex-r4

Cortex r4
finsh: fix finsh device setting

1. rt_console_get_device should be call to set shell device only when it is null, or it will make finsh_set_device useless.
2. RT_USING_CONSOLE can be disabled in bsp/rtconfig.h