Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jOfFl-0006iZ-Ms for mharc-grub-devel@gnu.org; Wed, 15 Apr 2020 06:26:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43595) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOfFi-0006aN-LV for grub-devel@gnu.org; Wed, 15 Apr 2020 06:26:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOfFg-0005fF-FB for grub-devel@gnu.org; Wed, 15 Apr 2020 06:26:41 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:46293 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jOfFg-0005ey-8P for grub-devel@gnu.org; Wed, 15 Apr 2020 06:26:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586946399; 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=cFX2oHFt7+5FRcuOkOIiM0Ta0im3MVghAILZNyWEJK4=; b=Q3hmcK9vEy16JHewRLptPA2CGC1Ym4IQn0wUMSWtaKOZr9pwc0yKf+5oej2t0AZWVpztiv 96r1zy5gSnx7jz7/cBaUE0q7taF9oL6C+U/uPSc9pMklavdzW+eIDGOtgPWLrzw5gS6tCL p8n0pkm3OHpIBB+Sf6MODxgtzZWDbgs= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-we3_Mgb0PL2dtDzMg62YJw-1; Wed, 15 Apr 2020 06:26:37 -0400 X-MC-Unique: we3_Mgb0PL2dtDzMg62YJw-1 Received: by mail-wr1-f69.google.com with SMTP id o10so10287113wrj.7 for ; Wed, 15 Apr 2020 03:26:37 -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=ZUqpPTJWpOKZFc73A1tfk1651VTo03zcEh4Nrz61QGc=; b=r3sAWDGraCyPYYWT2Ynalnop0BmOgUQjgLrMhLlVp0OG4L0hU/tZP7xKw9SgNxWHyv lwqgBn1TxDIaytG6sr2MN+6EyYCfJeU++ScIDpea2uC1ZqGIj4hfKkpmrJljPHZOEs71 J+PTu2c88fNHEOLP4hVqEJX3kvLn8E6d9fltMlt+8YA3mYiqfhLxk/F7a0JGbAevErWe ONCMRE+9JywG5rYFeiG/RWje09WXEYoojoOZJtV8ZliEC0C11cXNOyBklRulf+up8v3H idJDlMuSVc+m9Ij43F1Cf5mGFnmY8RuCp1p4LzPuT+KOkI8Ks0MNXqBKUwc4PkwuKskM /XDA== X-Gm-Message-State: AGi0PuaHB+Lp0NBbvRBsEJ4BZ+lA5+p4mdvRSuFoyKN2DvyGrT2uEPqq k9SP9laF1I+fI6hC6+9x4l7UUtXJwVtn9I25bou8SQDUYhPfkNq4bwYZuLE3vrdIzI3iaY/DpHy CXf/UPIOm+2Y= X-Received: by 2002:adf:eb88:: with SMTP id t8mr27774559wrn.224.1586946396434; Wed, 15 Apr 2020 03:26:36 -0700 (PDT) X-Google-Smtp-Source: APiQypLl6DVuoe+Ty4RGJoboV8v7FysXurMo+Tj63XhyM1EK1MLchTHFQOX9eMz/MRYqV1mzf9483g== X-Received: by 2002:adf:eb88:: with SMTP id t8mr27774538wrn.224.1586946396201; Wed, 15 Apr 2020 03:26:36 -0700 (PDT) Received: from minerva.redhat.com ([2a01:c50f:ab80:6700:527f:85b3:5615:ff0b]) by smtp.gmail.com with ESMTPSA id n124sm22803517wma.11.2020.04.15.03.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 03:26:35 -0700 (PDT) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Hans de Goede , Daniel Kiper , Javier Martinez Canillas Subject: [PATCH v3 1/6] efi/console: Move grub_console_set{colorstate, cursor} higher in the file Date: Wed, 15 Apr 2020 12:26:17 +0200 Message-Id: <20200415102622.1890550-2-javierm@redhat.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200415102622.1890550-1-javierm@redhat.com> References: <20200415102622.1890550-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.81 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: Wed, 15 Apr 2020 10:26:44 -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 Reviewed-by: Daniel Kiper --- Changes in v3: None 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