;	[]===========================================================[]
;
;	NOTICE: THIS PROGRAM BELONGS TO AWARD SOFTWARE INTERNATIONAL(R)
;	        INC. IT IS CONSIDERED A TRADE SECRET AND IS NOT TO BE
;	        DIVULGED OR USED BY PARTIES WHO HAVE NOT RECEIVED
;	        WRITTEN AUTHORIZATION FROM THE OWNER.
;
; 	[]===========================================================[]
;

;----------------------------------------------------------------------------
;Rev	Date	 Name	Description
;----------------------------------------------------------------------------
;R36	04/27/99 PAL	Include ALL_SSR.INC instead of old method 
;R35	04/26/99 PAL	Added LM84_Support
;R34    04/19/99 JSN	Add AliM5879 Hardware Monitor Support.
;R33    03/11/99 JMS	Added 1. "SECONDARY_SSR_USE_W83783S" for support Secondary W83783s sensor
;			      2. "USE_DUAL_SENSOR" for support Dual sensor
;R32	03/02/99 PAL	Added LM81_Support
;R31	01/26/99 PHI	Move sensor code to XGROUP. When the code not all 
;			complete moved, please use define SENSOR_IN_XGROUP.
;			After all sensor code move to XGROUP, the define 
;			will be removed. 
;R30A   12/23/98 GAR	Superio_Support_Sensor must be defined if Sensor of
;			ITE8693 is used
;R30	12/01/98 GAR	Rename "Superio_Support_Thermal" to 
;			"Superio_No_Support_Thermal"
;R29	11/05/98 RIC	Add VIA686 Hardware Monitor Support.
;R28	10/27/98 GAR	Add ITE8693
;R27	10/13/98 TNY	Add "Xeon_Thermal" slot2 CPU support.
;R26   	10/09/98 PAL	Coordinate all sensor to use I2C code of individual 
;			chipset so reduce the same code as chippost.asm
;R25	10/02/98 PAL	Address WaitSMbus to another location
;R24	09/21/98 RAY	Some M/B must check the existance of sensor inside
;			setup.
;R23	09/17/98 PAL	Added VIA software SMBus for senor
;R22	09/11/98 ADS	To patched kernel that support software SMBus for
;			sensor function.
;R21	09/09/98 PAL	Added Sis software SMBus for sensor
;R16A	09/03/98 LAW	modify Chk_SMBus_READY routing for M1543/M1543C
;R20	08/24/98 PAL	Support "W83783S_Support" option.
;R19	07/01/98 RIC	Add VIA SMBus Support.
;R18	06/29/98 PAL	Support "W83782D_Support" option.
;R17	06/17/98 PAL	Support "ADM9240_Support" option.
;R16	05/20/98 LAW	fix M1543 I2C work not fine 
;R15	04/27/98 RAY	Include COMMON.EQU
;R14	04/20/98 PAL	Support "MAX1617_Support" option.
;R13	04/02/98 TNY	Support "HT82791_Support" option.
;R12	03/18/98 TNY	Support "LM80_Support" option.
;R11	03/05/98 TNY	Support "GL520SM_Support" option.
;R10	02/14/98 TNY	Read sensor at 2 sec.
;R09A	12/04/97 DNL	Move some definition to misc.equ for more asm file
;R09	12/03/97 DNL	Added ACPI Thermal Zone support
;R08	11/17/97 TNY	Add "SIS5595_Support" definition.
;R07	11/13/97 TNY	Add "W83781D_Support" definition.
;R06	09/01/97 RIC	Add "VT586_ACPI" define for VIA chipset.
;R05	08/21/97 TNY	Add "GL518SM_Support" definition.
;R04	08/08/97 TNY	Fix coding error, clear error status.
;R03	08/08/97 TNY	Add ALi M1543 SMBus support.
;R02	08/07/97 RCH	Make routine "Chk_SMBus_READY" and "WaitSmbus" as
;			public procedure for both LM78 & LM75 to prevent
;			duplicate codes
;R01	06/18/97 TNY	Always show sensor values in runtime.

ifdef	MASM611
.MODEL  SMALL,BASIC
OPTION	PROC: PRIVATE
endif	;MASM611
.386p
		PAGE	56,132
		TITLE	SENSOR.ASM
.XLIST
		INCLUDE	BIOS.CFG
		INCLUDE	COMMON.EQU		;R15
		INCLUDE	COMMON.MAC
		INCLUDE POST.EQU
		INCLUDE	MISC.EQU		;R09A

;		extrn	F000_call_proc:near
		extrn	F000_GetItem_Value:near
		extrn	F000_VECT:near
		extrn	RET_E_SEG:near

;R09A	SENSOR_KERNEL	=	0
;R09A	NO_CPUFAN_THERMAL	=	0
;R09A
;R09Aifdef	LM75_Support
;R09A	SENSOR_KERNEL	=	1
;R09Aendif	;LM75_Support
;R09A
;R09Aifdef	LM78_Support
;R09A	SENSOR_KERNEL	=	1
;R09A	NO_CPUFAN_THERMAL	=	1		;R09
;R09Aendif	;LM78_Support
;R09A
;R09Aifdef	GL518SM_Support					;R05
;R09A	SENSOR_KERNEL	=	1			;R05
;R09A	NO_CPUFAN_THERMAL	=	1		;R09
;R09Aendif	;GL518SM_Support				;R05
;R09A
;R09Aifdef	W83781D_Support					;R07
;R09A	SENSOR_KERNEL	=	1			;R07
;R09A	NO_CPUFAN_THERMAL	=	1		;R09
;R09Aendif	;W83781D_Support				;R07
;R09A
;R09Aifdef	SIS5595_Support					;R08
;R09A	SENSOR_KERNEL	=	1			;R08
;R09A	NO_CPUFAN_THERMAL	=	1		;R09
;R09Aendif;	SIS5595_Support					;R08

G_RAM		SEGMENT	USE16 AT 0

		ORG	04H*4
		INCLUDE	SEG_0.INC

		ORG	400H
		INCLUDE	G_RAM.INC

G_RAM		ENDS

.LIST

DGROUP		GROUP	FCODE
FCODE           SEGMENT PARA PUBLIC 'CODE'
                ASSUME  CS:DGROUP

;R31 - start
IFDEF	SENSOR_IN_XGROUP

ifdef	Case_open_WARNING

		Public	fproc_Get_CMOS
		Public	fproc_Set_CMOS
		extrn	Get_CMOS:near
		extrn	Set_CMOS:near

fproc_Get_CMOS	Proc	Far		
	     	call	Get_CMOS
	     	retf
fproc_Get_CMOS	endp	

fproc_Set_CMOS	Proc	Far		
      		call	Get_CMOS
      		retf
fproc_Set_CMOS	endp	

endif	;Case_open_WARNING

ifdef	DIODE_SUPPORT
		Public	fproc_Get_Ct
		Public	fproc_Set_Ct
		extrn	Get_Ct:near
		extrn	Set_Ct:near

