^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) union ull_union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) unsigned long long ull;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) unsigned int high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) unsigned int low;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) } ui;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) int __ucmpdi2(unsigned long long a, unsigned long long b)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) union ull_union au = {.ull = a};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) union ull_union bu = {.ull = b};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) if (au.ui.high < bu.ui.high)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) else if (au.ui.high > bu.ui.high)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) return 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) if (au.ui.low < bu.ui.low)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) else if (au.ui.low > bu.ui.low)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) return 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) }