From patchwork Fri Aug 13 21:35:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1516768 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=U4ZJFIXb; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GmcLM6rqqz9sW8 for ; Sat, 14 Aug 2021 07:35:54 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mEeqC-0008LA-Ky; Fri, 13 Aug 2021 21:35:48 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mEeq7-0008Ks-JO for fwts-devel@lists.ubuntu.com; Fri, 13 Aug 2021 21:35:43 +0000 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 53C683F0A1 for ; Fri, 13 Aug 2021 21:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628890543; bh=jUlvWSOUxfjeFH3hxC5P06SCVx6pKIU73D6UZ149pto=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=U4ZJFIXb9SYyPZqZeHHU3u7EMDKMvpRGgosn3d6iZ+SHc/bN0ykyMmXC8i67Tg79h NzR1x++MVMHkf/yphxaWhrQje2OixTAd4CeYuCHg+QNUNM5Gum1+sZwDtYLpTnbas/ CVWI4fdQCDwE5m929tyo+82gAYTKpxcKLKiRnOfJzlCztszeEHO9RAb/Zp1yBRM5OO eLq9zt3GRyHM2E6IEjpOYzvGq0zJwP0Q++/5wqyCcegZH1nYtPEALkalKPikZNJBbC i7C3Ywe/FJF9U72NMddO3pRuGzDGtoUUS4UWaj3Gv9VnUUORr9Ia37WZrZGa1802Zv OraOwKHmUaSVw== Received: by mail-pl1-f198.google.com with SMTP id r11-20020a170902c60b00b0012d99290650so1468116plr.9 for ; Fri, 13 Aug 2021 14:35:43 -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:mime-version :content-transfer-encoding; bh=jUlvWSOUxfjeFH3hxC5P06SCVx6pKIU73D6UZ149pto=; b=EnHiGw2sDDFGLD5ukIp4IVLxzEm6ApF5iE5JwtUbAXEkA0CRH5HB4xPSN8UoPSwsIs LF7vYoviMXVAr78BHmJTDRXik4azeYc4/EkRNTVOBP/KtL6gFotZY8NWb50z3cDVFiep R1sA8ImQxH+2LOrScI6sS7rAqHJ+pinQkLoFM5N9Jd0G5OBz0idZBzFpKo/M//+rn1ij 1Fj+wOqrszaQXjNIkHbDmaw7MT716SLjQ0C3N4Df+UtNDUOKk6ZI/dTnJ3hK7+Jnxj0P tVlYtTjACBWobO6eG1MU/K5aWezh94UPUNOmUOjVzR+g6nq1/TV+f/yCTsedkCsthiC2 8FTQ== X-Gm-Message-State: AOAM530E7UJZNpnjEfAGwLm2tEaMMbVaHpJiOMmb4BseY1K96ve/uAyo 1ywWdbeslfBMF5hUxxZFHmHiJsl4+LiRJ0poAE0hAmFCTjHjJFrJDfCH3KIIaCnoV0WTM+NASyI QnDbnQvLtEBvmJXBjE2qGhDBg1hfJ9qvFVaEDe2lV X-Received: by 2002:a17:90a:7a89:: with SMTP id q9mr3452745pjf.122.1628890541313; Fri, 13 Aug 2021 14:35:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlTiM/X36MaKuyy6uNHQHR+guG/5W8jy4ysk9EcVRvFiV4qN1gq+d1g2iZW+qBFxT1G55x0g== X-Received: by 2002:a17:90a:7a89:: with SMTP id q9mr3452727pjf.122.1628890540988; Fri, 13 Aug 2021 14:35:40 -0700 (PDT) Received: from canonical.com (node-1w7jr9yeotzddnlkq9kweiluf.ipv6.telus.net. [2001:56a:7943:7600::d17]) by smtp.gmail.com with ESMTPSA id j4sm3997359pgi.6.2021.08.13.14.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 14:35:40 -0700 (PDT) From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/2] lib: fwts_acpi_tables: add a function to get FADT versions Date: Fri, 13 Aug 2021 15:35:38 -0600 Message-Id: <20210813213539.546368-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Alex Hung Acked-by: Ivan Hu Acked-by: Colin Ian King --- src/lib/include/fwts_acpi_tables.h | 1 + src/lib/src/fwts_acpi_tables.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/lib/include/fwts_acpi_tables.h b/src/lib/include/fwts_acpi_tables.h index 2ac649bb..6b768d79 100644 --- a/src/lib/include/fwts_acpi_tables.h +++ b/src/lib/include/fwts_acpi_tables.h @@ -92,5 +92,6 @@ void fwts_acpi_space_id(fwts_framework *fw, const char *table, const char *field const uint8_t actual, const uint8_t num_type, ...); uint32_t fwts_get_acpi_version(fwts_framework *fw); +void fwts_get_fadt_version(fwts_framework *fw, uint8_t *major, uint8_t *minor); #endif diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index b08cbdfd..9f12539f 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -1829,3 +1829,17 @@ uint32_t fwts_get_acpi_version(fwts_framework *fw) return acpi_version; } + +/* + * fwts_get_fadt_version() + * get fadt major and minor versions + */ +void fwts_get_fadt_version(fwts_framework *fw, uint8_t *major, uint8_t *minor) +{ + uint32_t acpi_version; + + /* ACPI version = FADT major & minor versions */ + acpi_version = fwts_get_acpi_version(fw); + *major = (acpi_version & 0xF00) >> 8; + *minor = (acpi_version & 0xFF) >> 4; +}