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)
Sep 30 2024, 2:35 PM
Unknown Object (File)
Sep 30 2024, 2:20 PM
Unknown Object (File)
Sep 30 2024, 12:13 PM
Unknown Object (File)
Sep 28 2024, 1:42 AM
Unknown Object (File)
Sep 24 2024, 8:24 AM
Unknown Object (File)
Sep 22 2024, 3:37 PM
Unknown Object (File)
Sep 20 2024, 5:21 AM
Unknown Object (File)
Sep 17 2024, 4:56 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