Changeset f74bbaf in mainline
- Timestamp:
- 2007-04-09T06:13:24Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d0b1443
- Parents:
- 261595b
- Location:
- kernel
- Files:
-
- 1 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r261595b rf74bbaf 94 94 ifeq ($(CONFIG_VIRT_IDX_DCACHE),y) 95 95 DEFS += -DCONFIG_VIRT_IDX_DCACHE 96 endif97 98 ifeq ($(CONFIG_POWEROFF),y)99 DEFS += -DCONFIG_POWEROFF100 96 endif 101 97 … … 161 157 generic/src/main/uinit.c \ 162 158 generic/src/main/version.c \ 159 generic/src/main/shutdown.c \ 163 160 generic/src/proc/scheduler.c \ 164 161 generic/src/proc/thread.c \ -
kernel/arch/amd64/src/pm.c
r261595b rf74bbaf 34 34 */ 35 35 36 #include <arch.h> 36 37 #include <arch/pm.h> 37 38 #include <arch/asm.h> … … 228 229 } 229 230 231 /* Reboot the machine by initiating 232 * a triple fault 233 */ 234 void 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 230 249 /** @} 231 250 */ -
kernel/arch/arm32/src/arm32.c
r261595b rf74bbaf 83 83 } 84 84 85 void arch_reboot(void) 86 { 87 // TODO 88 while (1); 89 } 90 85 91 /** @} 86 92 */ -
kernel/arch/ia32/src/pm.c
r261595b rf74bbaf 122 122 { 123 123 idescriptor_t *d; 124 int i;124 unsigned int i; 125 125 126 126 for (i = 0; i < IDT_ITEMS; i++) { … … 231 231 } 232 232 233 /* Reboot the machine by initiating 234 * a triple fault 235 */ 236 void 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 233 255 /** @} 234 256 */ -
kernel/arch/ia32xen/src/ia32xen.c
r261595b rf74bbaf 212 212 } 213 213 214 void arch_reboot(void) 215 { 216 // TODO 217 while (1); 218 } 219 214 220 /** @} 215 221 */ -
kernel/arch/ia64/src/ia64.c
r261595b rf74bbaf 177 177 } 178 178 179 void arch_reboot(void) 180 { 181 // TODO 182 while (1); 183 } 184 179 185 /** @} 180 186 */ -
kernel/arch/mips32/src/mips32.c
r261595b rf74bbaf 179 179 } 180 180 181 void arch_reboot(void) 182 { 183 // TODO 184 while (1); 185 } 186 181 187 /** @} 182 188 */ -
kernel/arch/ppc32/src/drivers/cuda.c
r261595b rf74bbaf 49 49 #define PACKET_CUDA 0x01 50 50 51 #define CUDA_POWERDOWN 0x0a 51 #define CUDA_POWERDOWN 0x0a 52 #define CUDA_RESET 0x11 52 53 53 54 #define RS 0x200 … … 192 193 193 194 194 void send_packet(const uint8_t kind, index_t count, ...);195 196 197 195 static void receive_packet(uint8_t *kind, index_t count, uint8_t data[]) 198 196 { … … 317 315 318 316 319 void send_packet(const uint8_t kind, index_t count, ...)317 static void send_packet(const uint8_t kind, count_t count, ...) 320 318 { 321 319 index_t i; … … 342 340 343 341 void cpu_halt(void) { 344 #ifdef CONFIG_POWEROFF345 send_packet(PACKET_CUDA, 1, CUDA_POWERDOWN);346 #endif347 342 asm volatile ( 348 343 "b 0\n" … … 350 345 } 351 346 347 void arch_reboot(void) { 348 send_packet(PACKET_CUDA, 1, CUDA_RESET); 349 asm volatile ( 350 "b 0\n" 351 ); 352 } 353 352 354 /** @} 353 355 */ -
kernel/arch/ppc64/src/ppc64.c
r261595b rf74bbaf 129 129 { 130 130 } 131 131 132 /** Return console to userspace 132 133 * … … 136 137 } 137 138 139 void arch_reboot(void) 140 { 141 // TODO 142 while (1); 143 } 144 138 145 /** @} 139 146 */ -
kernel/arch/sparc64/src/sparc64.c
r261595b rf74bbaf 156 156 } 157 157 158 void arch_reboot(void) 159 { 160 // TODO 161 while (1); 162 } 163 158 164 /** @} 159 165 */ -
kernel/generic/include/arch.h
r261595b rf74bbaf 75 75 extern void arch_pre_smp_init(void); 76 76 extern void arch_post_smp_init(void); 77 77 78 extern void calibrate_delay_loop(void); 79 80 extern void reboot(void); 81 extern void arch_reboot(void); 78 82 79 83 #endif -
kernel/generic/include/proc/task.h
r261595b rf74bbaf 112 112 113 113 extern void task_init(void); 114 extern void task_done(void); 114 115 extern task_t *task_create(as_t *as, char *name); 115 116 extern void task_destroy(task_t *t); -
kernel/generic/src/console/cmd.c
r261595b rf74bbaf 49 49 #include <adt/list.h> 50 50 #include <arch.h> 51 #include <config.h> 51 52 #include <func.h> 52 53 #include <macros.h> … … 80 81 static cmd_info_t exit_info = { 81 82 .name = "exit", 82 .description = "Exit kconsole", 83 .description = "Exit kconsole.", 84 .argc = 0 85 }; 86 87 static int cmd_reboot(cmd_arg_t *argv); 88 static cmd_info_t reboot_info = { 89 .name = "reboot", 90 .description = "Reboot.", 91 .func = cmd_reboot, 83 92 .argc = 0 84 93 }; … … 430 439 &desc_info, 431 440 &exit_info, 441 &reboot_info, 432 442 &halt_info, 433 443 &help_info, … … 505 515 } 506 516 517 518 /** Reboot the system. 519 * 520 * @param argv Argument vector. 521 * 522 * @return 0 on failure, 1 on success. 523 */ 524 int cmd_reboot(cmd_arg_t *argv) 525 { 526 reboot(); 527 528 /* Not reached */ 529 return 1; 530 } 531 507 532 /** Describe specified command. 508 533 * -
kernel/generic/src/proc/task.c
r261595b rf74bbaf 94 94 } 95 95 96 /** Kill all tasks except the current task. 97 * 98 */ 99 void task_done(void) 100 { 101 task_t *t; 102 do { /* Repeat until there are any tasks except TASK */ 103 104 /* Messing with task structures, avoid deadlock */ 105 ipl_t ipl = interrupts_disable(); 106 spinlock_lock(&tasks_lock); 107 108 t = NULL; 109 link_t *cur; 110 for (cur = tasks_btree.leaf_head.next; cur != &tasks_btree.leaf_head; cur = cur->next) { 111 btree_node_t *node = list_get_instance(cur, btree_node_t, leaf_link); 112 113 unsigned int i; 114 for (i = 0; i < node->keys; i++) { 115 if ((task_t *) node->value[i] != TASK) { 116 t = (task_t *) node->value[i]; 117 break; 118 } 119 } 120 } 121 122 if (t != NULL) { 123 task_id_t id = t->taskid; 124 125 spinlock_unlock(&tasks_lock); 126 interrupts_restore(ipl); 127 128 #ifdef CONFIG_DEBUG 129 printf("Killing task %llu\n", id); 130 #endif 131 task_kill(id); 132 } else { 133 spinlock_unlock(&tasks_lock); 134 interrupts_restore(ipl); 135 } 136 137 } while (t != NULL); 138 } 96 139 97 140 /** Create new task … … 374 417 ipl_t ipl; 375 418 376 /* Messing with t hreadstructures, avoid deadlock */419 /* Messing with task structures, avoid deadlock */ 377 420 ipl = interrupts_disable(); 378 421 spinlock_lock(&tasks_lock); -
kernel/kernel.config
r261595b rf74bbaf 93 93 ! [(ARCH=mips32&MACHINE!=msim&MACHINE!=simics)|ARCH=amd64|ARCH=ia32|ARCH=ia64|ARCH=sparc64|ARCH=ia32xen] CONFIG_FPU_LAZY (y/n) 94 94 95 # Power off on halt96 ! [ARCH=ppc32] CONFIG_POWEROFF (n/y)97 98 95 # Use VHPT 99 96 ! [ARCH=ia64] CONFIG_VHPT (n/y)
Note:
See TracChangeset
for help on using the changeset viewer.