⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gpmmp.inc

📁 AMI 主板的BIOS源码
💻 INC
📖 第 1 页 / 共 3 页
字号:

;-----------------------------------------------;
;	REMOVE FOLLOWING CODE AS DURING SOFT	;
;	 RESET SMBASE IS ALREADY RELOCATED	;
;-----------------------------------------------;

;;	stc					; (cy) = 01 for error

;-----------------------------------------------;

rel_smbase_ind_cpu_02:
	loop	$				; some delay to put current processor really out of SMI
rel_smbase_ind_cpu_00:
	push	ds				;
	call	get_bsp_default_smram_save_info	;
	xchg	si,di				;
	rep	movsd				; restore BSP default SMRAM code
	pop	ds				;

	pop	es				;
	popa					;
	ret

relocate_smbase_individual_cpu	endp

;---------------------------------------------------------------;
;		GET_BSP_DEFAULT_SMRAM_SAVE_INFO			;
;---------------------------------------------------------------;
;	Input : (ES) default INTEL CPU SMI segment (3000H)	;
;	Output: (DS) default INTEL CPU SMI segment (3000H)	;
;		(DI) offset for saving BSP default SMRAM	;
;		(SI) offset for BSP default SMRAM code		;
;		(CX) count of DWORDs for BSP default SMRAM code	;
;	Register destroyed : (DS),(DI),(SI),(CX)		;
;			   : FLAGS NOT AFFECTED			;
;---------------------------------------------------------------;

get_bsp_default_smram_save_info	proc	near

	push	es				;
	pop	ds				; (ds) = (es)
	mov	di,0000h			; (di) = offset for saving BSP default SMRAM
	mov	si,8000h			; (si) = offset for BSP default SMRAM code
	mov	cx,2000h			; 32KB of code+data to be moved
	ret

get_bsp_default_smram_save_info	endp

;---------------------------------------------------------------;
;*****************************************************************;
;*****************************************************************;
;**								**;
;**	(C)Copyright 1985-1996, American Megatrends Inc.	**;
;**								**;
;**			All Rights Reserved.			**;
;**								**;
;**		6145-F, Northbelt Parkway, Norcross,		**;
;**								**;
;**		Georgia - 30071, USA. Phone-(770)-246-8600.	**;
;**								**;
;*****************************************************************;
;*****************************************************************;
;---------------------------------------------------------------;

non_bsp_relocation_code_begin	label	byte

;---------------------------------------------------------------;
;		INTEL_NON_BSP_CPU_RELOCATION_ENTRY		;
;---------------------------------------------------------------;
;	Input : NONE						;
;	Output: NONE						;
;	Register destroyed : ALL				;
;---------------------------------------------------------------;

intel_non_bsp_cpu_relocation_entry	proc	near

	cli					; disable interrupts
	movzx	eax,word ptr cs:smi_code_seg_intel_amd_plus_cseg; (eax) = SMI code segment selector
	shl	eax,4				; (eax) = absolute address
	mov	cs:cpu_dump_smbase_slot_intl,eax; change SMBASE
	lock	xor byte ptr cs:processor_in_smi_info_cseg,11111111b; set current processor not in SMI

;-----------------------------------------------;
;     FOLLOWING CODE HAS BEEN ADDED TO TAKE	;
;     CARE OF A BUG IN INTEL PENTIUM PRO CPU	;
;     (P6). ERRATA #38 (RSM CAN NOT RETURN TO	;
;     HALT IN 32BIT OS.				;
;-----------------------------------------------;

	test	byte ptr cs:cpu_dump_halt_auto_restart_intl,00000001b; previous instruction was 'HLT' ?
	jz	short intel_non_bsp_relocation_11; no...
	and	byte ptr cs:cpu_dump_halt_auto_restart_intl,11111110b; do not return to auto halt state
	dec	dword ptr cs:cpu_dump_eip_intl	; position the EIP to 'HLT' instruction
intel_non_bsp_relocation_11:

;-----------------------------------------------;

	intel_rsm				; RSM (resume from SMI)

intel_non_bsp_cpu_relocation_entry	endp

;---------------------------------------------------------------;

non_bsp_relocation_code_end	label	byte

;---------------------------------------------------------------;
;*****************************************************************;
;*****************************************************************;
;**								**;
;**	(C)Copyright 1985-1996, American Megatrends Inc.	**;
;**								**;
;**			All Rights Reserved.			**;
;**								**;
;**		6145-F, Northbelt Parkway, Norcross,		**;
;**								**;
;**		Georgia - 30071, USA. Phone-(770)-246-8600.	**;
;**								**;
;*****************************************************************;
;*****************************************************************;
;---------------------------------------------------------------;

non_bsp_smi_code_end	label	byte

;---------------------------------------------------------------;
;*****************************************************************;
;*****************************************************************;
;**								**;
;**	(C)Copyright 1985-1996, American Megatrends Inc.	**;
;**								**;
;**			All Rights Reserved.			**;
;**								**;
;**		6145-F, Northbelt Parkway, Norcross,		**;
;**								**;
;**		Georgia - 30071, USA. Phone-(770)-246-8600.	**;
;**								**;
;*****************************************************************;
;*****************************************************************;
;---------------------------------------------------------------;

intel_mp_smi_handler_ends	label	byte

