Subversion Repositories Kolibri OS

Rev

Rev 373 | Rev 378 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 373 Rev 375
Line 369... Line 369...
369
;           btr [cpu_caps], CAPS_PSE    ;test: don't use large pages
369
;           btr [cpu_caps], CAPS_PSE    ;test: don't use large pages
370
;           btr [cpu_caps], CAPS_PGE    ;test: don't use global pages
370
;           btr [cpu_caps], CAPS_PGE    ;test: don't use global pages
371
;           btr [cpu_caps], CAPS_MTRR   ;test: don't use MTRR
371
;           btr [cpu_caps], CAPS_MTRR   ;test: don't use MTRR
372
           bts [cpu_caps], CAPS_TSC     ;force use rdtsc
372
           bts [cpu_caps], CAPS_TSC     ;force use rdtsc
Line -... Line 373...
-
 
373
	   
-
 
374
; -------- Fast System Call init ----------
-
 
375
	; Intel SYSENTER/SYSEXIT (AMD CPU support it too)
-
 
376
	bt	[cpu_caps], CAPS_SEP
-
 
377
	jnc	.SEnP			; SysEnter not Present
-
 
378
	xor	edx, edx
-
 
379
	mov	ecx, MSR_SYSENTER_CS
-
 
380
	mov	eax, os_code
-
 
381
	wrmsr
-
 
382
	mov	ecx, MSR_SYSENTER_ESP
-
 
383
	mov	eax, sysenter_stack	; Check it
-
 
384
	wrmsr
-
 
385
	mov	ecx, MSR_SYSENTER_EIP
-
 
386
	mov	eax, sysenter_entry
-
 
387
	wrmsr
-
 
388
.SEnP:
-
 
389
	; AMD SYSCALL/SYSRET
-
 
390
	cmp	byte[cpu_vendor], 'A'
-
 
391
	jne	.noSYSCALL
-
 
392
	mov	eax, 0x80000001
-
 
393
	cpuid
-
 
394
	test	edx, 0x800		; bit_11 - SYSCALL/SYSRET support
-
 
395
	jz	.noSYSCALL
-
 
396
	mov	ecx, MSR_AMD_EFER
-
 
397
	rdmsr
-
 
398
	or	eax, 1			; bit_0 - System Call Extension (SCE)
-
 
399
	wrmsr
-
 
400
 
-
 
401
	; !!!! It`s dirty hack, fix it !!!
-
 
402
	; Bits of EDX :
-
 
403
	; Bit 31–16 During the SYSRET instruction, this field is copied into the CS register
-
 
404
	;  and the contents of this field, plus 8, are copied into the SS register.
-
 
405
	; Bit 15–0 During the SYSCALL instruction, this field is copied into the CS register
-
 
406
	;  and the contents of this field, plus 8, are copied into the SS register.
-
 
407
 
-
 
408
	; mov	edx, (os_code + 16) * 65536 + os_code
-
 
409
	mov	edx, 0x1B0013
-
 
410
 
-
 
411
	mov	eax, syscall_entry
-
 
412
	mov	ecx, MSR_AMD_STAR
-
 
413
	wrmsr
-
 
414
.noSYSCALL:
-
 
415
; -----------------------------------------
373
 
416
 
374
; MEMORY MODEL
417
; MEMORY MODEL
375
           call mem_test
418
           call mem_test
376
           call init_mem
419
           call init_mem
Line 4824... Line 4867...
4824
     mov   [esp+36],eax
4867
     mov   [esp+36],eax
4825
     mov   [esp+24],ebx
4868
     mov   [esp+24],ebx
Line 4826... Line 4869...
4826
 
4869
 
Line -... Line 4870...
-
 
4870
     ret
-
 
4871
 
4827
     ret
4872
align 4
4828
 
4873
paleholder:
4829
 
4874
	ret
4830
; --------------- APM ---------------------
4875
; --------------- APM ---------------------
4831
apm_entry    dp    0
4876
apm_entry    dp    0
4832
apm_vf        dd    0
4877
apm_vf        dd    0