elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
elks
/
arch
/
i86
/
drivers
/
char
/
conio-necv25.c
File editor
/* * conio API for NEC V25 Headless Console * * This file contains code used for the embedded NEC V25 family only. * Not used now, only for reference. * * 29. Oct. 2025 swausd */ #include <linuxmt/config.h> #include <arch/io.h> #include <arch/irq.h> #include <arch/necv25.h> #include "conio.h" #ifdef UNUSED /* initialize */ void conio_init(void) { } /* * Poll for console input available. * Return nonzero character received else 0 if none ready. * Called approximately every ~8/100 seconds. */ int conio_poll(void) { __extension__ ({ \ asm volatile ( \ ".include \"../../../../include/arch/necv25.inc\" \n"\ "push %%ds \n"\ "movw $NEC_HW_SEGMENT, %%bx // load DS to access memmory mapped CPU registers \n"\ "movw %%bx, %%ds \n"\ "xorw %%ax, %%ax \n"\ "testb $IRQFLAG, %%ds:SRIC(%%si) // SRIC: char ready? \n"\ "jz 1f // no \n"\ "movb %%ds:(%%si), %%al // RXB: get char \n"\ "movb $(IRQMSK+IRQPRID), %%ds:SRIC(%%si) // SRIC: clear Rx ready flag \n"\ "1: \n"\ "pop %%ds \n"\ : \ : "S" (NEC_RXB1) \ : "ax", "bx", "memory" ); \ }); } void conio_putc(byte_t c) { __extension__ ({ \ asm volatile ( \ ".include \"../../../../include/arch/necv25.inc\" \n"\ "push %%ds \n"\ "movw $NEC_HW_SEGMENT, %%bx // load DS to access memmory mapped CPU registers \n"\ "movw %%bx, %%ds \n"\ "1: \n"\ "testb $IRQFLAG, %%ds:STIC(%%si) // STIC: wait for Tx ready \n"\ "jz 1b \n"\ "pushf // save iqr status and disable all interrupts \n"\ "cli \n"\ "movb $(IRQMSK+IRQPRID), %%ds:STIC(%%si) // STIC: clear Tx ready flag \n"\ "movb %%al, %%ds:TXB(%%si) // TXB: send char \n"\ "popf // restore flags and irq status \n"\ "pop %%ds \n"\ : \ : "S" (NEC_RXB1), \ "Ral" (c) \ : "bx", "memory" ); \ }); } #endif
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history