Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 82474ef in mainline


Ignore:
Timestamp:
2010-02-03T12:45:26Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
210e50a
Parents:
c1d3549
Message:

improve the GCC contract of halt(), make it explicitly noreturn

Location:
kernel
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/include/asm.h

    rc1d3549 r82474ef  
    4949
    5050
    51 static inline void cpu_halt(void)
     51static inline __attribute__((noreturn)) void cpu_halt(void)
    5252{
    5353        /* On real hardware this should stop processing further
  • kernel/arch/amd64/include/asm.h

    rc1d3549 r82474ef  
    6868}
    6969
    70 static inline void cpu_halt(void)
    71 {
    72         asm volatile (
    73                 "0:\n"
    74                 "       hlt\n"
    75                 "       jmp 0b\n"
    76         );
     70static inline void __attribute__((noreturn)) cpu_halt(void)
     71{
     72        while (true) {
     73                asm volatile (
     74                        "hlt\n"
     75                );
     76        }
    7777}
    7878
  • kernel/arch/arm32/include/asm.h

    rc1d3549 r82474ef  
    9696}
    9797
    98 extern void cpu_halt(void);
     98extern void cpu_halt(void) __attribute__((noreturn));
    9999extern void asm_delay_loop(uint32_t t);
    100100extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg,
  • kernel/arch/arm32/src/arm32.c

    rc1d3549 r82474ef  
    155155void cpu_halt(void)
    156156{
    157         machine_cpu_halt();
     157        while (true)
     158                machine_cpu_halt();
    158159}
    159160
     
    162163{
    163164        /* not implemented */
    164         while (1);
     165        while (true);
    165166}
    166167
  • kernel/arch/ia32/include/asm.h

    rc1d3549 r82474ef  
    6060 *
    6161 */
    62 static inline void cpu_halt(void)
    63 {
    64         asm volatile (
    65                 "0:\n"
    66                 "       hlt\n"
    67                 "       jmp 0b\n"
    68         );
     62static inline __attribute__((noreturn)) void cpu_halt(void)
     63{
     64        while (true) {
     65                asm volatile (
     66                        "hlt\n"
     67                );
     68        }
    6969}
    7070
  • kernel/arch/ia64/include/asm.h

    rc1d3549 r82474ef  
    428428}
    429429
    430 extern void cpu_halt(void);
     430extern void cpu_halt(void) __attribute__((noreturn));
    431431extern void cpu_sleep(void);
    432432extern void asm_delay_loop(uint32_t t);
  • kernel/arch/mips32/include/asm.h

    rc1d3549 r82474ef  
    6666}
    6767
    68 extern void cpu_halt(void);
     68extern void cpu_halt(void) __attribute__((noreturn));
    6969extern void asm_delay_loop(uint32_t t);
    7070extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg,
  • kernel/arch/ppc32/include/asm.h

    rc1d3549 r82474ef  
    2727 */
    2828
    29 /** @addtogroup ppc32   
     29/** @addtogroup ppc32
    3030 * @{
    3131 */
     
    146146}
    147147
    148 void cpu_halt(void);
    149 void asm_delay_loop(uint32_t t);
    150 
     148extern void cpu_halt(void) __attribute__((noreturn));
     149extern void asm_delay_loop(uint32_t t);
    151150extern void userspace_asm(uintptr_t uspace_uarg, uintptr_t stack, uintptr_t entry);
    152151
    153152static inline void pio_write_8(ioport8_t *port, uint8_t v)
    154153{
    155         *port = v;     
     154        *port = v;
    156155}
    157156
    158157static inline void pio_write_16(ioport16_t *port, uint16_t v)
    159158{
    160         *port = v;     
     159        *port = v;
    161160}
    162161
    163162static inline void pio_write_32(ioport32_t *port, uint32_t v)
    164163{
    165         *port = v;     
     164        *port = v;
    166165}
    167166
    168167static inline uint8_t pio_read_8(ioport8_t *port)
    169168{
    170         return *port; 
     169        return *port;
    171170}
    172171
    173172static inline uint16_t pio_read_16(ioport16_t *port)
    174173{
    175         return *port; 
     174        return *port;
    176175}
    177176
    178177static inline uint32_t pio_read_32(ioport32_t *port)
    179178{
    180         return *port; 
     179        return *port;
    181180}
    182181
  • kernel/arch/sparc64/include/asm.h

    rc1d3549 r82474ef  
    430430}
    431431
    432 extern void cpu_halt(void);
     432extern void cpu_halt(void) __attribute__((noreturn));
    433433extern void cpu_sleep(void);
    434434extern void asm_delay_loop(const uint32_t usec);
  • kernel/generic/include/func.h

    rc1d3549 r82474ef  
    4141extern atomic_t haltstate;
    4242
    43 extern void halt(void);
     43extern void halt(void) __attribute__((noreturn));
    4444extern unative_t atoi(const char *text);
    4545extern void order(const uint64_t val, uint64_t *rv, char *suffix);
Note: See TracChangeset for help on using the changeset viewer.