Page MenuHomeFreeBSD

Make pre-Unicode keymap support depend on COMPAT_FREEBSD13
ClosedPublic

Authored by se on Feb 9 2023, 4:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 16, 5:03 PM
Unknown Object (File)
Apr 13 2024, 1:17 AM
Unknown Object (File)
Apr 13 2024, 1:17 AM
Unknown Object (File)
Apr 10 2024, 11:10 PM
Unknown Object (File)
Apr 10 2024, 8:20 PM
Unknown Object (File)
Dec 20 2023, 6:59 AM
Unknown Object (File)
Oct 18 2023, 1:44 PM
Unknown Object (File)
Aug 15 2023, 12:19 AM
Subscribers
None

Details

Summary

Support for the full range of Unicode character codes has been added to the main keymap back in 2009, with compatibility shims added in 2011 (to support an older kbdcontrol command on a new kernel during an upgrade from FreeBSD-8 to FreeBSD-9)

Unicode support for accented characters that are reached via dead key combinations has been added just recently, again with compatibility shims to allow all combinations of old/new kernel and old/new kbdcontrol command to load and display the keymaps including the dead key table. (But full Unicode in the dead key table requires both a new kernel and kbdcontrol command.)

This review contains patches that make the support for pre-Unicode ioctl() parameters depend on COMPAT_FREEBSD13 (in -CURRENT, no MFC to 13 is planned). This includes both the main keymap and the dead key map.

The kbdcontrol command passes COMPAT_FREEBSD13 to the build via the Makefile to make this program compatible with kernels before -CURRENT as of 2023-02-06 or (the forthcoming) FreeBSD-13.2. (This use of a kernel option in a userland Makefile is not common, but simplifies the pre-compiler conditionals in kbio.h a lot. The line that define COMPAT_FREEBSD13 shall be removed from the Makefile as soon as support of a new kbdcontrol command on an old kernel is no longer deemed necessary.)

The shims are compiled into the kernel for FreeBSD-13 after 2023-02-09 (the merge date for Unicode support in the dead key table) and compatibility shims are supposed to stay there at least until support for FreeBSD-13.1 has ended.

Test Plan

This patch set has been build tested in most combinations of kernel and kbdcontrol command built with and without COMPAT_FREEBSD13 and on an old kernel (-CURRENT before 2023-02-06).

I have put up this review to allow further testing of the patch set, but also to discuss style issues:

  • Is it OK to use COMPAT_FREEBSD13 in the userland to get the compatibility definitions from kbio.h?
  • Should the conditions in kbdcontrol.c use COMPAT_FREEBSD13 instead of OGIO_KEYMAP et.al.?
  • In kbio.h there were a lot of "#ifdef _KERNEL", which I have replaced with "#ifdef COMPAT_FREEBSD13", since the latter normally implies _KERNEL (and this simplifies kbdcontrol.c, which does not need to also #define _KERNEL in addition to COMAPT_FREEBSD13 to get the compatibility defines)?
  • Any other remarks regarding style?

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable