[BRLTTY] braille drivers size
Samuel Thibault
samuel.thibault at ens-lyon.org
Sat Jul 15 19:55:28 EDT 2006
Hi,
I've looked a bit at why drivers are big, and it seems like the most
space-consuming code is keybinding. By looking at the generated assembly
code, statements like
(from the HandyTech driver)
switch (byte) {
case (BWK_BACKWARD):
*command = BRL_CMD_FWINLT;
return 1;
case ...
are compiled into a table of addresses which point to a bunch of little
codes which look like:
movl $BRL_CMD_FWINLT,(%ecx)
movl $0x01,(%esp)
jmp out
which is 18 bytes long on x86, i.e. far less space-efficient than a
mere table containing commands. Maybe a generic table-based facility
would be helpful here. Such facility could handle both indexed tables
(when raw keycodes can be used as index) and pairing tables (when the
keycodes space is so sparse that using them as indexes would waste a lot
of space). The Papenmeier driver has functions for the latter tables.
And BTW, the way the Papenmeier stores keybinding tables is not very
efficient, and duplicates a lot of data. The attached patch is a
factorization proposal (it is not complete: other functions need
correction too). This shrinks that driver from 60KB down to 20KB...
Samuel
More information about the BRLTTY
mailing list