Changeset f74bbaf in mainline for kernel/arch


Ignore:
Timestamp:
2007-04-09T06:13:24Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d0b1443
Parents:
261595b
Message:

start shutdown infrastructure

Location:
kernel/arch
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/pm.c

    r261595b rf74bbaf  
    3434 */
    3535
     36#include <arch.h>
    3637#include <arch/pm.h>
    3738#include <arch/asm.h>
     
    228229}
    229230
     231/* Reboot the machine by initiating
     232 * a triple fault
     233 */
     234void arch_reboot(void)
     235{
     236        preemption_disable();
     237        ipl_t ipl = interrupts_disable();
     238       
     239        memsetb((uintptr_t) idt, sizeof(idt), 0);
     240        idtr_load(&idtr);
     241       
     242        interrupts_restore(ipl);
     243        asm volatile (
     244                "int $0x03\n"
     245                "hlt\n"
     246        );
     247}
     248
    230249/** @}
    231250 */
  • kernel/arch/arm32/src/arm32.c

    r261595b rf74bbaf  
    8383}
    8484
     85void arch_reboot(void)
     86{
     87        // TODO
     88        while (1);
     89}
     90
    8591/** @}
    8692 */
  • kernel/arch/ia32/src/pm.c

    r261595b rf74bbaf  
    122122{
    123123        idescriptor_t *d;
    124         int i;
     124        unsigned int i;
    125125
    126126        for (i = 0; i < IDT_ITEMS; i++) {
     
    231231}
    232232
     233/* Reboot the machine by initiating
     234 * a triple fault
     235 */
     236void arch_reboot(void)
     237{
     238        preemption_disable();
     239        ipl_t ipl = interrupts_disable();
     240       
     241        memsetb((uintptr_t) idt, sizeof(idt), 0);
     242       
     243        ptr_16_32_t idtr;
     244        idtr.limit = sizeof(idt);
     245        idtr.base = (uintptr_t) idt;
     246        idtr_load(&idtr);
     247       
     248        interrupts_restore(ipl);
     249        asm volatile (
     250                "int $0x03\n"
     251                "hlt\n"
     252        );
     253}
     254
    233255/** @}
    234256 */
  • kernel/arch/ia32xen/src/ia32xen.c

    r261595b rf74bbaf  
    212212}
    213213
     214void arch_reboot(void)
     215{
     216        // TODO
     217        while (1);
     218}
     219
    214220/** @}
    215221 */
  • kernel/arch/ia64/src/ia64.c

    r261595b rf74bbaf  
    177177}
    178178
     179void arch_reboot(void)
     180{
     181        // TODO
     182        while (1);
     183}
     184
    179185/** @}
    180186 */
  • kernel/arch/mips32/src/mips32.c

    r261595b rf74bbaf  
    179179}
    180180
     181void arch_reboot(void)
     182{
     183        // TODO
     184        while (1);
     185}
     186
    181187/** @}
    182188 */
  • kernel/arch/ppc32/src/drivers/cuda.c

    r261595b rf74bbaf  
    4949#define PACKET_CUDA 0x01
    5050
    51 #define CUDA_POWERDOWN 0x0a
     51#define CUDA_POWERDOWN  0x0a
     52#define CUDA_RESET              0x11
    5253
    5354#define RS 0x200
     
    192193
    193194
    194 void send_packet(const uint8_t kind, index_t count, ...);
    195 
    196 
    197195static void receive_packet(uint8_t *kind, index_t count, uint8_t data[])
    198196{
     
    317315
    318316
    319 void send_packet(const uint8_t kind, index_t count, ...)
     317static void send_packet(const uint8_t kind, count_t count, ...)
    320318{
    321319        index_t i;
     
    342340
    343341void cpu_halt(void) {
    344 #ifdef CONFIG_POWEROFF
    345         send_packet(PACKET_CUDA, 1, CUDA_POWERDOWN);
    346 #endif
    347342        asm volatile (
    348343                "b 0\n"
     
    350345}
    351346
     347void arch_reboot(void) {
     348        send_packet(PACKET_CUDA, 1, CUDA_RESET);
     349        asm volatile (
     350                "b 0\n"
     351        );
     352}
     353
    352354/** @}
    353355 */
  • kernel/arch/ppc64/src/ppc64.c

    r261595b rf74bbaf  
    129129{
    130130}
     131
    131132/** Return console to userspace
    132133 *
     
    136137}
    137138
     139void arch_reboot(void)
     140{
     141        // TODO
     142        while (1);
     143}
     144
    138145/** @}
    139146 */
  • kernel/arch/sparc64/src/sparc64.c

    r261595b rf74bbaf  
    156156}
    157157
     158void arch_reboot(void)
     159{
     160        // TODO
     161        while (1);
     162}
     163
    158164/** @}
    159165 */
Note: See TracChangeset for help on using the changeset viewer.