From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jCpeB-0004js-P6 for mharc-grub-devel@gnu.org; Fri, 13 Mar 2020 15:07:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpe9-0004hD-1L for grub-devel@gnu.org; Fri, 13 Mar 2020 15:07:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpe7-0001LL-HB for grub-devel@gnu.org; Fri, 13 Mar 2020 15:07:00 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26622 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 1jCpe7-0001Ix-DG for grub-devel@gnu.org; Fri, 13 Mar 2020 15:06:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584126418; 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=CFxuCR1nRmcGZhA8LyF2P2ZrMsxFvtEfGcU7l9vs7s4=; b=OLOZOdVWkFZWnjK4c7Lg5EXA5+Bp+ZSsMuiglAjrm+z9sdMMUI0eqd1cd3jFBKB0bI5lc5 z8dwEOEasUdys8D3iwu/sbm2okvgr1VFllcWP2G0/Op/82iyOH8U7+i73tOlzxmgMB9RIV HTLedj74Q5YIB9Ex6wdihaLYLCrayLw= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-_9NOz7VYONeYV9e6T1pcCg-1; Fri, 13 Mar 2020 15:06:57 -0400 X-MC-Unique: _9NOz7VYONeYV9e6T1pcCg-1 Received: by mail-wr1-f72.google.com with SMTP id p5so4707885wrj.17 for ; Fri, 13 Mar 2020 12:06:57 -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=s3It67Z/aDINM8E6RXFsWLT8GlEPtbXtHbKeHlN/ibQ=; b=eTv+k5MOpfjf/J/rvIWS6+IC1R0ZAYFPTg/VGxgttFbhqFA4tHtgeKrFpps7Aw4dWd 4Y3nKq1zGeaNrilpnpVd4qpuYD3mhrzIeuwp4hghnbTRVczs0H2SH0Yr/S5SbCvIbovN mv3yuTq+yGv8v6AfLKgJ9edmCg8+P9BHYCKcxIsrS63y3XjTnAEgZkLtk42vHMcULYxK snkcoVY3hPubNzAIowzfKWZbS0Ti8BlEAFdS4Oit1rnpkBu/5oWEX55RNHur1pr0+FbQ 6HxoKFpsN0ABstNCcEZW/h0Zy38UcSs3UP0+FD/BCg7zWSLi1IZ7LXMDyOUX4CS5DSBV k1MQ== X-Gm-Message-State: ANhLgQ25XV4/vhPIgxSvQKyzZXDE3MSS2gW5532sEhRdGyAgSyzTbHWB Mk4xlyXRjbdAkgDCqHpfrzzIOtXLiElXMLmKk5wXwlffndBLNeDOeWhIxDS3C9TfIh4AaVTRRzR ps7NdYoyVAe8= X-Received: by 2002:a1c:6605:: with SMTP id a5mr12340361wmc.32.1584126415023; Fri, 13 Mar 2020 12:06:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuF+hIrVYFNkKloG1JbZ2qaYO0UCga1LsNxmA9T4JclrXq0nP0ciZ8RATOfoQNV3AGUgiHTOA== X-Received: by 2002:a1c:6605:: with SMTP id a5mr12340338wmc.32.1584126414798; Fri, 13 Mar 2020 12:06:54 -0700 (PDT) Received: from minerva.redhat.com ([2a01:c50f:ab80:6700:527f:85b3:5615:ff0b]) by smtp.gmail.com with ESMTPSA id z11sm1919763wmc.30.2020.03.13.12.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 12:06:53 -0700 (PDT) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Daniel Kiper , Javier Martinez Canillas , Hans de Goede Subject: [PATCH 02/10] efi/console: Move grub_console_set{colorstate, cursor} higher in the file Date: Fri, 13 Mar 2020 20:06:34 +0100 Message-Id: <20200313190642.822157-3-javierm@redhat.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313190642.822157-1-javierm@redhat.com> References: <20200313190642.822157-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: Fri, 13 Mar 2020 19:07:02 -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 subsequent patch. Moving the functions will avoid a forward declaration in that next patch. Signed-off-by: Javier Martinez Canillas --- 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.24.1