*************************************************************************** Options: -O2 -fomit-frame-pointer -mabi=apcs-gnu Settings: MCK=48.054857, MC_FMR = AT91C_MC_FWS_1FWS (1 wait state) *************************************************************************** *** ChibiOS/RT test suite *** *** Kernel: 2.4.0 *** Compiled: Jan 22 2012 - 13:03:08 *** Compiler: GCC 4.6.2 *** Architecture: ARM7 *** Core Variant: ARM7TDMI *** Port Info: Pure THUMB mode *** Platform: AT91SAM7x *** Test Board: Olimex SAM7-EX256 ---------------------------------------------------------------------------- --- Test Case 1.1 (Threads, enqueuing test #1) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 1.2 (Threads, enqueuing test #2) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 1.3 (Threads, priority change) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 1.4 (Threads, delays) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 2.1 (Semaphores, enqueuing) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 2.2 (Semaphores, timeout) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 2.3 (Semaphores, atomic signal-wait) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 2.4 (Binary Semaphores, functionality) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.1 (Mutexes, priority enqueuing test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.2 (Mutexes, priority inheritance, simple case) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.3 (Mutexes, priority inheritance, complex case) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.4 (Mutexes, priority return) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.5 (Mutexes, status) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.6 (CondVar, signal test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.7 (CondVar, broadcast test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.8 (CondVar, boost test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 4.1 (Messages, loop) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 5.1 (Mailboxes, queuing and timeouts) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 6.1 (Events, registration and dispatch) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 6.2 (Events, wait and broadcast) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 6.3 (Events, timeouts) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 7.1 (Heap, allocation and fragmentation test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 8.1 (Memory Pools, queue/dequeue) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.1 (Dynamic APIs, threads creation from heap) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.2 (Dynamic APIs, threads creation from memory pool) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.3 (Dynamic APIs, registry and references) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 10.1 (Queues, input queues) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 10.2 (Queues, output queues) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) --- Score : 107489 msgs/S, 214978 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) --- Score : 88253 msgs/S, 176506 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Benchmark, messages #3) --- Score : 88253 msgs/S, 176506 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Benchmark, context switch) --- Score : 402392 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) --- Score : 67753 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) --- Score : 101772 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) --- Score : 28388 reschedules/S, 170328 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) --- Score : 199720 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) --- Score : 289356 bytes/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Benchmark, virtual timers set/reset) --- Score : 323198 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Benchmark, semaphores wait/signal) --- Score : 364448 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (Benchmark, mutexes lock/unlock) --- Score : 256824 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) --- System: 364 bytes --- Thread: 72 bytes --- Timer : 20 bytes --- Semaph: 12 bytes --- EventS: 4 bytes --- EventL: 12 bytes --- Mutex : 16 bytes --- CondV.: 8 bytes --- Queue : 32 bytes --- MailB.: 40 bytes --- Result: SUCCESS ---------------------------------------------------------------------------- Final result: SUCCESS n122' href='#n122'>122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
#include <os.h>
#include <xen/features.h>
.section __xen_guest
.ascii "GUEST_OS=Mini-OS"
.ascii ",XEN_VER=xen-3.0"
.ascii ",VIRT_BASE=0x0" /* &_text from minios_x86_64.lds */
.ascii ",ELF_PADDR_OFFSET=0x0"
.ascii ",HYPERCALL_PAGE=0x2"
.ascii ",LOADER=generic"
.byte 0
.text
#define ENTRY(X) .globl X ; X :
.globl _start, shared_info, hypercall_page
_start:
cld
movq stack_start(%rip),%rsp
movq %rsi,%rdi
call start_kernel
stack_start:
.quad stack+8192
/* Unpleasant -- the PTE that maps this page is actually overwritten */
/* to map the real shared-info page! :-) */
.org 0x1000
shared_info:
.org 0x2000
hypercall_page:
.org 0x3000
/* Offsets into shared_info_t. */
#define evtchn_upcall_pending /* 0 */
#define evtchn_upcall_mask 1
NMI_MASK = 0x80000000
#define RDI 112
#define ORIG_RAX 120 /* + error_code */
#define EFLAGS 144
#define REST_SKIP 6*8
.macro SAVE_REST
subq $REST_SKIP,%rsp
# CFI_ADJUST_CFA_OFFSET REST_SKIP
movq %rbx,5*8(%rsp)
# CFI_REL_OFFSET rbx,5*8
movq %rbp,4*8(%rsp)
# CFI_REL_OFFSET rbp,4*8
movq %r12,3*8(%rsp)
# CFI_REL_OFFSET r12,3*8
movq %r13,2*8(%rsp)
# CFI_REL_OFFSET r13,2*8
movq %r14,1*8(%rsp)
# CFI_REL_OFFSET r14,1*8
movq %r15,(%rsp)
# CFI_REL_OFFSET r15,0*8
.endm
.macro RESTORE_REST
movq (%rsp),%r15
# CFI_RESTORE r15
movq 1*8(%rsp),%r14
# CFI_RESTORE r14
movq 2*8(%rsp),%r13
# CFI_RESTORE r13
movq 3*8(%rsp),%r12
# CFI_RESTORE r12
movq 4*8(%rsp),%rbp
# CFI_RESTORE rbp
movq 5*8(%rsp),%rbx
# CFI_RESTORE rbx
addq $REST_SKIP,%rsp
# CFI_ADJUST_CFA_OFFSET -(REST_SKIP)
.endm
#define ARG_SKIP 9*8
.macro RESTORE_ARGS skiprax=0,addskip=0,skiprcx=0,skipr11=0,skipr8910=0,skiprdx=0
.if \skipr11
.else
movq (%rsp),%r11
# CFI_RESTORE r11
.endif
.if \skipr8910
.else
movq 1*8(%rsp),%r10
# CFI_RESTORE r10
movq 2*8(%rsp),%r9
# CFI_RESTORE r9
movq 3*8(%rsp),%r8
# CFI_RESTORE r8
.endif
.if \skiprax
.else
movq 4*8(%rsp),%rax
# CFI_RESTORE rax
.endif
.if \skiprcx
.else
movq 5*8(%rsp),%rcx
# CFI_RESTORE rcx
.endif
.if \skiprdx
.else
movq 6*8(%rsp),%rdx
# CFI_RESTORE rdx
.endif
movq 7*8(%rsp),%rsi
# CFI_RESTORE rsi
movq 8*8(%rsp),%rdi
# CFI_RESTORE rdi
.if ARG_SKIP+\addskip > 0
addq $ARG_SKIP+\addskip,%rsp
# CFI_ADJUST_CFA_OFFSET -(ARG_SKIP+\addskip)
.endif
.endm
.macro HYPERVISOR_IRET flag
# testb $3,1*8(%rsp) /* Don't need to do that in Mini-os, as */
# jnz 2f /* there is no userspace? */
testl $NMI_MASK,2*8(%rsp)
jnz 2f
testb $1,(xen_features+XENFEAT_supervisor_mode_kernel)
jnz 1f
/* Direct iret to kernel space. Correct CS and SS. */
orb $3,1*8(%rsp)
orb $3,4*8(%rsp)
1: iretq
2: /* Slow iret via hypervisor. */
andl $~NMI_MASK, 16(%rsp)
pushq $\flag
jmp hypercall_page + (__HYPERVISOR_iret * 32)
.endm
/*
* Exception entry point. This expects an error code/orig_rax on the stack
* and the exception handler in %rax.
*/
ENTRY(error_entry)
# _frame RDI
/* rdi slot contains rax, oldrax contains error code */
cld
subq $14*8,%rsp
# CFI_ADJUST_CFA_OFFSET (14*8)
movq %rsi,13*8(%rsp)
# CFI_REL_OFFSET rsi,RSI
movq 14*8(%rsp),%rsi /* load rax from rdi slot */
movq %rdx,12*8(%rsp)
# CFI_REL_OFFSET rdx,RDX
movq %rcx,11*8(%rsp)
# CFI_REL_OFFSET rcx,RCX
movq %rsi,10*8(%rsp) /* store rax */
# CFI_REL_OFFSET rax,RAX
movq %r8, 9*8(%rsp)
# CFI_REL_OFFSET r8,R8
movq %r9, 8*8(%rsp)
# CFI_REL_OFFSET r9,R9
movq %r10,7*8(%rsp)
# CFI_REL_OFFSET r10,R10
movq %r11,6*8(%rsp)
# CFI_REL_OFFSET r11,R11
movq %rbx,5*8(%rsp)
# CFI_REL_OFFSET rbx,RBX
movq %rbp,4*8(%rsp)
# CFI_REL_OFFSET rbp,RBP
movq %r12,3*8(%rsp)
# CFI_REL_OFFSET r12,R12
movq %r13,2*8(%rsp)
# CFI_REL_OFFSET r13,R13
movq %r14,1*8(%rsp)
# CFI_REL_OFFSET r14,R14
movq %r15,(%rsp)
# CFI_REL_OFFSET r15,R15
#if 0
cmpl $__KERNEL_CS,CS(%rsp)
je error_kernelspace
#endif
error_call_handler:
movq %rdi, RDI(%rsp)
movq %rsp,%rdi
movq ORIG_RAX(%rsp),%rsi # get error code
movq $-1,ORIG_RAX(%rsp)
call *%rax
.macro zeroentry sym
# INTR_FRAME
movq (%rsp),%rcx
movq 8(%rsp),%r11
addq $0x10,%rsp /* skip rcx and r11 */
pushq $0 /* push error code/oldrax */
# CFI_ADJUST_CFA_OFFSET 8
pushq %rax /* push real oldrax to the rdi slot */
# CFI_ADJUST_CFA_OFFSET 8
leaq \sym(%rip),%rax
jmp error_entry
# CFI_ENDPROC
.endm
.macro errorentry sym
# XCPT_FRAME
movq (%rsp),%rcx
movq 8(%rsp),%r11
addq $0x10,%rsp /* rsp points to the error code */
pushq %rax
# CFI_ADJUST_CFA_OFFSET 8
leaq \sym(%rip),%rax
jmp error_entry
# CFI_ENDPROC
.endm
#define XEN_GET_VCPU_INFO(reg) movq HYPERVISOR_shared_info,reg
#define XEN_PUT_VCPU_INFO(reg)
#define XEN_PUT_VCPU_INFO_fixup
#define XEN_LOCKED_BLOCK_EVENTS(reg) movb $1,evtchn_upcall_mask(reg)
#define XEN_LOCKED_UNBLOCK_EVENTS(reg) movb $0,evtchn_upcall_mask(reg)
#define XEN_TEST_PENDING(reg) testb $0xFF,evtchn_upcall_pending(reg)
#define XEN_BLOCK_EVENTS(reg) XEN_GET_VCPU_INFO(reg) ; \
XEN_LOCKED_BLOCK_EVENTS(reg) ; \
XEN_PUT_VCPU_INFO(reg)
#define XEN_UNBLOCK_EVENTS(reg) XEN_GET_VCPU_INFO(reg) ; \
XEN_LOCKED_UNBLOCK_EVENTS(reg) ; \
XEN_PUT_VCPU_INFO(reg)
ENTRY(hypervisor_callback)
zeroentry hypervisor_callback2
ENTRY(hypervisor_callback2)
movq %rdi, %rsp
11: movq %gs:8,%rax
incl %gs:0
cmovzq %rax,%rsp
pushq %rdi
call do_hypervisor_callback
popq %rsp
decl %gs:0
jmp error_exit
# ALIGN
restore_all_enable_events:
XEN_UNBLOCK_EVENTS(%rsi) # %rsi is already set up...
scrit: /**** START OF CRITICAL REGION ****/
XEN_TEST_PENDING(%rsi)
jnz 14f # process more events if necessary...
XEN_PUT_VCPU_INFO(%rsi)
RESTORE_ARGS 0,8,0
HYPERVISOR_IRET 0
14: XEN_LOCKED_BLOCK_EVENTS(%rsi)
XEN_PUT_VCPU_INFO(%rsi)
SAVE_REST
movq %rsp,%rdi # set the argument again
jmp 11b
ecrit: /**** END OF CRITICAL REGION ****/
retint_kernel:
retint_restore_args:
movl EFLAGS-REST_SKIP(%rsp), %eax
shr $9, %eax # EAX[0] == IRET_EFLAGS.IF
XEN_GET_VCPU_INFO(%rsi)
andb evtchn_upcall_mask(%rsi),%al
andb $1,%al # EAX[0] == IRET_EFLAGS.IF & event_mask
jnz restore_all_enable_events # != 0 => enable event delivery
XEN_PUT_VCPU_INFO(%rsi)
RESTORE_ARGS 0,8,0
HYPERVISOR_IRET 0
error_exit:
RESTORE_REST
/* cli */
XEN_BLOCK_EVENTS(%rsi)
jmp retint_kernel
ENTRY(failsafe_callback)
popq %rcx
popq %r11
iretq
ENTRY(coprocessor_error)
zeroentry do_coprocessor_error
ENTRY(simd_coprocessor_error)
zeroentry do_simd_coprocessor_error
ENTRY(device_not_available)
zeroentry do_device_not_available
ENTRY(debug)
# INTR_FRAME
# CFI_ADJUST_CFA_OFFSET 8 */
zeroentry do_debug
# CFI_ENDPROC
ENTRY(int3)
# INTR_FRAME
# CFI_ADJUST_CFA_OFFSET 8 */
zeroentry do_int3
# CFI_ENDPROC
ENTRY(overflow)
zeroentry do_overflow
ENTRY(bounds)
zeroentry do_bounds
ENTRY(invalid_op)
zeroentry do_invalid_op
ENTRY(coprocessor_segment_overrun)
zeroentry do_coprocessor_segment_overrun
ENTRY(invalid_TSS)
errorentry do_invalid_TSS
ENTRY(segment_not_present)
errorentry do_segment_not_present
/* runs on exception stack */
ENTRY(stack_segment)
# XCPT_FRAME
errorentry do_stack_segment
# CFI_ENDPROC
ENTRY(general_protection)
errorentry do_general_protection
ENTRY(alignment_check)
errorentry do_alignment_check
ENTRY(divide_error)
zeroentry do_divide_error
ENTRY(spurious_interrupt_bug)
zeroentry do_spurious_interrupt_bug
ENTRY(page_fault)
errorentry do_page_fault
ENTRY(thread_starter)
popq %rdi
popq %rbx
call *%rbx
call exit_thread