From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kh4Kx-0008Vn-Pb for mharc-grub-devel@gnu.org; Mon, 23 Nov 2020 00:24:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kh4Kw-0008Ro-Dv for grub-devel@gnu.org; Mon, 23 Nov 2020 00:24:26 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:56011) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kh4Ku-0006bq-Q3 for grub-devel@gnu.org; Mon, 23 Nov 2020 00:24:26 -0500 Received: by mail-wm1-x342.google.com with SMTP id c9so16733995wml.5 for ; Sun, 22 Nov 2020 21:24:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vc+qT8xEZRWrMXVtWJ41Jsun0q0LZGbSI563yoUdyRU=; b=v/kuqq5r1V48Xzd6AwUFUXXn9A2umtwLYbVnr2dR/Ck/hrslZxO47hbVylow1Hwix0 p3C7fNV5KjmDwG0AJqJOKPRZ/YFqpbVrnOtEPnLsz0RkUWOSoIEN4YvW1f96lcTW2G4I 3DPRFTVVkXJPxKmYEYXHxlfucYut0xmRpV2M7iiKR4QTgffdiCm4jtrydqIsRKjpGJXS T0Y06P/d5Oy/KPKJ/nDuPqSU/AhHnb5YeOCoFZTF3BkBxkz1nYAZFsJtHXOVCn/lBpc9 u9pVhR3mnq83zI8OwpQgBOvzsHm9CmrRPryhKfAojrUswSa335wm1j7p9atmIyrEL/K1 wOdA== 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=Vc+qT8xEZRWrMXVtWJ41Jsun0q0LZGbSI563yoUdyRU=; b=FrKwf31Hwla9CKKK+CmJw28M7KiBGzSTUpqyohGCaISe+xtpLNZ25OJxVyljP7HiV+ oX3LgDZbTCviV/3rvX6KPOb6PVzseXc0Aj4l12P51hni/TNu0rG+izdOVMBx1IpWHwbs xRwO9IHWqMNUxaZOjph+rVMJzj4lp1c7o7syQop2rPEk9j3/FYQalWySO+72bi2eMZ9T CLqiAgdXn+dYvU6mdjdPGWoHT7Z6MPVaoyKG6Va8fQ1ncVi8pt/4pzEkoshLKxrl661h dAu4dQVR/+8sa1d/9bZLLRZvTGXYRzIB46n1E4r4ky2yULXhM7+upI7572BIhW8s9hXi 4y6A== X-Gm-Message-State: AOAM5316I1c1au3VW2rF+s+JDgTMxe/Wr0F1mSy/dlTTn/F7fEfnWgVM UniKqXAHijWZD41WJ/CrOvQk5hamrl0uZg== X-Google-Smtp-Source: ABdhPJx6q9hZ4bTA/AxtuNnwjN2mXaCFUc1b5YBXmZn9fQtwTAHSwOihSxJ8TQKkc3anoCxxIOVi8Q== X-Received: by 2002:a1c:23cf:: with SMTP id j198mr21487907wmj.6.1606109063221; Sun, 22 Nov 2020 21:24:23 -0800 (PST) Received: from localhost.localdomain ([136.49.211.192]) by smtp.gmail.com with ESMTPSA id f16sm11631780wmh.7.2020.11.22.21.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2020 21:24:22 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Patrick Steinhardt , Daniel Kiper , Glenn Washburn Subject: [PATCH v5 10/11] misc: Add grub_log2ull macro for calculating log base 2 of 64-bit integers Date: Sun, 22 Nov 2020 23:23:23 -0600 Message-Id: <37257725c7f8046427731fd5158684fdcf4dd816.1606108123.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=development@efficientek.com; helo=mail-wm1-x342.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Mon, 23 Nov 2020 05:24:26 -0000 Signed-off-by: Glenn Washburn --- include/grub/misc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/grub/misc.h b/include/grub/misc.h index b7ca6dd58..85a481f0c 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -482,4 +482,7 @@ void EXPORT_FUNC(grub_real_boot_time) (const char *file, #define grub_max(a, b) (((a) > (b)) ? (a) : (b)) #define grub_min(a, b) (((a) < (b)) ? (a) : (b)) +#define grub_log2ull(n) (GRUB_TYPE_BITS (grub_uint64_t) \ + - __builtin_clzll (n) - 1) + #endif /* ! GRUB_MISC_HEADER */ -- 2.27.0