NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/41011: Useless code in arch/i386/stand/lib/conio.S



>Number:         41011
>Category:       kern
>Synopsis:       Useless code in  arch/i386/stand/lib/conio.S
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 14 08:30:00 +0000 2009
>Originator:     Gao Ya'nan
>Release:        NetBSD-current and NetBSD-4.0
>Organization:
>Environment:
NetBSD abutter.foo.org 4.0 NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:20:10 PST 
2007  
builds@wb34:/home/builds/ab/netbsd-4-0-RELEASE/i386/200712160005Z-obj/home/builds/ab/netbsd-4-0-RELEASE/src/sys/arch/i386/compile/GENERIC
 i386
>Description:
In arch/i386/stand/lib/conio.S, the function conclr is below:
------------------------------->cut<------------------------------------
ENTRY(conclr)

        ... ...

        movb    8(%ebp),%cl

        call    _C_LABEL(prot_to_real)  # enter real mode
        .code16

        /* Clear screen. */
        movw    $0x0600, %ax
        movw    $0x0700, %bx
        xorw    %cx, %cx
        movw    $0x184f, %dx    /* 80x25 */
        int     $0x10

        /* Home cursor. */
        movb    $0x02, %ah
        xorw    %bx, %bx
        xorw    %dx, %dx
        int     $0x10

        ... ...
------------------------------->cut<------------------------------------

Before calling prot_to_real, we move a byte to CL register from stack, but 
actually we don't employ CL register and clear CX register immediately.

And I guess the code was from the function conputc without delete the useless 
instructions
>How-To-Repeat:
Review the code
>Fix:
Delete the useless code



Home | Main Index | Thread Index | Old Index