Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jLk9S-0007b4-Ar for mharc-grub-devel@gnu.org; Tue, 07 Apr 2020 05:04:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55301) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLk9P-0007Yp-A5 for grub-devel@gnu.org; Tue, 07 Apr 2020 05:04:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLk9O-0005bc-6P for grub-devel@gnu.org; Tue, 07 Apr 2020 05:04:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58819 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jLk9O-0005az-2u for grub-devel@gnu.org; Tue, 07 Apr 2020 05:04:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586250245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dIT60W2m80kdvHFo5+Zu0si65x67Zy0adHM1HHTfbhs=; b=bNP5N41L+zXm96HXsLQPxMlhEY5hdTT5Y8S/GuRS92CJGoH4T/J0l2om/axRnw68pOoD7g 6zR0x4TBiiSbBa1wHENuO5hemuDqR82aq0iE0yDJ+GIIv0CRxbsDfvwUNoHXM1FadW0keR pWfDqFL2F+ELEAgjFTCATmVFu9eyvqA= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-115-zFgAQmR2PhauIvuUgYPTlw-1; Tue, 07 Apr 2020 05:04:01 -0400 X-MC-Unique: zFgAQmR2PhauIvuUgYPTlw-1 Received: by mail-wm1-f72.google.com with SMTP id s9so330368wmh.2 for ; Tue, 07 Apr 2020 02:04:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aXKfRtY5ewzqIqtv9oUEkmkBpWJd1FQwyFdBYc+frTk=; b=gKFWCKv/K+3e33yd4QIvEbjhlEtsOAvdXou86oKBnjedoAKjFOsJyfw17inONFyp2R 3E+Jn5tA5NB7Hwuhn4gzMAV/2BFlN8W1xz53qtRdeMTYijXUcahCy3X7IzyL7+jwKLnQ awQxN8mF6OFv9Nm8chI3AtTc1giTfi9mnYxUs+cECc+6NCSS5fCY3qCHaieqFDKgoSQf CdkTNxY0ENpiPTxOrM8gpEOd2n8eu9nqRdLOX2wP0haCxW6yfvF16VnPF4nAZPLImPbb ZvNCA/KtXcdWSNRHOI0yIc89xUWe9npSH2S1sgl6avLoaU9ZiP8vKBiMLF+YqWFPvNHm nhOA== X-Gm-Message-State: AGi0PubzWuyd/nmsC+1j0Im9GFbdKuCnK7TOh+3BKhWxnXHU7l9u3EoE CPa9jZVyWCI9Vu2owYzG1oJZ9zj8nb6JaIGTwpn3uH2bXvThG8oDINad0OPH+Xz9gviKXQj2YDt R5pLIvxmbl9Q= X-Received: by 2002:a1c:7919:: with SMTP id l25mr1420231wme.12.1586250240329; Tue, 07 Apr 2020 02:04:00 -0700 (PDT) X-Google-Smtp-Source: APiQypJZM2FspXY/TfoZSHnOpDsNWWoYeeGu+SyLZxJSYc5ntpZSTP/aOMMuJtYofZx7Qp+RzYRNUA== X-Received: by 2002:a1c:7919:: with SMTP id l25mr1420199wme.12.1586250240057; Tue, 07 Apr 2020 02:04:00 -0700 (PDT) Received: from minerva.home ([2a01:c50f:ab80:6700:527f:85b3:5615:ff0b]) by smtp.gmail.com with ESMTPSA id o13sm7805444wrm.74.2020.04.07.02.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 02:03:59 -0700 (PDT) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Hans de Goede , Daniel Kiper , Javier Martinez Canillas Subject: [PATCH v2 1/6] efi/console: Move grub_console_set{colorstate, cursor} higher in the file Date: Tue, 7 Apr 2020 11:03:46 +0200 Message-Id: <20200407090351.50921-2-javierm@redhat.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200407090351.50921-1-javierm@redhat.com> References: <20200407090351.50921-1-javierm@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2020 09:04:08 -0000 This is just a preparatory patch to move the functions higher in the file, since these will be called by the grub_prepare_for_text_output() function that will be introduced in a later patch. The logic is unchanged by this patch. Functions definitions are just moved to avoid a forward declaration in a later patch, keeping the code clean. Signed-off-by: Javier Martinez Canillas --- Changes in v2: - Mention in commit message that logic is unchanged after patch #1. - Add better explanation about why the change in patch #1 is needed. grub-core/term/efi/console.c | 82 ++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c index 4840cc59d3f..59d9604472a 100644 --- a/grub-core/term/efi/console.c +++ b/grub-core/term/efi/console.c @@ -65,6 +65,47 @@ map_char (grub_uint32_t c) return c; } =20 +static void +grub_console_setcolorstate (struct grub_term_output *term +=09=09=09 __attribute__ ((unused)), +=09=09=09 grub_term_color_state state) +{ + grub_efi_simple_text_output_interface_t *o; + + if (grub_efi_is_finished) + return; + + o =3D grub_efi_system_table->con_out; + + switch (state) { + case GRUB_TERM_COLOR_STANDARD: + efi_call_2 (o->set_attributes, o, GRUB_TERM_DEFAULT_STANDARD_COLOR +=09=09 & 0x7f); + break; + case GRUB_TERM_COLOR_NORMAL: + efi_call_2 (o->set_attributes, o, grub_term_normal_color & 0x7f); + break; + case GRUB_TERM_COLOR_HIGHLIGHT: + efi_call_2 (o->set_attributes, o, grub_term_highlight_color & 0x7f); + break; + default: + break; + } +} + +static void +grub_console_setcursor (struct grub_term_output *term __attribute__ ((unus= ed)), +=09=09=09int on) +{ + grub_efi_simple_text_output_interface_t *o; + + if (grub_efi_is_finished) + return; + + o =3D grub_efi_system_table->con_out; + efi_call_2 (o->enable_cursor, o, on); +} + static void grub_console_putchar (struct grub_term_output *term __attribute__ ((unused= )), =09=09 const struct grub_unicode_glyph *c) @@ -281,47 +322,6 @@ grub_console_cls (struct grub_term_output *term __attr= ibute__ ((unused))) efi_call_2 (o->set_attributes, o, orig_attr); } =20 -static void -grub_console_setcolorstate (struct grub_term_output *term -=09=09=09 __attribute__ ((unused)), -=09=09=09 grub_term_color_state state) -{ - grub_efi_simple_text_output_interface_t *o; - - if (grub_efi_is_finished) - return; - - o =3D grub_efi_system_table->con_out; - - switch (state) { - case GRUB_TERM_COLOR_STANDARD: - efi_call_2 (o->set_attributes, o, GRUB_TERM_DEFAULT_STANDARD_COLOR -=09=09 & 0x7f); - break; - case GRUB_TERM_COLOR_NORMAL: - efi_call_2 (o->set_attributes, o, grub_term_normal_color & 0x7f); - break; - case GRUB_TERM_COLOR_HIGHLIGHT: - efi_call_2 (o->set_attributes, o, grub_term_highlight_color & 0x7f); - break; - default: - break; - } -} - -static void -grub_console_setcursor (struct grub_term_output *term __attribute__ ((unus= ed)), -=09=09=09int on) -{ - grub_efi_simple_text_output_interface_t *o; - - if (grub_efi_is_finished) - return; - - o =3D grub_efi_system_table->con_out; - efi_call_2 (o->enable_cursor, o, on); -} - static grub_err_t grub_efi_console_output_init (struct grub_term_output *term) { --=20 2.25.1