1
0
mirror of https://github.com/systemd/systemd synced 2026-04-13 18:44:51 +02:00

Compare commits

..

No commits in common. "a68b2443994abf90f3b121a641c55f8172e1215b" and "6eed65d455e9e76b020acbd858c20eafa43cebf8" have entirely different histories.

5 changed files with 21 additions and 28 deletions

View File

@ -41,7 +41,7 @@ jobs:
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@cd783c8a29bdcf5a5c79c5137889e24651fa626c uses: github/codeql-action/init@5f532563584d71fdef14ee64d17bafb34f751ce5
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
config-file: ./.github/codeql-config.yml config-file: ./.github/codeql-config.yml
@ -49,7 +49,7 @@ jobs:
- run: sudo -E .github/workflows/unit_tests.sh SETUP - run: sudo -E .github/workflows/unit_tests.sh SETUP
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@cd783c8a29bdcf5a5c79c5137889e24651fa626c uses: github/codeql-action/autobuild@5f532563584d71fdef14ee64d17bafb34f751ce5
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@cd783c8a29bdcf5a5c79c5137889e24651fa626c uses: github/codeql-action/analyze@5f532563584d71fdef14ee64d17bafb34f751ce5

View File

@ -199,8 +199,8 @@
<varlistentry> <varlistentry>
<term>beep</term> <term>beep</term>
<listitem><para>Beep n times when the n-th entry in the boot menu is shown (default disabled). <listitem><para>Beep once as soon as the boot menu is shown (default disabled). Currently,
Currently, only x86 is supported, where it uses the PC speaker.</para></listitem> only x86 is supported, where it uses the PC speaker.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -590,7 +590,7 @@ static BOOLEAN menu_run(
_cleanup_freepool_ CHAR16 *clearline = NULL, *status = NULL; _cleanup_freepool_ CHAR16 *clearline = NULL, *status = NULL;
UINT32 timeout_efivar_saved = config->timeout_sec_efivar; UINT32 timeout_efivar_saved = config->timeout_sec_efivar;
UINT32 timeout_remain = config->timeout_sec == TIMEOUT_MENU_FORCE ? 0 : config->timeout_sec; UINT32 timeout_remain = config->timeout_sec == TIMEOUT_MENU_FORCE ? 0 : config->timeout_sec;
BOOLEAN exit = FALSE, run = TRUE, firmware_setup = FALSE; BOOLEAN exit = FALSE, run = TRUE, firmware_setup = FALSE, do_beep = config->beep;
INT64 console_mode_initial = ST->ConOut->Mode->Mode, console_mode_efivar_saved = config->console_mode_efivar; INT64 console_mode_initial = ST->ConOut->Mode->Mode, console_mode_efivar_saved = config->console_mode_efivar;
UINTN default_efivar_saved = config->idx_default_efivar; UINTN default_efivar_saved = config->idx_default_efivar;
@ -727,9 +727,10 @@ static BOOLEAN menu_run(
ST->ConOut->OutputString(ST->ConOut, clearline + 1 + x + len); ST->ConOut->OutputString(ST->ConOut, clearline + 1 + x + len);
} }
/* Beep several times so that the selected entry can be distinguished. */ if (do_beep) {
if (config->beep) beep();
beep(idx_highlight + 1); do_beep = FALSE;
}
err = console_key_read(&key, timeout_remain > 0 ? 1000 * 1000 : UINT64_MAX); err = console_key_read(&key, timeout_remain > 0 ? 1000 * 1000 : UINT64_MAX);
if (err == EFI_TIMEOUT) { if (err == EFI_TIMEOUT) {

View File

@ -769,11 +769,10 @@ static inline void outb(UINT16 port, UINT8 value) {
asm volatile("outb %0, %1" : : "a"(value), "Nd"(port)); asm volatile("outb %0, %1" : : "a"(value), "Nd"(port));
} }
void beep(UINTN beep_count) { void beep(void) {
enum { enum {
PITCH = 500, PITCH = 500,
BEEP_DURATION_USEC = 100 * 1000, DURATION_USEC = 100 * 1000,
WAIT_DURATION_USEC = 400 * 1000,
PIT_FREQUENCY = 0x1234dd, PIT_FREQUENCY = 0x1234dd,
SPEAKER_CONTROL_PORT = 0x61, SPEAKER_CONTROL_PORT = 0x61,
@ -789,22 +788,15 @@ void beep(UINTN beep_count) {
outb(TIMER_CONTROL2_PORT, counter & 0xFF); outb(TIMER_CONTROL2_PORT, counter & 0xFF);
outb(TIMER_CONTROL2_PORT, (counter >> 8) & 0xFF); outb(TIMER_CONTROL2_PORT, (counter >> 8) & 0xFF);
/* Turn speaker on. */
UINT8 value = inb(SPEAKER_CONTROL_PORT); UINT8 value = inb(SPEAKER_CONTROL_PORT);
value |= SPEAKER_ON_MASK;
outb(SPEAKER_CONTROL_PORT, value);
while (beep_count > 0) { BS->Stall(DURATION_USEC);
/* Turn speaker on. */
value |= SPEAKER_ON_MASK;
outb(SPEAKER_CONTROL_PORT, value);
BS->Stall(BEEP_DURATION_USEC); /* Turn speaker off. */
value &= ~SPEAKER_ON_MASK;
/* Turn speaker off. */ outb(SPEAKER_CONTROL_PORT, value);
value &= ~SPEAKER_ON_MASK;
outb(SPEAKER_CONTROL_PORT, value);
beep_count--;
if (beep_count > 0)
BS->Stall(WAIT_DURATION_USEC);
}
} }
#endif #endif

View File

@ -171,7 +171,7 @@ extern UINT8 _text, _data;
#endif #endif
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
void beep(UINTN beep_count); void beep(void);
#else #else
static inline void beep(UINTN beep_count) {} static inline void beep(void) {}
#endif #endif