PERFORCE change 28614 for review
Peter Wemm
peter at FreeBSD.org
Tue Apr 8 22:23:59 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=28614
Change 28614 by peter at peter_daintree on 2003/04/08 22:23:46
do not need serial_* anymore, It served well!
Affected files ...
.. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#32 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#58 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#32 (text+ko) ====
@@ -86,8 +86,6 @@
pushq $PSL_KERNEL
popfq
- call init_serial
-
/* Find the metadata pointers before we lose them */
movq %rsp, %rbp
xorq %rax, %rax
@@ -145,71 +143,3 @@
ret
#endif
-
-/***********************************************************************/
-
-
-#define COMBRD(x) (1843200 / (16*(x)))
-#define COMCONSOLE 0x3f8
-#define CONSPEED 9600
-
- .globl serial_putc
- .type serial_putc at function
-serial_putc:
- movl $10000, %ecx # timeout
- movl $COMCONSOLE + 5, %edx # line status reg
-1:
- decl %ecx
- je 2f
- inb %dx, %al
- testb $0x20, %al
- je 1b # TX buffer not empty
-
- movq %rdi, %rax
- subl $5, %edx # TX output reg
- outb %al, %dx # send this one
-
-2:
- ret
-
- .globl init_serial
- .type init_serial at function
-init_serial:
- movl $COMCONSOLE + 3, %edx # line control reg
- movb $0x80, %al
- outb %al, %dx # enable DLAB
-
- subl $3, %edx # divisor latch, low byte
- movb $COMBRD(CONSPEED) & 0xff, %al
- outb %al, %dx
- incl %edx # divisor latch, high byte
- movb $COMBRD(CONSPEED) >> 8, %al
- outb %al, %dx
-
- incl %edx # fifo control register (if any)
- xorl %eax,%eax
- outb %al, %dx # disable fifo to reduce worst-case busy-wait
-
- incl %edx # line control reg
- movb $0x03, %al
- outb %al, %dx # 8N1
-
- incl %edx # modem control reg
- outb %al, %dx # enable DTR/RTS
-
- /* Flush the input buffer. */
- incl %edx # line status reg
-1:
- subl $5, %edx # rx buffer reg
- inb %dx, %al # throw away (unconditionally the first time)
- addl $5, %edx # line status reg
- inb %dx, %al
- testb $0x01, %al
- jne 1b # more
-
- ret
-
- .bss
- ALIGN_DATA /* just to be sure */
- .space 0x1000 /* space for bootstack - temporary stack */
-bootstack:
==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#58 (text+ko) ====
@@ -1684,16 +1684,3 @@
}
return 0;
}
-
-extern void serial_putc(int);
-void serial_puts(char *);
-
-void
-serial_puts(char *s)
-{
- while (*s) {
- if (*s == '\n')
- serial_putc('\r');
- serial_putc(*s++);
- }
-}
More information about the p4-projects
mailing list