fproc_Get_Ct	Proc	Far		
	     	call	Get_Ct
	     	retf
fproc_Get_Ct	endp	

fproc_Set_Ct	Proc	Far		
      		call	Get_Ct
      		retf
fproc_Set_Ct	endp	
endif	;DIODE_SUPPORT

ENDIF	;SENSOR_IN_XGROUP
;R31 - end

FCODE           ENDS

EGROUP		GROUP	ECODE
ECODE		SEGMENT	USE16 PARA PUBLIC 'ECODE'
		ASSUME	CS:EGROUP,DS:G_RAM,ES:EGROUP
;R31 - start
IFDEF	SENSOR_IN_XGROUP

		Public	fproc_CT_I2CReadByte
		Public	fproc_CT_I2CWriteByte
		Public	fproc_CT_I2CReadWord
		Public	fproc_CT_I2CWriteWord

		extrn	CT_I2CReadByte:near
		extrn	CT_I2CWriteByte:near
		extrn	CT_I2CReadWord:near
		extrn	CT_I2CWriteWord:near

fproc_Ct_I2CReadByte	Proc	Far		
			call	Ct_I2CReadByte
			retf
fproc_Ct_I2CReadByte	endp	

fproc_Ct_I2CWriteByte	Proc	Far		
			call	Ct_I2CWriteByte
			retf
fproc_Ct_I2CWriteByte	endp	

fproc_Ct_I2CReadWord	Proc	Far		
			call	Ct_I2CReadWord
			retf
fproc_Ct_I2CReadWord	endp	

fproc_Ct_I2CWriteWord	Proc	Far		
			call	Ct_I2CWriteWord
			retf
fproc_Ct_I2CWriteWord	endp	

ENDIF	;SENSOR_IN_XGROUP
;R31 - end

IF	SENSOR_KERNEL

		COMPILE_FOR_SENSOR_KERNEL_ASM	=	2
comment %						;R26
;R09A;R09 - start
;R09Aif	NO_CPUFAN_THERMAL	EQ	1
;R09A		Public	Ct_FillTempPointer
;R09ACt_FillTempPointer	Proc	Near
;R09A		ret
;R09ACt_FillTempPointer	Endp
;R09Aendif	;NO_CPUFAN_THERMAL	EQ	1
;R09A;R09 - end

;R19 ifndef	VT586_ACPI					;R06
;R02 - start
;R26 SBUS_NEED	=	0
;R26
;R26 ifdef	LM80_Support					;R12
;R26  SBUS_NEED	=	1				;R12
;R26 endif	;LM80_Support					;R12
;R26
;R26 ifdef	LM81_Support					;R32
;R26  SBUS_NEED	=	1				;R32
;R26 endif	;LM81_Support					;R32
;R26
;R26 ifdef	LM84_Support					;R35
;R26  SBUS_NEED	=	1				;R35
;R26 endif;	LM84_Support					;R35
;R26
;R26 ifdef	GL520SM_Support					;R11
;R26  SBUS_NEED	=	1				;R11
;R26 endif	;GL520SM_Support				;R11
;R26
;R26 ifdef	GL518SM_Support					;R05
;R26  SBUS_NEED	=	1				;R05
;R26 endif	;GL518SM_Support				;R05
;R26 ifdef	LM75_Support
;R26  SBUS_NEED	=	1
;R26 endif;	LM75_Support
;R26 ifdef	LM78_Support
;R26  ifdef	LM78_USE_SMBUS
;R26   SBUS_NEED	=	1
;R26  endif;	LM78_USE_SMBUS
;R26 endif;	LM78_Support
;R26ifdef	W83781D_USE_SMBUS 				;R07
;R26   SBUS_NEED	=	1				;R07
;R26endif	;W83781D_USE_SMBUS				;R07
;R26
;R26ifdef	HT82791_USE_SMBUS 				;R13
;R26   SBUS_NEED	=	1				;R13
;R26endif	;HT82791_USE_SMBUS				;R13
;R26
;R26ifdef	MAX1617_Support					;R14
;R26  SBUS_NEED	=	1				;R14
;R26endif;	MAX1617_Support					;R14
;R26
;R26ifdef	ADM9240_Support					;R17
;R26  SBUS_NEED	=	1				;R17
;R26endif;	ADM9240_Support					;R17
;R26
;R26ifdef	W83782D_USE_SMBUS 				;R18
;R26   SBUS_NEED	=	1				;R18
;R26endif	;W83782D_USE_SMBUS				;R18
;R26
;R26ifdef	W83783S_Support 				;R20
;R26   SBUS_NEED	=	1				;R20
;R26endif	;W83783S_Support				;R20


;R26VIA_SMBus	=	0				;R19
;R26ifdef	VT596						;R19
;R26  IFDEF	SMBus_Port					;R19
;R26VIA_SMBus	=	1				;R19
;R26  ENDIF;SMBus_Port					;R19
;R26endif;	VT596						;R19
;R22 ifdef	Software_I2C					;R19
;R22 SBUS_NEED	=	0				;R19
;R22 endif;	Software_I2C					;R19

;R26if SBUS_NEED
;R26
;R26;R23 - starts
;R26ifdef   VT586_ACPI		; VIA Chipset
;R26IF	VIA_SMBus	EQ	0
;R26ifdef	SDA_In_GPIO1
;R26SDA             EQU     02	;GPIO1 Data
;R26SCL             EQU     04	;GPIO2 Clock
;R26else;	SDA_In_GPIO1
;R26SDA             EQU     04	;GPIO2 Data (Normal)
;R26SCL             EQU     02	;GPIO1 Clock
;R26endif;	SDA_In_GPIO1
;R26GPIO_Dir        EQU     ACPI_Port+40h
;R26GPIO_WPort      EQU     ACPI_Port+42h
;R26GPIO_RdPort     EQU     ACPI_Port+44h
;R26		extrn	Dir_Out:Near
;R26		extrn	Set_Start:Near
;R26		extrn	Wr_Byte:Near
;R26		extrn	Wait_ACK:Near
;R26		extrn	Set_Stop:Near
;R26		extrn	E000_Get_PMIO:near		
;R26		extrn	E000_Set_PMIO:near
;R26		extrn	E000_Get_Set_PMIO:near
;R26		extrn	E000_Get_Set_PMIO_OR:near
;R26		extrn	E000_Get_Set_PMIO_AND:near
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Set_Pointer                                                             Ί
;R26;Ί  Input:  BX = pointer                                                    Ί
;R26;Ί  Output: CLC = PK                                                        Ί
;R26;Ί          STC = Fail                                                      Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Set_Pointer     proc
;R26        push    bx              ;Save Register Pointer
;R26	push	cx
;R26        call    Dir_Out
;R26        call    Set_Start
;R26	pop	cx
;R26        mov     bl,ch		;ch is Device ID
;R26        call    Wr_Byte
;R26        call    Wait_ACK
;R26        pop     bx
;R26        jc      ErrSet_Pointer
;R26        call    Wr_Byte         ;bx = pointer
;R26        call    Wait_ACK
;R26        jc      ErrSet_Pointer
;R26        clc
;R26        ret
;R26ErrSet_Pointer:
;R26        stc
;R26        ret
;R26Set_Pointer     endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Rd_Data                                                                 Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: BL: return data                                                 Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Rd_Data proc
;R26        mov     cx,40h                  
;R26        mov     bl, NOT SDA		
;R26	mov	bh, SCL			
;R26        call    E000_Get_Set_PMIO       
;R26
;R26        xor     bx, bx          ;Frank
;R26        xor     ax, ax
;R26        mov     cx, 8
;R26Rd_byte:
;R26        push    cx
;R26        mov     cx, 8                           ;T(low) = 4.7 us
;R26@@:
;R26        out     0ebh, al
;R26        loop    short @B
;R26        mov     dx,GPIO_WPort		
;R26	in	al, dx			
;R26        or      al, SCL			
;R26        out     dx, al                  ;SCL high, receiver will read data
;R26        mov     cx, 8                           ;T(high) = 4 us
;R26@@:
;R26        out     0ebh, al
;R26        loop    short @B
;R26
;R26        mov     cx,44h			;
;R26        call    E000_Get_PMIO		;
;R26
;R26        and     al, SDA 
;R26ifdef	SDA_In_GPIO1
;R26        shr     al, 1		;;if SDA=02h, SCL=04h
;R26else;	SDA_In_GPIO1
;R26        shr     al, 2		;;if SDA=04h, SCL=02h
;R26endif;	SDA_In_GPIO1
;R26        shl     bl, 1           
;R26        or      bl, al
;R26
;R26		mov     dx, GPIO_WPort		
;R26		in	al, dx			
;R26		and     al, NOT SCL             ;SCL low
;R26		out	dx, al			
;R26
;R26        pop     cx
;R26        loop    Rd_byte
;R26
;R26        mov     cx, 8                           ;T(hd)
;R26@@:
;R26        out     0ebh, al
;R26        loop    short @B
;R26
;R26        mov     dx,GPIO_Dir		
;R26        in      al, dx			
;R26        or      al, SDA			
;R26        or      al, SCL			
;R26        out     dx, al                  ;Set SCL O/P , SDA I/P
;R26
;R26        ret
;R26Rd_Data endp
;R26
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Set_NoACK                                                               Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: None                                                            Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Set_NoACK       proc
;R26        mov     dx,GPIO_WPort		
;R26        in      al, dx			
;R26        and     al, NOT SCL		
;R26        or      al, SDA			
;R26        out     dx, al                  ;out No ACK
;R26
;R26        out     0ebh, al                ;T(setup) = 250 ns
;R26
;R26        or      al, SCL
;R26        out     dx, al                  ;SCL ,SDA = high
;R26        mov     cx, 8                   ;T(high) = 4 us
;R26@@:
;R26        out     0ebh, al
;R26        loop    short @B
;R26
;R26        and     al, NOT SCL
;R26        out     dx, al                  ;SCL = low
;R26        out     0ebh, al
;R26
;R26        and     al, NOT SDA
;R26        out     dx, al                  ;SDA = low
;R26        out     0ebh, al
;R26
;R26        ret
;R26Set_NoACK       endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Set_ACK                                                                 Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: None                                                            Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Set_ACK proc
;R26        mov     cx,42h                  
;R26	in	al, dx			
;R26        mov     bl, NOT SCL             
;R26        and	bl, NOT SDA		
;R26        call    E000_Get_Set_PMIO_AND	
;R26
;R26        out     0ebh, al                ;T(setup) = 250 ns
;R26
;R26	mov	dx,GPIO_WPort		
;R26        or      al, SCL
;R26        out     dx, al                  ;SCL ,SDA = high
;R26        mov     cx, 8                   ;T(high) = 4 us
;R26@@:
;R26        out     0ebh, al
;R26        loop    short @B
;R26        and     al, NOT SCL
;R26        out     dx, al                  ;SCL = low
;R26        out     0ebh, al
;R26
;R26        and     al, NOT SDA
;R26        out     dx, al                  ;SDA = low
;R26        out     0ebh, al
;R26        ret
;R26Set_ACK endp
;R26
;R26ENDIF;	VIA_SMBus	EQ	0
;R26endif;	VT586_ACPI
;R26;R23 - ends
;R26
;R26;R21 - start
;R26SIS_SMBus	=	0
;R26ifdef   SIS_5598_PCI_RESET		
;R26SIS_SMBus	=	1
;R26endif;  SIS_5598_PCI_RESET		
;R26ifdef   SIS5595_ID
;R26SIS_SMBus	=	1
;R26endif;  SIS5595_ID
;R26
;R26if	SIS_SMBus		; SiS Chipset
;R26SDA             EQU     10h	;I2C Data 
;R26SCL             EQU     08h	;I2C Clock
;R26
;R26		extrn	F000_Get_CT:near
;R26		extrn	F000_Set_CT:near
;R26
;R26DelayIO:
;R26		push	cx
;R26		mov	cx,300h
;R26	@@:
;R26		newiodelay
;R26		loop	@B
;R26		pop	cx
;R26		ret
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Set_Start                                                               Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: None                                                            Ί
;R26;Ί                                                                          Ί
;R26;Ί  SDA  ----\___                                                           Ί
;R26;Ί  SCL  -------\                                                           Ί
;R26;Ί       1   2                                                              Ί
;R26;Ί        4us 4us                                                           Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Set_Start       proc	Near
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26        	or	al, SCL
;R26        	call	F000_Set_Ct
;R26        
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26        	or	al, SDA
;R26        	call	F000_Set_Ct
;R26
;R26		call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al,NOT SDA
;R26        	call	F000_Set_Ct
;R26                NEWIODELAY      
;R26                NEWIODELAY      
;R26                NEWIODELAY      
;R26
;R26                call	DelayIO			
;R26        
;R26;For 1'st clock low time
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al,NOT SCL
;R26        	call	F000_Set_Ct
;R26
;R26                call	DelayIO			
;R26        
;R26                ret
;R26Set_Start       endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Wr_Byte                                                                 Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:   BL:Data to I2C Bus                                             Ί
;R26;Ί  Output: None                                                            Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Wr_Byte		proc	Near
;R26
;R26                pusha					
;R26        	mov	cx,086dh
;R26                call	F000_Get_Ct			
;R26                and     al,NOT SCL			
;R26                call	F000_Set_Ct			
;R26                popa					
;R26
;R26                mov     dx,bx
;R26                mov     cx ,8
;R26write_B:
;R26                push    cx
;R26                NEWIODELAY      
;R26                NEWIODELAY      
;R26                NEWIODELAY      
;R26
;R26                xor     dh,dh   
;R26                shl     dx,1    
;R26                shl     dh,4            ;;if SDA=10h, SCL=08h
;R26        	mov	bl,dh
;R26
;R26        	push	dx
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al,NOT SDA              
;R26                or      al,bl			;data                   
;R26        	call	F000_Set_Ct
;R26                NEWIODELAY      
;R26        
;R26                call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                or      al,SCL			
;R26        	call	F000_Set_Ct
;R26                call	DelayIO			
;R26                NEWIODELAY      
;R26                NEWIODELAY      
;R26                NEWIODELAY      
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al,NOT SCL		
;R26        	call	F000_Set_Ct
;R26                call	DelayIO			
;R26        
;R26        	pop	dx
;R26                pop     cx
;R26                loop    write_B
;R26                ret
;R26Wr_Byte endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Wait_ACK                                                                Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: CLR :  Acknowledge                                              Ί
;R26;Ί          STC : !Acknowledge                                              Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Wait_ACK        proc	Near
;R26        	mov	cx,086dh
;R26                call	F000_Get_Ct		
;R26                and     al, not SCL		
;R26                call	F000_Set_Ct		
;R26                call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                or      al, SCL			
;R26        	call	F000_Set_Ct
;R26
;R26                call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26                call	F000_Get_Ct		
;R26                and	al,NOT SCL		
;R26                call	F000_Set_Ct		
;R26                call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                call	DelayIO			
;R26                mov     bl, al			
;R26        	and	al,NOT SCL
;R26        	call	F000_Set_Ct
;R26                call	DelayIO			
;R26        
;R26                test    bl, SDA
;R26                jnz     short ACK_Err_ret
;R26                clc
;R26                ret
;R26ACK_Err_ret:
;R26	        stc
;R26        	ret
;R26Wait_ACK        endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Set_Stop                                                                Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: None                                                            Ί
;R26;Ί  SDA  ___/-----                                                          Ί
;R26;Ί  SCL  ---------                                                          Ί
;R26;Ί       1  2   3                                                           Ί
;R26;Ί        4us 4us                                                           Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Set_Stop        proc	Near
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al,not SCL
;R26        	call	F000_Set_Ct
;R26        	call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al,NOT SDA              
;R26        	call	F000_Set_Ct
;R26        	call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                or      al,SCL
;R26        	call	F000_Set_Ct
;R26        	call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                or      al,SDA
;R26        	call	F000_Set_Ct
;R26        	call	DelayIO			
;R26
;R26                ret
;R26Set_Stop        endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Set_Pointer                                                             Ί
;R26;Ί  Input:  BX = pointer                                                    Ί
;R26;Ί  Output: CLC = PK                                                        Ί
;R26;Ί          STC = Fail                                                      Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Set_Pointer     proc
;R26                push    bx              ;Save Register Pointer
;R26                call    Set_Start
;R26                mov     bl,ch
;R26                call    Wr_Byte
;R26                call    Wait_ACK
;R26                pop     bx
;R26                jc      ErrSet_Pointer
;R26                call    Wr_Byte         ;bx = pointer
;R26                call    Wait_ACK
;R26                jc      ErrSet_Pointer
;R26                clc
;R26                ret
;R26ErrSet_Pointer:
;R26                stc
;R26                ret
;R26Set_Pointer     endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Rd_Data                                                                 Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: BL: return data                                                 Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Rd_Data 	proc
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26        	and	al, not SCL
;R26        	call	F000_Set_Ct
;R26        	call	DelayIO			
;R26        
;R26                xor     bx, bx
;R26                xor     ax, ax
;R26                mov     cx, 8
;R26Rd_byte:
;R26                push    cx
;R26                mov     cx, 8                           ;T(low) = 4.7 us
;R26@@:
;R26        	NEWIODELAY
;R26                loop    short @B
;R26
;R26        	mov	cx,086dh		
;R26        	call	F000_Get_Ct		
;R26        	or	al, SDA			
;R26        	call	F000_Set_Ct		
;R26        	call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26        	or	al, SCL
;R26        	call	F000_Set_Ct		;SCL high, receiver will read data
;R26        	call	DelayIO			
;R26
;R26                mov     cx, 8                   ;T(high) = 4 us
;R26	@@:
;R26        	NEWIODELAY
;R26                loop    short @B
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26
;R26        	push	ax
;R26                and     al, SDA 
;R26                shr     al, 4
;R26                shl     bl, 1           
;R26                or      bl, al
;R26        	pop	ax
;R26                and     al, NOT SCL                     ;SCL low
;R26        	mov	cx,086dh
;R26        	call	F000_Set_Ct
;R26        	call	DelayIO			
;R26
;R26                pop     cx
;R26                loop    short Rd_byte
;R26
;R26                mov     cx, 8                           ;T(hd)
;R26        @@:
;R26        	NEWIODELAY
;R26                loop    short @B
;R26
;R26                ret
;R26Rd_Data endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Set_NoACK                                                               Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: None                                                            Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Set_NoACK       proc
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al, NOT SCL
;R26        	call	F000_Set_Ct		;out No ACK
;R26        	call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                or      al, SDA
;R26        	call	F000_Set_Ct		;out No ACK
;R26        	call	DelayIO			
;R26
;R26                NEWIODELAY                	;T(setup) = 250 ns
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                or      al, SCL
;R26        	call	F000_Set_Ct		;SCL ,SDA = high
;R26                call	DelayIO			
;R26
;R26                mov     cx, 8                   ;T(high) = 4 us
;R26        @@:
;R26                NEWIODELAY
;R26                loop    short @B
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al, not SCL
;R26        	call	F000_Set_Ct		;SCL = low
;R26
;R26        	call	DelayIO			
;R26
;R26                ret
;R26Set_NoACK       endp
;R26
;R26;ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
;R26;Ί  Set_ACK                                                                 Ί
;R26;Ί                                                                          Ί
;R26;Ί  Input:  None                                                            Ί
;R26;Ί  Output: None                                                            Ί
;R26;ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
;R26Set_ACK 	proc
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al, NOT SCL
;R26                and     al, NOT SDA
;R26        	call	F000_Set_Ct		
;R26                NEWIODELAY                	;T(setup) = 250 ns
;R26        	call	DelayIO			
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                or      al, SCL
;R26        	call	F000_Set_Ct		;SCL = high
;R26        	call	DelayIO			
;R26
;R26                mov     cx, 8                   ;T(high) = 4 us
;R26        @@:
;R26                NEWIODELAY
;R26                loop    short @B
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al, NOT SCL
;R26        	call	F000_Set_Ct		;SCL = low
;R26        	call	DelayIO			
;R26                NEWIODELAY
;R26
;R26        	mov	cx,086dh
;R26        	call	F000_Get_Ct
;R26                and     al, NOT SDA
;R26        	call	F000_Set_Ct		;SDA = low
;R26        	call	DelayIO			
;R26                NEWIODELAY
;R26
;R26                ret
;R26Set_ACK endp
;R26endif;	SIS_SMBus		
;R26;R21 - end
;R26
;R26;R03 - start
;R26ifdef	M1543						
;R26	public	Chk_SMBus_READY
;R26Chk_SMBus_READY	Proc	Near
;R26		mov	dx,SMBus_Port + 0
;R26		clc
;R26;R16		mov	cx,0100h
;R26		mov	cx,01000h	;R16
;R26Chk_I2C_OK:
;R26		in	al,dx		;get status
;R26;R16A		or	al,al
;R26;R16A		jz	short Clear_final
;R26;R16A		test	al,20h		;Error status
;R26		test	al,60h			;R16A;Error status
;R26		jnz	short SMBus_Err	       
;R26
;R26;R16A		test	al,01h		;busy ?
;R26;R16A		jz	short Not_Smbusy
;R26		test	al,010h			;R16Acheck SMI_I_STS
;R26		jnz	short Clear_final	;R16Aset is final
;R26		call	WaitSmbus
;R26Not_Smbusy:
;R26		out 	dx,al
;R26		loop	short Chk_I2C_OK
;R26SMBus_Err:
;R26;R16A		out	dx,al				;R04
;R26;R16A		NEWIODELAY				;R04
;R26;R16A		NEWIODELAY				;R16
;R26;R16A		NEWIODELAY				;R16
;R26;R16A		in	al,dx		;get status	;R04
;R26;R16A		NEWIODELAY				;R04
;R26;R16A		NEWIODELAY				;R16
;R26;R16A		NEWIODELAY				;R16
;R26;R16A		test	al,20h				;R04
;R26;R16A		jnz	short SMBus_Err			;R04
;R26		stc
;R26Clear_final:
;R26		ret
;R26Chk_SMBus_READY	Endp
;R26endif;	M1543
;R26;R03 - end
;R26
;R26ifdef	PIIX_ID					;R03
;R26	public	Chk_SMBus_READY
;R26Chk_SMBus_READY	Proc	Near
;R26		mov	dx,SMBus_Port + 0
;R26		clc
;R26		mov	cx,0100h
;R26Chk_I2C_OK:
;R26		in	al,dx		;get status
;R26		or	al,al
;R26		jz	short Clear_final
;R26
;R26		test	al,04h		       
;R26		jnz	short SMBus_Err	       
;R26
;R26		test	al,01h		;busy ?
;R26		jz	short Not_Smbusy
;R26		call	WaitSmbus
;R26Not_Smbusy:
;R26		out 	dx,al
;R26		loop	short Chk_I2C_OK
;R26SMBus_Err:	
;R26		out	dx,al				;R04
;R26		NEWIODELAY				;R04
;R26		in	al,dx		;get status	;R04
;R26		NEWIODELAY				;R04
;R26		test	al,04h				;R04
;R26		jnz	short SMBus_Err			;R04
;R26		stc
;R26Clear_final:
;R26		ret
;R26Chk_SMBus_READY	Endp
;R26endif;	PIIX_ID					;R03
;R26;R19 - starts
;R26if	VIA_SMBus	EQ	1
;R26	public	Chk_SMBus_READY
;R26Chk_SMBus_READY	Proc	Near
;R26		mov	dx,SMBus_Port + 0
;R26		clc
;R26		mov	cx,0100h
;R26Chk_I2C_OK:
;R26		in	al,dx		;get status
;R26		or	al,al
;R26		jz	short Clear_final
;R26
;R26		test	al,04h		       
;R26		jnz	short SMBus_Err	       
;R26
;R26		test	al,01h		;busy ?
;R26		jz	short Not_Smbusy
;R26		call	WaitSmbus
;R26Not_Smbusy:
;R26		out 	dx,al
;R26		loop	short Chk_I2C_OK
;R26SMBus_Err:	
;R26		out	dx,al				;R04
;R26		NEWIODELAY				;R04
;R26		in	al,dx		;get status	;R04
;R26		NEWIODELAY				;R04
;R26		test	al,04h				;R04
;R26		jnz	short SMBus_Err			;R04
;R26		stc
;R26Clear_final:
;R26		ret
;R26Chk_SMBus_READY	Endp
;R26endif;	VIA_SMBus	EQ	1
;R26;R19 - ends
;R26;R25	public	WaitSmbus
;R26;R25WaitSmbus	proc	near			
;R26;R25		push	cx			
;R26;R25		mov	cx,100h
;R26;R25	@@:						
;R26;R25		loop	short @B		
;R26;R25		pop	cx			
;R26;R25		ret				
;R26;R25WaitSmbus	endp
;R26endif; SBUS_NEED
;R26;R02 - end
;R26;R19 endif;	VT586_ACPI					;R06
%								;R26
ifndef	SENSOR_IN_XGROUP					;R31
	include	ALL_SSR.INC
;R36	ifdef	LM75_Support
;R36		include	LM75.SSR
;R36	endif	;LM75_Support
;R36
;R36	ifdef	LM78_Support
;R36		include	LM78.SSR
;R36	endif	;LM78_Support
;R36
;R36	ifdef	LM80_Support					;R12
;R36		include	LM80.SSR				;R12
;R36	endif	;LM80_Support					;R12
;R36
;R36	ifdef	LM81_Support					;R32
;R36		include	LM81.SSR				;R32
;R36	endif	;LM81_Support					;R32
;R36
;R36	ifdef	LM84_Support					;R35
;R36		include	LM84.SSR				;R35
;R36	endif	;LM84_Support					;R35
;R36
;R36	ifdef	GL520SM_Support					;R11
;R36		include	GL520SM.SSR				;R11
;R36	endif	;GL520SM_Support				;R11
;R36
;R36	ifdef	GL518SM_Support					;R05
;R36		include	GL518SM.SSR				;R05
;R36	endif	;GL518SM_Support				;R05
;R36
;R36	ifdef	W83781D_Support					;R07
;R36		include	W83781D.SSR				;R07
;R36	endif	;W83781D_Support				;R07
;R36
;R36	ifdef	HT82791_Support 				;R13
;R36		include	HT82791.SSR				;R13
;R36	endif	;HT82791_Support				;R13
;R36
;R36	ifdef	SIS5595_Support					;R08
;R36		include	SIS5595.SSR				;R08
;R36	endif	;SIS5595_Support				;R08
;R36
;R36	ifdef	MAX1617_Support					;R14
;R36		include	MAX1617.SSR				;R14
;R36	endif	;MAX1617_Support				;R14
;R36
;R36	ifdef	ADM9240_Support					;R17
;R36		include	ADM9240.SSR				;R17
;R36	endif	;ADM9240_Support				;R17
;R36
;R36	ifdef	W83782D_Support					;R18
;R36		include	W83782D.SSR				;R18
;R36	endif	;W83782D_Support				;R18
;R36
;R36	ifdef	W83783S_Support					;R20
;R36		include	W83783S.SSR				;R20
;R36	endif	;W83783S_Support				;R20
;R36
;R36	ifdef	AliM5879_Support				;R34
;R36		include	AliM5879.SSR				;R34
;R36	endif	;AliM5879_Support				;R34
;R36
;R36	ifdef   USE_DUAL_SENSOR					;R33
;R36		include	SECOND.SSR				;R33
;R36	endif  ;USE_DUAL_SENSOR					;R33
;R36
;R36	ifdef	Xeon_Thermal					;R27
;R36		include	Xeon.SSR				;R27
;R36	endif	;Xeon_Thermal					;R27


;R28 - start
;R30	ifdef	Superio_Support_Thermal
;R30A	ifndef	Superio_No_Support_Thermal			;R30
;R30A	ifdef	ITE8693
;R30A		Superio_Support_Thermal		EQU	1	;R30
;R30A		include	ITE8693.SSR
;R30A	endif	;ITE8693
;R30A	endif	;Superio_No_Support_Thermal			;R30
;R30	endif	;Superio_Support_Thermal
;R28 - end
;R30A - start
;R36	ifdef	Superio_Support_Sensor
;R36		include	Sensor.SSR
;R36	endif	;Superio_Support_Sensor
;R30A - end

;R36	ifdef	VIA686HM_Support				;R29
;R36		include	VIA686HM.SSR				;R29
;R36	endif	;VIA686HM_Support				;R29

endif	;SENSOR_IN_XGROUP					;R31
ENDIF	;SENSOR_KERNEL

;R25 - start
	public	WaitSmbus				
WaitSmbus	proc	near			
		push	cx			
		mov	cx,100h
	@@:						
		loop	short @B		
		pop	cx			
		ret				
WaitSmbus	endp
;R25 - end

;[]======================================================================[]
;[]======================================================================[]
		Public	Init_Onboard_Sensor
Init_Onboard_Sensor	Proc	Near

IF	SENSOR_KERNEL

		pushad
		push	ds
		push	es
		pushf
		cli

;R28 - start
ifdef	Superio_Support_Sensor				;R30A
ifndef	SENSOR_IN_XGROUP					;R31
;R30Aifdef	Superio_Support_Thermal
		call	Prg_Sensor_Chip
else	;SENSOR_IN_XGROUP					;R31
		call far ptr	X_Prg_Sensor_Chip		;R31
endif	;SENSOR_IN_XGROUP					;R31
;R30Aendif	;Superio_Support_Thermal
endif	;Superio_Support_Sensor				;R30A
;R28 - end
ifdef	LM75_Support
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_LM75_Chip
else	;SENSOR_IN_XGROUP				;R31	
		call far ptr	X_Prg_LM75_Chip 	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif;	LM75_Support

ifdef	LM78_Support
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_LM78_Chip
else	;SENSOR_IN_XGROUP				;R31	
		call far ptr	X_Prg_LM78_Chip		;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif;	LM78_Support

ifdef	LM80_Support					;R12
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_LM80_Chip			;R12
else	;SENSOR_IN_XGROUP				;R31	
		call far ptr	X_Prg_LM80_Chip		;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif;	LM80_Support					;R12

ifdef	LM81_Support					;R32
ifndef	SENSOR_IN_XGROUP				;R32
		call	Prg_LM81_Chip			;R32
else	;SENSOR_IN_XGROUP				;R32
		call far ptr	X_Prg_LM81_Chip		;R32
endif	;SENSOR_IN_XGROUP				;R32
endif;	LM81_Support					;R32

ifdef	LM84_Support					;R35
ifndef	SENSOR_IN_XGROUP				;R35
		call	Prg_LM84_Chip			;R35
else	;SENSOR_IN_XGROUP				;R35
		call far ptr	X_Prg_LM84_Chip		;R35
endif	;SENSOR_IN_XGROUP				;R35
endif;	LM84_Support					;R35

ifdef	GL520SM_Support					;R11
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_GL520SM_Chip		;R11
else	;SENSOR_IN_XGROUP				;R31	
		call far ptr	X_Prg_GL520SM_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;GL520SM_Support				;R11

ifdef	GL518SM_Support					;R05
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_GL518SM_Chip		;R05
else	;SENSOR_IN_XGROUP				;R31	
		call far ptr	X_Prg_GL518SM_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;GL518SM_Support				;R05

ifdef	W83781D_Support					;R07
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_W83781D_Chip		;R07
else	;SENSOR_IN_XGROUP				;R31	
		call far ptr	X_Prg_W83781D_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;W83781D_Support				;R07

ifdef	HT82791_Support					;R13
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_HT82791_Chip		;R13
else	;SENSOR_IN_XGROUP				;R31
		call far ptr	X_Prg_HT82791_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;HT82791_Support				;R13

ifdef	SIS5595_Support					;R08
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_SIS5595_Chip		;R08
else	;SENSOR_IN_XGROUP				;R31	
		call far ptr	X_Prg_SIS5595_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;SIS5595_Support				;R08

ifdef	MAX1617_Support					;R14
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_MAX1617_Chip		;R14
else	;SENSOR_IN_XGROUP				;R31
		call far ptr	X_Prg_MAX1617_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif;	MAX1617_Support					;R14

ifdef	ADM9240_Support					;R17
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_ADM9240_Chip		;R17
else	;SENSOR_IN_XGROUP				;R31
		call far ptr	X_Prg_ADM9240_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif;	ADM9240_Support					;R17

ifdef	W83782D_Support					;R18
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_W83782D_Chip		;R18
else	;SENSOR_IN_XGROUP				;R31
		call far ptr	X_Prg_W83782D_Chip      ;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;W83782D_Support				;R18

ifdef	W83783S_Support					;R20
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_W83783S_Chip		;R20
else	;SENSOR_IN_XGROUP				;R31
		call far ptr	X_Prg_W83783S_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;W83783S_Support				;R20

ifdef	W83783S_Support					;R20
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_W83783S_Chip		;R20
else	;SENSOR_IN_XGROUP				;R31
		call far ptr	X_Prg_W83783S_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;W83783S_Support				;R20

ifdef   SECONDARY_SSR_USE_W83783S		                ;R33
ifndef	SENSOR_IN_XGROUP					;R33
		call	Prg_SECOND_W83783S_Chip			;R33
else	;SENSOR_IN_XGROUP					;R33
		call far ptr	X_Prg_SECOND_W83783S_Chip 	;R33
endif	;SENSOR_IN_XGROUP			  		;R33
endif   ;SECONDARY_SSR_USE_W83783S				;R33

ifdef	AliM5879_Support				;R34
ifndef	SENSOR_IN_XGROUP				;R34	
		call	Prg_AliM5879_Chip		;R34
else	;SENSOR_IN_XGROUP				;R34
		call far ptr	X_Prg_AliM5879_Chip	;R34
endif	;SENSOR_IN_XGROUP				;R34	
endif	;AliM5879_Support				;R34

ifdef	Xeon_Thermal					;R27
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_Xeon			;R27
else	;SENSOR_IN_XGROUP				;R31
		call far ptr	X_Prg_Xeon		;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif	;Xeon_Thermal					;R27

ifdef	VIA686HM_Support				;R29
ifndef	SENSOR_IN_XGROUP				;R31	
		call	Prg_VIA686HM_Chip		;R29
else	;SENSOR_IN_XGROUP				;R31	
		call far ptr	X_Prg_VIA686HM_Chip	;R31
endif	;SENSOR_IN_XGROUP				;R31	
endif;	VIA686HM_Support				;R29

		popf
		pop	es
		pop	ds
		popad

ENDIF	;SENSOR_KERNEL

		ret

Init_Onboard_Sensor	Endp

;R24 - stats
ifdef	Check_Sensor_In_Setup
		Public	fProc_Hide_Sensor_If_Not_Plugged
fProc_Hide_Sensor_If_Not_Plugged	Proc	Far

	ifdef	W83781D_Support
ifndef	SENSOR_IN_XGROUP					;R31
		call	Hide_W83781D_Items
else	;SENSOR_IN_XGROUP					;R31
		Xcall	X_Hide_W83781D_Items			;R31
endif	;SENSOR_IN_XGROUP					;R31
	endif	;W83781D_Support
;R28 - start
	ifdef	Superio_Support_Sensor		;R30A
ifndef	SENSOR_IN_XGROUP					;R31
;R30A	ifdef	Superio_Support_Thermal		;R30
		call	Hide_Sensor_Items
else	;SENSOR_IN_XGROUP					;R31
		Xcall	X_Hide_Sensor_Items			;R31
endif	;SENSOR_IN_XGROUP					;R31
;R30A	endif	;Superio_Support_Thermal	;R30
	endif	;Superio_Support_Sensor		;R30A
;R28 - end
		ret

fProc_Hide_Sensor_If_Not_Plugged	Endp
endif	;Check_Sensor_In_Setup
;R24 - ends

;[]======================================================================[]
;[]======================================================================[]

E_GetItem_Value	Proc	Near
		jmp	F000_GetItem_Value
		ret
E_GetItem_Value	Endp

;R01 - start
ifndef	BIOS60						;R15
		public	Update_Sensor_Screen
Update_Sensor_Screen	Proc	Far

IF	SENSOR_KERNEL
		push	ds
		mov	ax, 40h
		mov	ds, ax
		mov	si, 6ch
;R10		test	byte ptr ds:[si], 0eh		    	;at 1 sec
		test	byte ptr ds:[si], 1fh		;R10	;at 2 sec
		pop	ds
		jnz	short Update_Sensor_End
ifdef	LM75_Support
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_LM75_Screen:near
		call	Update_LM75_Screen
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_LM75_Screen:far		;R31
		call far ptr	X_Update_LM75_Screen		;R31
endif	;SENSOR_IN_XGROUP					;R31
endif;	LM75_Support

ifdef	LM78_Support
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_LM78_Screen:near
		call	Update_LM78_Screen
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_LM78_Screen:far		;R31
		call far ptr	X_Update_LM78_Screen	      	;R31
endif	;SENSOR_IN_XGROUP					;R31
endif;	LM78_Support

;R28 - start
ifdef	Superio_Support_Sensor			;R30A
;R30Aifdef	Superio_Support_Thermal
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_Superio_Sensor_Screen:near
		call	Update_Superio_Sensor_Screen
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_Superio_Sensor_Screen:far	;R31
		call far ptr	X_Update_Superio_Sensor_Screen	;R31
endif	;SENSOR_IN_XGROUP					;R31
;R30Aendif	;Superio_Support_Thermal
endif	;Superio_Support_Sensor			;R30A
;R28 - end

ifdef	LM80_Support
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_LM80_Screen:near
		call	Update_LM80_Screen
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_LM80_Screen:far		;R31
		call far ptr	X_Update_LM80_Screen	      	;R31
endif	;SENSOR_IN_XGROUP					;R31
endif;	LM80_Support
;R32 - start
ifdef	LM81_Support
ifndef	SENSOR_IN_XGROUP					
		extrn	Update_LM81_Screen:near
		call	Update_LM81_Screen
else	;SENSOR_IN_XGROUP					
		extrn	X_Update_LM81_Screen:far		
		call far ptr	X_Update_LM81_Screen	      	
endif	;SENSOR_IN_XGROUP					
endif;	LM81_Support
;R32 - end

;R35 - start
ifdef	LM84_Support
ifndef	SENSOR_IN_XGROUP					
		extrn	Update_LM84_Screen:near
		call	Update_LM84_Screen
else	;SENSOR_IN_XGROUP					
		extrn	X_Update_LM84_Screen:far		
		call far ptr	X_Update_LM84_Screen	      	
endif	;SENSOR_IN_XGROUP					
endif;	LM84_Support
;R35 - end
ifdef	GL520SM_Support						;R11
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_GL520SM_Screen:near		;R11
		call	Update_GL520SM_Screen			;R11
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_GL520SM_Screen:far		;R31
		call far ptr	X_Update_GL520SM_Screen	      	;R31
endif	;SENSOR_IN_XGROUP					;R31
endif	;GL520SM_Support					;R11

ifdef	GL518SM_Support						;R05
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_GL518SM_Screen:near		;R05
		call	Update_GL518SM_Screen			;R05
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_GL518SM_Screen:far		;R31
		call far ptr	X_Update_GL518SM_Screen	       	;R31
endif	;SENSOR_IN_XGROUP					;R31
endif	;GL518SM_Support					;R05

ifdef	W83781D_Support						;R07
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_W83781D_Screen:near		;R07
		call	Update_W83781D_Screen			;R07
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_W83781D_Screen:far		;R31
		call far ptr	X_Update_W83781D_Screen 	;R31
endif	;SENSOR_IN_XGROUP					;R31
endif	;W83781D_Support					;R07

ifdef	HT82791_Support						;R13
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_HT82791_Screen:near		;R13
		call	Update_HT82791_Screen			;R13
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_HT82791_Screen:far		;R31
		call far ptr	X_Update_HT82791_Screen		;R31
endif	;SENSOR_IN_XGROUP					;R31
endif	;HT82791_Support					;R13

ifdef	SIS5595_Support						;R07
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_SIS5595_Screen:near		;R08
		call	Update_SIS5595_Screen			;R08
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_SIS5595_Screen:far		;R31
		call far ptr	X_Update_SIS5595_Screen		;R31
endif	;SENSOR_IN_XGROUP					;R31
endif	;SIS5595_Support					;R08

ifdef	MAX1617_Support						;R14
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_MAX1617_Screen:near		;R14
		call	Update_MAX1617_Screen			;R14
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_MAX1617_Screen:far		;R31
		call far ptr	X_Update_MAX1617_Screen		;R31
endif	;SENSOR_IN_XGROUP					;R31
endif;	MAX1617_Support						;R14

