- Timestamp:
- 2006-07-10T20:57:30Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11675207
- Parents:
- 7f1c620
- Location:
- arch/sparc64
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/sparc64/include/asm.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_ASM_H__36 #define __sparc64_ASM_H__35 #ifndef KERN_sparc64_ASM_H_ 36 #define KERN_sparc64_ASM_H_ 37 37 38 38 #include <typedefs.h> … … 305 305 } 306 306 307 308 309 307 void cpu_halt(void); 310 308 void cpu_sleep(void); … … 313 311 #endif 314 312 315 /** @} 316 */ 317 313 /** @} 314 */ -
arch/sparc64/include/atomic.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 100 100 #endif 101 101 102 102 /** @} 103 103 */ 104 -
arch/sparc64/include/barrier.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 70 70 #endif 71 71 72 72 /** @} 73 73 */ 74 -
arch/sparc64/include/console.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_CONSOLE_H__36 #define __sparc64_CONSOLE_H__35 #ifndef KERN_sparc64_CONSOLE_H_ 36 #define KERN_sparc64_CONSOLE_H_ 37 37 38 extern void kofwinput(void *arg);39 38 extern void kkbdpoll(void *arg); 40 39 extern void ofw_sparc64_console_init(void); … … 43 42 #endif 44 43 45 44 /** @} 46 45 */ 47 -
arch/sparc64/include/drivers/fb.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_FB_H__36 #define __sparc64_FB_H__35 #ifndef KERN_sparc64_FB_H_ 36 #define KERN_sparc64_FB_H_ 37 37 38 38 #define FB_PHYS_ADDRESS 0x1c901000000ULL … … 45 45 #endif 46 46 47 47 /** @} 48 48 */ 49 -
arch/sparc64/include/drivers/i8042.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_I8042_H__36 #define __sparc64_I8042_H__35 #ifndef KERN_sparc64_I8042_H_ 36 #define KERN_sparc64_I8042_H_ 37 37 38 38 #include <arch/types.h> … … 72 72 #endif 73 73 74 74 /** @} 75 75 */ 76 -
arch/sparc64/include/elf.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 42 42 #endif 43 43 44 44 /** @} 45 45 */ 46 -
arch/sparc64/include/register.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_REGISTER_H__ 36 #define __sparc64_REGISTER_H__ 35 #ifndef KERN_sparc64_REGISTER_H_ 36 #define KERN_sparc64_REGISTER_H_ 37 38 #ifdef __ASM__ 39 #define PSTATE_IE_BIT 2 40 #define PSTATE_AM_BIT 8 41 #else 37 42 38 43 #include <arch/types.h> … … 107 112 #endif 108 113 109 /** @} 114 #endif 115 116 /** @} 110 117 */ 111 -
arch/sparc64/include/stack.h
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_STACK_H__36 #define __sparc64_STACK_H__35 #ifndef KERN_sparc64_STACK_H_ 36 #define KERN_sparc64_STACK_H_ 37 37 38 38 #define STACK_ITEM_SIZE 8 … … 53 53 #endif 54 54 55 55 /** @} 56 56 */ 57 -
arch/sparc64/include/trap/interrupt.h
r7f1c620 r0ffa3ef5 79 79 /** @} 80 80 */ 81 -
arch/sparc64/src/asm.S
r7f1c620 r0ffa3ef5 27 27 # 28 28 29 #include <arch/stack.h> 30 #include <arch/register.h> 31 29 32 .text 30 33 … … 35 38 .global memcpy_to_uspace_failover_address 36 39 .global memsetb 40 37 41 38 42 memcpy: … … 52 56 nop 53 57 58 .global ofw 59 ofw: 60 save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp 61 set ofw_cif, %l0 62 ldx [%l0], %l0 63 64 rdpr %pstate, %l1 65 and %l1, ~PSTATE_AM_BIT, %l2 66 wrpr %l2, 0, %pstate 67 68 jmpl %l0, %o7 69 mov %i0, %o0 70 71 wrpr %l1, 0, %pstate 72 73 ret 74 restore %o0, 0, %o0 -
arch/sparc64/src/console.c
r7f1c620 r0ffa3ef5 52 52 53 53 static void ofw_sparc64_putchar(chardev_t *d, const char ch); 54 static char ofw_sparc64_getchar(chardev_t *d);55 static void ofw_sparc64_suspend(chardev_t *d);56 static void ofw_sparc64_resume(chardev_t *d);57 58 mutex_t canwork;59 54 60 55 static volatile int ofw_console_active; … … 63 58 static chardev_operations_t ofw_sparc64_console_ops = { 64 59 .write = ofw_sparc64_putchar, 65 .read = ofw_sparc64_getchar,66 .resume = ofw_sparc64_resume,67 .suspend = ofw_sparc64_suspend68 60 }; 69 61 … … 72 64 { 73 65 chardev_initialize("ofw_sparc64_console", &ofw_sparc64_console, &ofw_sparc64_console_ops); 74 stdin = &ofw_sparc64_console;66 stdin = NULL; 75 67 stdout = &ofw_sparc64_console; 76 mutex_initialize(&canwork);77 68 ofw_console_active = 1; 78 69 } … … 95 86 void ofw_sparc64_putchar(chardev_t *d, const char ch) 96 87 { 97 pstate_reg_t pstate;98 99 /*100 * 32-bit OpenFirmware depends on PSTATE.AM bit set.101 */102 pstate.value = pstate_read();103 pstate.am = true;104 pstate_write(pstate.value);105 106 88 if (ch == '\n') 107 89 ofw_putchar('\r'); 108 90 ofw_putchar(ch); 109 110 pstate.am = false;111 pstate_write(pstate.value);112 }113 114 /** Read one character using OpenFirmware.115 *116 * The call is non-blocking.117 *118 * @param d Character device (ignored).119 * @return Character read or zero if no character was read.120 */121 char ofw_sparc64_getchar(chardev_t *d)122 {123 char ch;124 pstate_reg_t pstate;125 126 /*127 * 32-bit OpenFirmware depends on PSTATE.AM bit set.128 */129 pstate.value = pstate_read();130 pstate.am = true;131 pstate_write(pstate.value);132 133 ch = ofw_getchar();134 135 pstate.am = false;136 pstate_write(pstate.value);137 138 return ch;139 }140 141 void ofw_sparc64_suspend(chardev_t *d)142 {143 mutex_lock(&canwork);144 }145 146 void ofw_sparc64_resume(chardev_t *d)147 {148 mutex_unlock(&canwork);149 }150 151 /** Kernel thread for pushing characters read from OFW to input buffer.152 *153 * @param arg Ignored.154 */155 void kofwinput(void *arg)156 {157 158 while (ofw_console_active) {159 char ch = 0;160 161 mutex_lock(&canwork);162 mutex_unlock(&canwork);163 164 ch = ofw_sparc64_getchar(NULL);165 if (ch) {166 if (ch == '\r')167 ch = '\n';168 chardev_push_character(&ofw_sparc64_console, ch);169 }170 thread_usleep(KEYBOARD_POLL_PAUSE);171 }172 91 } 173 92 -
arch/sparc64/src/drivers/i8042.c
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 46 46 } 47 47 48 48 /** @} 49 49 */ 50 -
arch/sparc64/src/mm/frame.c
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ … … 52 52 } 53 53 54 54 /** @} 55 55 */ 56 -
arch/sparc64/src/mm/memory_init.c
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ … … 42 42 } 43 43 44 44 /** @} 45 45 */ 46 46 -
arch/sparc64/src/proc/scheduler.c
r7f1c620 r0ffa3ef5 27 27 */ 28 28 29 29 /** @addtogroup sparc64proc 30 30 * @{ 31 31 */ … … 80 80 } 81 81 82 82 /** @} 83 83 */ 84 -
arch/sparc64/src/sparc64.c
r7f1c620 r0ffa3ef5 41 41 #include <console/console.h> 42 42 43 #include <print.h> 44 #include <genarch/ofw/ofw.h> 45 #include <arch/asm.h> 46 #include <arch/register.h> 43 47 void arch_pre_mm_init(void) 44 48 { 45 49 interrupts_disable(); 46 50 ofw_sparc64_console_init(); 51 47 52 trap_init(); 48 53 tick_init(); … … 61 66 { 62 67 thread_t *t; 63 64 /*65 * Create thread that reads characters from OFW's input.66 */67 t = thread_create(kofwinput, NULL, TASK, 0, "kofwinput");68 if (!t)69 panic("cannot create kofwinput\n");70 thread_ready(t);71 68 72 69 /* -
arch/sparc64/src/start.S
r7f1c620 r0ffa3ef5 28 28 29 29 #include <arch/boot/boot.h> 30 #include <arch/register.h> 30 31 31 32 .register %g2, #scratch … … 38 39 /* 39 40 * Here is where the kernel is passed control. 40 * The code must be position independent until41 * the kernel relocates itself to its VMA.42 41 */ 43 42 … … 46 45 flushw ! flush all but the active register window 47 46 48 set ofw, %l0 47 rdpr %pstate, %l0 48 and %l0, ~PSTATE_AM_BIT, %l0 49 wrpr %l0, 0, %pstate 50 51 set ofw_cif, %l0 49 52 50 53 call ofw_init
Note:
See TracChangeset
for help on using the changeset viewer.