171d7fec4Smrg/*
271d7fec4Smrg# $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_msr_asm.S,v 1.1 2002/12/12 22:13:34 dawes Exp $
371d7fec4Smrg##########################################################################
471d7fec4Smrg# NSC_LIC_ALTERNATIVE_PREAMBLE
571d7fec4Smrg#
671d7fec4Smrg# Revision 1.0
771d7fec4Smrg#
871d7fec4Smrg# National Semiconductor Alternative GPL-BSD License
971d7fec4Smrg#
1071d7fec4Smrg# National Semiconductor Corporation licenses this software
1171d7fec4Smrg# ("Software"):
1271d7fec4Smrg#
1371d7fec4Smrg# Geode Xfree frame buffer driver
1471d7fec4Smrg#
1571d7fec4Smrg# under one of the two following licenses, depending on how the
1671d7fec4Smrg# Software is received by the Licensee.
1771d7fec4Smrg#
1871d7fec4Smrg# If this Software is received as part of the Linux Framebuffer or
1971d7fec4Smrg# other GPL licensed software, then the GPL license designated
2071d7fec4Smrg# NSC_LIC_GPL applies to this Software; in all other circumstances
2171d7fec4Smrg# then the BSD-style license designated NSC_LIC_BSD shall apply.
2271d7fec4Smrg#
2371d7fec4Smrg# END_NSC_LIC_ALTERNATIVE_PREAMBLE
2471d7fec4Smrg##########################################################################
2571d7fec4Smrg# NSC_LIC_BSD
2671d7fec4Smrg#
2771d7fec4Smrg# National Semiconductor Corporation Open Source License for
2871d7fec4Smrg#
2971d7fec4Smrg# Geode Xfree frame buffer driver
3071d7fec4Smrg#
3171d7fec4Smrg# (BSD License with Export Notice)
3271d7fec4Smrg#
3371d7fec4Smrg# Copyright (c) 1999-2001
3471d7fec4Smrg# National Semiconductor Corporation.
3571d7fec4Smrg# All rights reserved.
3671d7fec4Smrg#
3771d7fec4Smrg# Redistribution and use in source and binary forms, with or without
3871d7fec4Smrg# modification, are permitted provided that the following conditions
3971d7fec4Smrg# are met:
4071d7fec4Smrg#
4171d7fec4Smrg#   * Redistributions of source code must retain the above copyright
4271d7fec4Smrg#     notice, this list of conditions and the following disclaimer.
4371d7fec4Smrg#
4471d7fec4Smrg#   * Redistributions in binary form must reproduce the above
4571d7fec4Smrg#     copyright notice, this list of conditions and the following
4671d7fec4Smrg#     disclaimer in the documentation and/or other materials provided
4771d7fec4Smrg#     with the distribution.
4871d7fec4Smrg#
4971d7fec4Smrg#   * Neither the name of the National Semiconductor Corporation nor
5071d7fec4Smrg#     the names of its contributors may be used to endorse or promote
5171d7fec4Smrg#     products derived from this software without specific prior
5271d7fec4Smrg#     written permission.
5371d7fec4Smrg#
5471d7fec4Smrg# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5571d7fec4Smrg# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5671d7fec4Smrg# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
5771d7fec4Smrg# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
5871d7fec4Smrg# NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
5971d7fec4Smrg# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
6071d7fec4Smrg# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
6171d7fec4Smrg# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
6271d7fec4Smrg# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
6371d7fec4Smrg# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
6471d7fec4Smrg# INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
6571d7fec4Smrg# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
6671d7fec4Smrg# OF SUCH DAMAGE.
6771d7fec4Smrg#
6871d7fec4Smrg# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
6971d7fec4Smrg# YOUR JURISDICTION. It is licensee's responsibility to comply with
7071d7fec4Smrg# any export regulations applicable in licensee's jurisdiction. Under
7171d7fec4Smrg# CURRENT (2001) U.S. export regulations this software
7271d7fec4Smrg# is eligible for export from the U.S. and can be downloaded by or
7371d7fec4Smrg# otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
7471d7fec4Smrg# destinations which include Cuba, Iraq, Libya, North Korea, Iran,
7571d7fec4Smrg# Syria, Sudan, Afghanistan and any other country to which the U.S.
7671d7fec4Smrg# has embargoed goods and services.
7771d7fec4Smrg#
7871d7fec4Smrg# END_NSC_LIC_BSD
7971d7fec4Smrg##########################################################################
8071d7fec4Smrg# NSC_LIC_GPL
8171d7fec4Smrg#
8271d7fec4Smrg# National Semiconductor Corporation Gnu General Public License for
8371d7fec4Smrg#
8471d7fec4Smrg# Geode Xfree frame buffer driver
8571d7fec4Smrg#
8671d7fec4Smrg# (GPL License with Export Notice)
8771d7fec4Smrg#
8871d7fec4Smrg# Copyright (c) 1999-2001
8971d7fec4Smrg# National Semiconductor Corporation.
9071d7fec4Smrg# All rights reserved.
9171d7fec4Smrg#
9271d7fec4Smrg# Redistribution and use in source and binary forms, with or without
9371d7fec4Smrg# modification, are permitted under the terms of the GNU General
9471d7fec4Smrg# Public License as published by the Free Software Foundation; either
9571d7fec4Smrg# version 2 of the License, or (at your option) any later version
9671d7fec4Smrg#
9771d7fec4Smrg# In addition to the terms of the GNU General Public License, neither
9871d7fec4Smrg# the name of the National Semiconductor Corporation nor the names of
9971d7fec4Smrg# its contributors may be used to endorse or promote products derived
10071d7fec4Smrg# from this software without specific prior written permission.
10171d7fec4Smrg#
10271d7fec4Smrg# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10371d7fec4Smrg# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10471d7fec4Smrg# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
10571d7fec4Smrg# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
10671d7fec4Smrg# NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
10771d7fec4Smrg# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
10871d7fec4Smrg# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
10971d7fec4Smrg# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
11071d7fec4Smrg# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
11171d7fec4Smrg# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
11271d7fec4Smrg# INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
11371d7fec4Smrg# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
11471d7fec4Smrg# OF SUCH DAMAGE. See the GNU General Public License for more details.
11571d7fec4Smrg#
11671d7fec4Smrg# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
11771d7fec4Smrg# YOUR JURISDICTION. It is licensee's responsibility to comply with
11871d7fec4Smrg# any export regulations applicable in licensee's jurisdiction. Under
11971d7fec4Smrg# CURRENT (2001) U.S. export regulations this software
12071d7fec4Smrg# is eligible for export from the U.S. and can be downloaded by or
12171d7fec4Smrg# otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
12271d7fec4Smrg# destinations which include Cuba, Iraq, Libya, North Korea, Iran,
12371d7fec4Smrg# Syria, Sudan, Afghanistan and any other country to which the U.S.
12471d7fec4Smrg# has embargoed goods and services.
12571d7fec4Smrg#
12671d7fec4Smrg# You should have received a copy of the GNU General Public License
12771d7fec4Smrg# along with this file; if not, write to the Free Software Foundation,
12871d7fec4Smrg# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
12971d7fec4Smrg#
13071d7fec4Smrg# END_NSC_LIC_GPL
13171d7fec4Smrg*/
13271d7fec4Smrg
13371d7fec4Smrg#include "assyntax.h"
13471d7fec4Smrg
13571d7fec4Smrg	FILE("nsc_msr_asm.s")
13671d7fec4Smrg
13771d7fec4Smrg	AS_BEGIN
13871d7fec4Smrg
13971d7fec4Smrg	SEG_TEXT
14071d7fec4Smrg
14171d7fec4Smrg	ALIGNTEXT4
14271d7fec4Smrg
14371d7fec4Smrg	GLOBL	GLNAME(nsc_asm_msr_vsa_rd)
14471d7fec4Smrg
14571d7fec4SmrgGLNAME(nsc_asm_msr_vsa_rd):
14671d7fec4Smrg
14771d7fec4Smrg	PUSH_L	(EBP)
14871d7fec4Smrg	MOV_L	(ESP,EBP)
14971d7fec4Smrg
15071d7fec4Smrg	PUSH_L	(EAX)
15171d7fec4Smrg	PUSH_L	(EBX)
15271d7fec4Smrg	PUSH_L	(ECX)
15371d7fec4Smrg	PUSH_L	(EDX)
15471d7fec4Smrg
15571d7fec4Smrg	MOV_L	(REGOFF(8,EBP),ECX)
15671d7fec4Smrg
15771d7fec4Smrg	/* unlock */
15871d7fec4Smrg	MOV_W	(CONST(0x0ac1c),DX)
15971d7fec4Smrg	MOV_W	(CONST(0x0fc53),AX)
16071d7fec4Smrg	OUT_W
16171d7fec4Smrg
16271d7fec4Smrg	MOV_W	(CONST(0x0ac1c),DX)
16371d7fec4Smrg	MOV_W	(CONST(0x0007),AX)
16471d7fec4Smrg	OUT_W
16571d7fec4Smrg
16671d7fec4Smrg	MOV_W	(CONST(0x0ac1e),DX)
16771d7fec4Smrg	IN_W
16871d7fec4Smrg
16971d7fec4Smrg	MOV_L	(REGOFF(12,EBP),EBX)
17071d7fec4Smrg	MOV_L	(EDX,REGIND(EBX))
17171d7fec4Smrg	MOV_L	(REGOFF(16,EBP),EBX)
17271d7fec4Smrg	MOV_L	(EAX,REGIND(EBX))
17371d7fec4Smrg
17471d7fec4Smrg	POP_L	(EDX)
17571d7fec4Smrg	POP_L	(ECX)
17671d7fec4Smrg	POP_L	(EBX)
17771d7fec4Smrg	POP_L	(EAX)
17871d7fec4Smrg
17971d7fec4Smrg	LEAVE
18071d7fec4Smrg	RET
18171d7fec4Smrg
18271d7fec4Smrg/*###################################*/
18371d7fec4Smrg
18471d7fec4Smrg
18571d7fec4Smrg	ALIGNTEXT4
18671d7fec4Smrg
18771d7fec4Smrg	GLOBL	GLNAME(nsc_asm_msr_vsa_wr)
18871d7fec4Smrg
18971d7fec4SmrgGLNAME(nsc_asm_msr_vsa_wr):
19071d7fec4Smrg
19171d7fec4Smrg	PUSH_L	(EBP)
19271d7fec4Smrg	MOV_L	(ESP,EBP)
19371d7fec4Smrg
19471d7fec4Smrg	PUSH_L	(EAX)
19571d7fec4Smrg	PUSH_L	(EBX)
19671d7fec4Smrg	PUSH_L	(ECX)
19771d7fec4Smrg	PUSH_L	(EDX)
19871d7fec4Smrg	PUSH_L	(EDI)
19971d7fec4Smrg	PUSH_L	(ESI)
20071d7fec4Smrg
20171d7fec4Smrg	MOV_L	(REGOFF(8,EBP),ECX)
20271d7fec4Smrg
20371d7fec4Smrg	/* unlock */
20471d7fec4Smrg	MOV_W	(CONST(0x0ac1c),DX)
20571d7fec4Smrg	MOV_L	(CONST(0x0fc530007),EAX)
20671d7fec4Smrg	OUT_L
20771d7fec4Smrg
20871d7fec4Smrg	MOV_L	(REGOFF(12,EBP),EBX)
20971d7fec4Smrg	MOV_L	(REGOFF(16,EBP),EAX)
21071d7fec4Smrg
21171d7fec4Smrg	XOR_L	(ESI,ESI)
21271d7fec4Smrg	XOR_L	(EDI,EDI)
21371d7fec4Smrg
21471d7fec4Smrg	MOV_W	(CONST(0x0ac1e),DX)
21571d7fec4Smrg
21671d7fec4Smrg	OUT_W
21771d7fec4Smrg
21871d7fec4Smrg	POP_L	(ESI)
21971d7fec4Smrg	POP_L	(EDI)
22071d7fec4Smrg	POP_L	(EDX)
22171d7fec4Smrg	POP_L	(ECX)
22271d7fec4Smrg	POP_L	(EBX)
22371d7fec4Smrg	POP_L	(EAX)
22471d7fec4Smrg
22571d7fec4Smrg	LEAVE
22671d7fec4Smrg	RET
22771d7fec4Smrg
22871d7fec4Smrg/*###################################*/
22971d7fec4Smrg
230