ifdef	ADM9240_Support						;R17
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_ADM9240_Screen:near		;R17
		call	Update_ADM9240_Screen			;R17
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_ADM9240_Screen:far		;R31
		call far ptr	X_Update_ADM9240_Screen		;R31
endif	;SENSOR_IN_XGROUP					;R31
endif;	ADM9240_Support						;R17

ifdef	W83782D_Support						;R18
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_W83782D_Screen:near		;R18
		call	Update_W83782D_Screen			;R18
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_W83782D_Screen:far		;R31
		call far ptr	X_Update_W83782D_Screen	       	;R31
endif	;SENSOR_IN_XGROUP					;R31
endif	;W83782D_Support					;R18

ifdef	W83783S_Support						;R20
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_W83783S_Screen:near		;R20
		call	Update_W83783S_Screen			;R20
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_W83783S_Screen:far		;R31
		call far ptr	X_Update_W83783S_Screen		;R31
endif	;SENSOR_IN_XGROUP					;R31
endif	;W83783S_Support					;R20

ifdef	AliM5879_Support					;R34
ifndef	SENSOR_IN_XGROUP					;R34
		extrn	Update_AliM5879_Screen:near		;R34
		call	Update_AliM5879_Screen			;R34
else	;SENSOR_IN_XGROUP					;R34
		extrn	X_Update_AliM5879_Screen:far		;R34
		call    far ptr	X_Update_AliM5879_Screen	;R34
endif	;SENSOR_IN_XGROUP					;R34
endif	;AliM5879_Support					;R34

ifdef   SECONDARY_SSR_USE_W83783S		                ;R33
ifndef	SENSOR_IN_XGROUP					;R33
		extrn	Update_SECOND_W83783S_Screen:near	;R33
		call	Update_SECOND_W83783S_Screen		;R33
else	;SENSOR_IN_XGROUP					;R33
		extrn	X_Update_SECOND_W83783S_Screen:far	;R33 
		call far ptr	X_Update_SECOND_W83783S_Screen	;R33 
endif	;SENSOR_IN_XGROUP			  		;R33
endif  ;SECONDARY_SSR_USE_W83783S				;R33

ifdef	Xeon_Thermal						;R27
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_Xeon_Screen:near			;R27
		call	Update_Xeon_Screen			;R27
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_Xeon_Screen:far      		;R31
		call far ptr	X_Update_Xeon_Screen  		;R31
endif	;SENSOR_IN_XGROUP					;R31
endif	;Xeon_Thermal						;R27

ifdef	VIA686HM_Support					;R29
ifndef	SENSOR_IN_XGROUP					;R31
		extrn	Update_VIA686HM_Screen:near		;R29
		call	Update_VIA686HM_Screen			;R29
else	;SENSOR_IN_XGROUP					;R31
		extrn	X_Update_VIA686HM_Screen:far		;R31
		call far ptr	X_Update_VIA686HM_Screen 	;R31
endif	;SENSOR_IN_XGROUP					;R31
endif;	VIA686HM_Support					;R29

Update_Sensor_End:
ENDIF	;SENSOR_KERNEL

	   	retf
Update_Sensor_Screen	Endp
endif	;BIOS60						;R15
;R01 - end

;R31 - start
ifdef	SENSOR_IN_XGROUP       
ifdef	ACPI_Support
ifndef	VIA686HM_SUPPORT
ifndef	SIS5595_Support					
		Public	Ct_FillTempPointer
Ct_FillTempPointer	Proc	Near
			call far ptr	X_Ct_FillTempPointer
			ret
Ct_FillTempPointer	endp
endif	;SIS5595_Support					
endif	;VIA686HM_SUPPORT
endif	;ACPI_Support				
endif	;SENSOR_IN_XGROUP				
;R31 - end

ECODE		ENDS

;R31 - start
ifdef	SENSOR_IN_XGROUP					

XGROUP		GROUP	XCODE
XCODE		SEGMENT USE16 PARA PUBLIC 'XCODE'
		ASSUME	CS:XGROUP,ES:XGROUP

IF	SENSOR_KERNEL
		COMPILE_FOR_SENSOR_KERNEL_ASM	=	2
		include	ALL_SSR.INC

;R36	ifdef	LM75_Support
;R36		include	LM75.SSR
;R36	endif	;LM75_Support
;R36
;R36	ifdef	LM78_Support
;R36		include	LM78.SSR
;R36	endif	;LM78_Support
;R36
;R36	ifdef	LM80_Support					
;R36		include	LM80.SSR				
;R36	endif	;LM80_Support					
;R36
;R36	ifdef	LM81_Support				;R32
;R36		include	LM81.SSR			;R32
;R36	endif	;LM81_Support				;R32	
;R36
;R36	ifdef	LM84_Support				;R35
;R36		include	LM84.SSR			;R35
;R36	endif	;LM84_Support				;R35	
;R36
;R36	ifdef	GL520SM_Support					
;R36		include	GL520SM.SSR				
;R36	endif	;GL520SM_Support				
;R36
;R36	ifdef	GL518SM_Support					
;R36		include	GL518SM.SSR				
;R36	endif	;GL518SM_Support				
;R36
;R36	ifdef	W83781D_Support					
;R36		include	W83781D.SSR				
;R36	endif	;W83781D_Support				
;R36
;R36	ifdef	HT82791_Support 				
;R36		include	HT82791.SSR				
;R36	endif	;HT82791_Support				
;R36
;R36	ifdef	SIS5595_Support					
;R36		include	SIS5595.SSR				
;R36	endif	;SIS5595_Support				
;R36
;R36	ifdef	MAX1617_Support					
;R36		include	MAX1617.SSR				
;R36	endif	;MAX1617_Support				
;R36
;R36	ifdef	ADM9240_Support					
;R36		include	ADM9240.SSR				
;R36	endif	;ADM9240_Support				
;R36
;R36	ifdef	W83782D_Support					
;R36		include	W83782D.SSR				
;R36	endif	;W83782D_Support				
;R36
;R36	ifdef	W83783S_Support					
;R36		include	W83783S.SSR				
;R36	endif	;W83783S_Support				
;R36
;R36	ifdef   USE_DUAL_SENSOR			;R33
;R36		include	SECOND.SSR		;R33
;R36	endif  ;USE_DUAL_SENSOR			;R33
;R36
;R36	ifdef	Xeon_Thermal					
;R36		include	Xeon.SSR				
;R36	endif	;Xeon_Thermal					
;R36
;R36	ifdef	Superio_Support_Sensor
;R36		include	Sensor.SSR
;R36	endif	;Superio_Support_Sensor
;R36
;R36	ifdef	VIA686HM_Support				
;R36		include	VIA686HM.SSR				
;R36	endif	;VIA686HM_Support				

ENDIF	;SENSOR_KERNEL

XCODE		ENDS

endif	;SENSOR_IN_XGROUP				
;R31 - end

		END