;---------------------------------------------------------------;
;*****************************************************************;
;*****************************************************************;
;**								**;
;**	(C)Copyright 1985-1996, American Megatrends Inc.	**;
;**								**;
;**			All Rights Reserved.			**;
;**								**;
;**		6145-F, Northbelt Parkway, Norcross,		**;
;**								**;
;**		Georgia - 30071, USA. Phone-(770)-246-8600.	**;
;**								**;
;*****************************************************************;
;*****************************************************************;
;---------------------------------------------------------------;

ELSE

intel_mp_smi_handler_dummy	label	byte

;---------------------------------------------------------------;
;		   DUMMY SUPPORT FOR INTEL APIC			;
;	    MULTIPROCESSOR SMI BASED POWER MANAGEMENT		;
;---------------------------------------------------------------;
;    POST TIME CORE BIOS DUAL/MULTIPROCESSOR SMI HANDLER CODE	;
;    POST TIME CORE BIOS DUAL/MULTIPROCESSOR SMI HANDLER CODE	;
;    POST TIME CORE BIOS DUAL/MULTIPROCESSOR SMI HANDLER CODE	;
;    POST TIME CORE BIOS DUAL/MULTIPROCESSOR SMI HANDLER CODE	;
;---------------------------------------------------------------;
;		SETUP_SMI_HANDLER_FOR_MULTIPLE_CPU		;
;---------------------------------------------------------------;
;	Input : (DS) SMRAM segment				;
;		(ES) SMRAM segment				;
;		(BL) bit 0 set for 32KB SMRAM			;
;		     bit 0 clear for 64KB or greater SMRAM	;
;		     bit 1 set for smbase requires relocation	;
;		     bit 1 clear for smbase relocation not reqd.;
;		     bit 3  bit 2				;
;		       0      0   ... INTEL type SMI		;
;		       0      1   ... CYRIX type SMI		;
;		       1      0   ... AMD type SMI		;
;		       1      1   ... reserved			;
;		     bit 4 set for dual/multiple CPU present	;
;		     bit 4 clear for single CPU			;
;		     bit 5 set for IRQ based power management	;
;		     bit 5 clear for SMI based power management	;
;		     bit 6 set for SMI capable CPU		;
;		     bit 6 clear for non-SMI CPU		;
;		(BH) bit 3-0...no. of secondary CPU present	;
;		     bit 7-4...IRQ level for IRQ power management
;		(CH) cpu vendor #				;
;			00 Intel				;
;			01 Cyrix				;
;			02 AMD					;
;			03 IBM					;
;			04 TI					;
;			05 UMC					;
;		(CL) cpu #					;
;			>= 16 IBM-CYRIX cpu (all in decimal)	;
;			12-31 AMD-PLUS cpu (all in decimal)	;
;			0ffh means UNKNOWN CPU			;
;		STACK PRESENT					;
;	Output: (CY) 00 successful				;
;		(CY) 01 error					;
;	Register destroyed : (EAX),(EDX),(SI),(EDI)		;
;---------------------------------------------------------------;

setup_smi_handler_for_multiple_cpu	proc	near

;---------------------------------------------------------------;
;		RELOCATE_SMBASE_FOR_MULTIPLE_CPU		;
;---------------------------------------------------------------;
;	Input : (DS) SMRAM segment (not accessible)		;
;		(ES) SMRAM segment (not accessible)		;
;		(BL) bit 0 set for 32KB SMRAM			;
;		     bit 0 clear for 64KB or greater SMRAM	;
;		     bit 1 set for smbase requires relocation	;
;		     bit 1 clear for smbase relocation not reqd.;
;		     bit 3  bit 2				;
;		       0      0   ... INTEL type SMI		;
;		       0      1   ... CYRIX type SMI		;
;		       1      0   ... AMD type SMI		;
;		       1      1   ... reserved			;
;		     bit 4 set for dual/multiple CPU present	;
;		     bit 4 clear for single CPU			;
;		     bit 5 set for IRQ based power management	;
;		     bit 5 clear for SMI based power management	;
;		     bit 6 set for SMI capable CPU		;
;		     bit 6 clear for non-SMI CPU		;
;		(BH) bit 3-0...no. of secondary CPU present	;
;		     bit 7-4...IRQ level for IRQ power management
;		(CH) cpu vendor #				;
;			00 Intel				;
;			01 Cyrix				;
;			02 AMD					;
;			03 IBM					;
;			04 TI					;
;			05 UMC					;
;		(CL) cpu #					;
;			>= 16 IBM-CYRIX cpu (all in decimal)	;
;			12-31 AMD-PLUS cpu (all in decimal)	;
;			0ffh means UNKNOWN CPU			;
;		STACK PRESENT					;
;	Output: (CY) 00 successful				;
;		(CY) 01 error					;
;	Register destroyed : (EAX),(EDX),(SI),(EDI)		;
;---------------------------------------------------------------;

relocate_smbase_for_multiple_cpu	proc	near

	clc					; (cy) = 00 for no error
	ret

relocate_smbase_for_multiple_cpu	endp
setup_smi_handler_for_multiple_cpu	endp

;---------------------------------------------------------------;

intel_mp_smi_handler_dummy_ends	label	byte

ENDIF

;---------------------------------------------------------------;
;*****************************************************************;
;*****************************************************************;
;**								**;
;**	(C)Copyright 1985-1996, American Megatrends Inc.	**;
;**								**;
;**			All Rights Reserved.			**;
;**								**;
;**		6145-F, Northbelt Parkway, Norcross,		**;
;**								**;
;**		Georgia - 30071, USA. Phone-(770)-246-8600.	**;
;**								**;
;*****************************************************************;
;*****************************************************************;
;---------------------------------------------------------------;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -