From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH 4/8] powerpc-ieee1275: Fix warnings and alignment
Date: Wed, 11 Sep 2024 12:41:21 +0300 [thread overview]
Message-ID: <20240911094125.1813-4-phcoder@gmail.com> (raw)
In-Reply-To: <20240911094125.1813-1-phcoder@gmail.com>
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
grub-core/kern/ieee1275/init.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index dfbd0b899..e3abd51a8 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -789,7 +789,10 @@ grub_ieee1275_ibm_cas (void)
{
int rc;
grub_ieee1275_ihandle_t root;
- grub_uint8_t ibm_arch_platform_support[8];
+ union {
+ grub_uint8_t u8[8];
+ grub_uint32_t u32[2];
+ } ibm_arch_platform_support;
grub_ssize_t actual;
grub_uint8_t xive_support = 0;
grub_uint8_t mmu_support = 0;
@@ -807,23 +810,23 @@ grub_ieee1275_ibm_cas (void)
grub_ieee1275_get_integer_property (grub_ieee1275_chosen,
"ibm,arch-vec-5-platform-support",
- (grub_uint32_t *) ibm_arch_platform_support,
+ ibm_arch_platform_support.u32,
sizeof (ibm_arch_platform_support),
&actual);
- for (i = 0; i < prop_len; i++)
+ for (i = 0; i < prop_len; i += 2)
{
- switch (ibm_arch_platform_support[i])
+ switch (ibm_arch_platform_support.u8[i])
{
case XIVE_INDEX:
- if (ibm_arch_platform_support[i + 1] & MAX_SUPPORTED)
+ if (ibm_arch_platform_support.u8[i + 1] & MAX_SUPPORTED)
xive_support = XIVE_ENABLED;
else
xive_support = 0;
break;
case MMU_INDEX:
- if (ibm_arch_platform_support[i + 1] & MAX_SUPPORTED)
+ if (ibm_arch_platform_support.u8[i + 1] & MAX_SUPPORTED)
mmu_support = RADIX_ENABLED;
else
mmu_support = HASH_ENABLED;
@@ -831,7 +834,7 @@ grub_ieee1275_ibm_cas (void)
case RADIX_GTSE_INDEX:
if (mmu_support == RADIX_ENABLED)
- radix_gtse_support = ibm_arch_platform_support[i + 1] & RADIX_GTSE_ENABLED;
+ radix_gtse_support = ibm_arch_platform_support.u8[i + 1] & RADIX_GTSE_ENABLED;
else
radix_gtse_support = 0;
break;
@@ -840,8 +843,6 @@ grub_ieee1275_ibm_cas (void)
/* Ignoring the other indexes of ibm,arch-vec-5-platform-support. */
break;
}
- /* Skipping the property value. */
- i++;
}
struct cas_vector vector =
--
2.39.2
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2024-09-11 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 9:41 [PATCH 1/8] riscv64: Support riscv_align relocations Vladimir Serbinenko
2024-09-11 9:41 ` [PATCH 2/8] compiler-rt: Add __multi3 Vladimir Serbinenko
2024-09-11 9:41 ` [PATCH 3/8] Support clang integrated-as sparc64 Vladimir Serbinenko
2024-09-11 9:41 ` Vladimir Serbinenko [this message]
2024-09-11 9:41 ` [PATCH 5/8] efi/linux: Silence warning Vladimir Serbinenko
2024-09-11 9:41 ` [PATCH 6/8] btrfs: Add an explicit GRUB_PACKED Vladimir Serbinenko
2024-09-11 9:41 ` [PATCH 7/8] Enable __clzsi2/__clzdi2 on arm Vladimir Serbinenko
2024-09-11 9:41 ` [PATCH 8/8] configure: Try -msoft-float -mfloat-abi=soft " Vladimir Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240911094125.1813-4-phcoder@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.