/linux-6.6.21/arch/arm/lib/ |
D | lib1funcs.S | 40 .macro ARM_DIV_BODY dividend, divisor, result, curbit 44 clz \curbit, \divisor 48 mov \divisor, \divisor, lsl \result 54 @ Initially shift the divisor left 3 bits if possible, 58 tst \divisor, #0xe0000000 59 moveq \divisor, \divisor, lsl #3 63 @ Unless the divisor is very big, shift it up in multiples of 65 @ division loop. Continue shifting until the divisor is 67 1: cmp \divisor, #0x10000000 68 cmplo \divisor, \dividend [all …]
|
/linux-6.6.21/lib/math/ |
D | div64.c | 67 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument 72 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem() 74 if (divisor > 0) in div_s64_rem() 77 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem() 78 if (divisor < 0) in div_s64_rem() 98 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument 100 u32 high = divisor >> 32; in div64_u64_rem() 105 quot = div_u64_rem(dividend, divisor, &rem32); in div64_u64_rem() 109 quot = div_u64(dividend >> n, divisor >> n); in div64_u64_rem() 114 *remainder = dividend - quot * divisor; in div64_u64_rem() [all …]
|
/linux-6.6.21/include/linux/ |
D | math64.h | 26 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument 28 *remainder = dividend % divisor; in div_u64_rem() 29 return dividend / divisor; in div_u64_rem() 40 static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument 42 *remainder = dividend % divisor; in div_s64_rem() 43 return dividend / divisor; in div_s64_rem() 54 static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument 56 *remainder = dividend % divisor; in div64_u64_rem() 57 return dividend / divisor; in div64_u64_rem() 67 static inline u64 div64_u64(u64 dividend, u64 divisor) in div64_u64() argument [all …]
|
D | math.h | 86 #define DIV_ROUND_CLOSEST(x, divisor)( \ argument 89 typeof(divisor) __d = divisor; \ 91 ((typeof(divisor))-1) > 0 || \ 101 #define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ argument 103 typeof(divisor) __d = divisor; \
|
/linux-6.6.21/arch/alpha/lib/ |
D | divide.S | 56 #define divisor $1 macro 104 bis $25,$25,divisor 109 LONGIFY(divisor) 114 beq divisor, 9f /* div by zero */ 125 1: cmpult divisor,modulus,compare 126 s8addq divisor,$31,divisor 130 1: cmpult divisor,modulus,compare 131 blt divisor, 2f 132 addq divisor,divisor,divisor 141 cmpule divisor,modulus,compare [all …]
|
D | ev6-divide.S | 66 #define divisor $1 macro 114 bis $25,$25,divisor # E : 120 LONGIFY(divisor) # E : U L L U 127 beq divisor, 9f /* div by zero */ 144 1: cmpult divisor,modulus,compare # E : 145 s8addq divisor,$31,divisor # E : 149 1: cmpult divisor,modulus,compare # E : 152 blt divisor, 2f # U : U L U L 154 addq divisor,divisor,divisor # E : 172 cmpule divisor,modulus,compare # E : [all …]
|
/linux-6.6.21/drivers/cpufreq/ |
D | sparc-us2e-cpufreq.c | 86 unsigned long old_divisor, unsigned long divisor) in frob_mem_refresh() argument 91 refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); in frob_mem_refresh() 118 unsigned long old_divisor, unsigned long divisor) in us2e_transition() argument 123 if (old_divisor == 2 && divisor == 1) { in us2e_transition() 126 frob_mem_refresh(0, clock_tick, old_divisor, divisor); in us2e_transition() 127 } else if (old_divisor == 1 && divisor == 2) { in us2e_transition() 128 frob_mem_refresh(1, clock_tick, old_divisor, divisor); in us2e_transition() 131 } else if (old_divisor == 1 && divisor > 2) { in us2e_transition() 135 2, divisor); in us2e_transition() 136 } else if (old_divisor > 2 && divisor == 1) { in us2e_transition() [all …]
|
/linux-6.6.21/lib/crypto/mpi/ |
D | mpi-div.c | 18 void mpi_fdiv_qr(MPI quot, MPI rem, MPI dividend, MPI divisor); 20 void mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor) in mpi_fdiv_r() argument 22 int divisor_sign = divisor->sign; in mpi_fdiv_r() 29 if (rem == divisor) { in mpi_fdiv_r() 30 temp_divisor = mpi_copy(divisor); in mpi_fdiv_r() 31 divisor = temp_divisor; in mpi_fdiv_r() 34 mpi_tdiv_r(rem, dividend, divisor); in mpi_fdiv_r() 37 mpi_add(rem, rem, divisor); in mpi_fdiv_r() 43 void mpi_fdiv_q(MPI quot, MPI dividend, MPI divisor) in mpi_fdiv_q() argument 46 mpi_fdiv_qr(quot, tmp, dividend, divisor); in mpi_fdiv_q() [all …]
|
/linux-6.6.21/drivers/acpi/acpica/ |
D | utmath.c | 257 u32 divisor, u64 *out_quotient, u32 *out_remainder) in acpi_ut_short_divide() argument 267 if (divisor == 0) { in acpi_ut_short_divide() 278 ACPI_DIV_64_BY_32(0, dividend_ovl.part.hi, divisor, in acpi_ut_short_divide() 281 ACPI_DIV_64_BY_32(remainder32, dividend_ovl.part.lo, divisor, in acpi_ut_short_divide() 316 union uint64_overlay divisor; in acpi_ut_divide() local 334 divisor.full = in_divisor; in acpi_ut_divide() 336 if (divisor.part.hi == 0) { in acpi_ut_divide() 347 ACPI_DIV_64_BY_32(0, dividend.part.hi, divisor.part.lo, in acpi_ut_divide() 350 ACPI_DIV_64_BY_32(partial1, dividend.part.lo, divisor.part.lo, in acpi_ut_divide() 361 normalized_divisor = divisor; in acpi_ut_divide() [all …]
|
/linux-6.6.21/drivers/iio/common/hid-sensors/ |
D | hid-sensor-attributes.c | 71 static void simple_div(int dividend, int divisor, int *whole, in simple_div() argument 78 if (divisor == 0) { in simple_div() 82 *whole = dividend/divisor; in simple_div() 83 rem = dividend % divisor; in simple_div() 85 while (rem <= divisor) { in simple_div() 89 *micro_frac = (rem / divisor) * int_pow(10, 6 - exp); in simple_div() 95 int divisor = int_pow(10, exp); in split_micro_fraction() local 97 *val1 = no / divisor; in split_micro_fraction() 98 *val2 = no % divisor * int_pow(10, 6 - exp); in split_micro_fraction() 133 int divisor; in convert_to_vtf_format() local [all …]
|
/linux-6.6.21/Documentation/devicetree/bindings/clock/ti/ |
D | divider.txt | 8 the register is one less than the actual divisor value. E.g: 10 register value actual divisor value 17 ti,index-starts-at-one - valid divisor values start at 1, not the default 19 register value actual divisor value 24 ti,index-power-of-two - valid divisor values are powers of two. E.g: 25 register value actual divisor value 34 Which will map the resulting values to a divisor table by their index: 35 register value actual divisor value 38 2 <invalid divisor, skipped> 65 - ti,min-div : min divisor for dividing the input clock rate, only [all …]
|
/linux-6.6.21/arch/mips/cavium-octeon/executive/ |
D | cvmx-helper-jtag.c | 50 uint32_t divisor = cvmx_sysinfo_get()->cpu_clock_hz / (25 * 1000000); in cvmx_helper_qlm_jtag_init() local 51 divisor = (divisor - 1) >> 2; in cvmx_helper_qlm_jtag_init() 53 while (divisor) { in cvmx_helper_qlm_jtag_init() 55 divisor = divisor >> 1; in cvmx_helper_qlm_jtag_init()
|
/linux-6.6.21/sound/soc/codecs/ |
D | tlv320aic26.c | 70 int fsref, divisor, wlen, pval, jval, dval, qval; in aic26_hw_params() local 79 case 8000: fsref = 48000; divisor = AIC26_DIV_6; break; in aic26_hw_params() 80 case 11025: fsref = 44100; divisor = AIC26_DIV_4; break; in aic26_hw_params() 81 case 12000: fsref = 48000; divisor = AIC26_DIV_4; break; in aic26_hw_params() 82 case 16000: fsref = 48000; divisor = AIC26_DIV_3; break; in aic26_hw_params() 83 case 22050: fsref = 44100; divisor = AIC26_DIV_2; break; in aic26_hw_params() 84 case 24000: fsref = 48000; divisor = AIC26_DIV_2; break; in aic26_hw_params() 85 case 32000: fsref = 48000; divisor = AIC26_DIV_1_5; break; in aic26_hw_params() 86 case 44100: fsref = 44100; divisor = AIC26_DIV_1; break; in aic26_hw_params() 87 case 48000: fsref = 48000; divisor = AIC26_DIV_1; break; in aic26_hw_params() [all …]
|
/linux-6.6.21/drivers/net/wireless/realtek/rtw89/ |
D | util.h | 23 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument 25 s32 i_divisor = (s32)divisor; in s32_div_u32_round_down() 42 static inline s32 s32_div_u32_round_closest(s32 dividend, u32 divisor) in s32_div_u32_round_closest() argument 44 return s32_div_u32_round_down(dividend + divisor / 2, divisor, NULL); in s32_div_u32_round_closest()
|
/linux-6.6.21/arch/x86/include/asm/ |
D | div64.h | 43 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument 53 if (upper >= divisor) { in div_u64_rem() 54 d.v32[1] = upper / divisor; in div_u64_rem() 55 upper %= divisor; in div_u64_rem() 58 "rm" (divisor), "0" (d.v32[0]), "1" (upper)); in div_u64_rem()
|
/linux-6.6.21/drivers/clk/ |
D | clk-vt8500.c | 135 u32 divisor; in vt8500_dclk_round_rate() local 140 divisor = *prate / rate; in vt8500_dclk_round_rate() 143 if (rate * divisor < *prate) in vt8500_dclk_round_rate() 144 divisor++; in vt8500_dclk_round_rate() 150 if ((cdev->div_mask == 0x3F) && (divisor > 31)) { in vt8500_dclk_round_rate() 151 divisor = 64 * ((divisor / 64) + 1); in vt8500_dclk_round_rate() 154 return *prate / divisor; in vt8500_dclk_round_rate() 161 u32 divisor; in vt8500_dclk_set_rate() local 167 divisor = parent_rate / rate; in vt8500_dclk_set_rate() 169 if (divisor == cdev->div_mask + 1) in vt8500_dclk_set_rate() [all …]
|
/linux-6.6.21/arch/powerpc/lib/ |
D | div64.S | 22 divwu r7,r5,r4 # if dividend.hi >= divisor, 23 mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor 24 subf. r5,r0,r5 # dividend.hi %= divisor 31 srw r10,r10,r0 # the divisor right the same amount, 41 mulhwu r9,r11,r4 # multiply the estimate by the divisor, 42 subfc r6,r10,r6 # take the product from the divisor,
|
/linux-6.6.21/arch/x86/kernel/ |
D | early_printk.c | 130 static __init void early_serial_hw_init(unsigned divisor) in early_serial_hw_init() argument 141 serial_out(early_serial_base, DLL, divisor & 0xff); in early_serial_hw_init() 142 serial_out(early_serial_base, DLH, (divisor >> 8) & 0xff); in early_serial_hw_init() 150 unsigned divisor; in early_serial_init() local 184 divisor = 115200 / baud; in early_serial_init() 191 early_serial_hw_init(divisor); in early_serial_init() 219 unsigned divisor; in early_pci_serial_init() local 313 divisor = 115200 / baud; in early_pci_serial_init() 316 early_serial_hw_init(divisor); in early_pci_serial_init()
|
/linux-6.6.21/drivers/comedi/drivers/ |
D | comedi_8254.c | 339 i8254->divisor = i8254->next_div & 0xffff; in comedi_8254_update_divisors() 439 unsigned int divisor; in comedi_8254_ns_to_timer() local 444 divisor = DIV_ROUND_CLOSEST(*nanosec, i8254->osc_base); in comedi_8254_ns_to_timer() 447 divisor = DIV_ROUND_UP(*nanosec, i8254->osc_base); in comedi_8254_ns_to_timer() 450 divisor = *nanosec / i8254->osc_base; in comedi_8254_ns_to_timer() 453 if (divisor < 2) in comedi_8254_ns_to_timer() 454 divisor = 2; in comedi_8254_ns_to_timer() 455 if (divisor > I8254_MAX_COUNT) in comedi_8254_ns_to_timer() 456 divisor = I8254_MAX_COUNT; in comedi_8254_ns_to_timer() 458 *nanosec = divisor * i8254->osc_base; in comedi_8254_ns_to_timer() [all …]
|
D | adv_pci1760.c | 178 unsigned int divisor; in pci1760_pwm_ns_to_div() local 182 divisor = DIV_ROUND_CLOSEST(ns, PCI1760_PWM_TIMEBASE); in pci1760_pwm_ns_to_div() 185 divisor = DIV_ROUND_UP(ns, PCI1760_PWM_TIMEBASE); in pci1760_pwm_ns_to_div() 188 divisor = ns / PCI1760_PWM_TIMEBASE; in pci1760_pwm_ns_to_div() 194 if (divisor < 1) in pci1760_pwm_ns_to_div() 195 divisor = 1; in pci1760_pwm_ns_to_div() 196 if (divisor > 0xffff) in pci1760_pwm_ns_to_div() 197 divisor = 0xffff; in pci1760_pwm_ns_to_div() 199 return divisor; in pci1760_pwm_ns_to_div()
|
/linux-6.6.21/drivers/cpuidle/governors/ |
D | menu.c | 173 int i, divisor; in get_typical_interval() local 185 divisor = 0; in get_typical_interval() 190 divisor++; in get_typical_interval() 202 if (divisor == INTERVALS) in get_typical_interval() 205 avg = div_u64(sum, divisor); in get_typical_interval() 216 if (divisor == INTERVALS) in get_typical_interval() 219 do_div(variance, divisor); in get_typical_interval() 234 if ((((u64)avg*avg > variance*36) && (divisor * 4 >= INTERVALS * 3)) in get_typical_interval() 249 if ((divisor * 4) <= INTERVALS * 3) in get_typical_interval()
|
/linux-6.6.21/arch/x86/boot/ |
D | string.c | 201 static inline u64 __div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in __div_u64_rem() argument 211 if (upper >= divisor) { in __div_u64_rem() 212 d.v32[1] = upper / divisor; in __div_u64_rem() 213 upper %= divisor; in __div_u64_rem() 216 "rm" (divisor), "0" (d.v32[0]), "1" (upper)); in __div_u64_rem() 220 static inline u64 __div_u64(u64 dividend, u32 divisor) in __div_u64() argument 224 return __div_u64_rem(dividend, divisor, &remainder); in __div_u64()
|
/linux-6.6.21/include/vdso/ |
D | math64.h | 6 __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) in __iter_div_u64_rem() argument 10 while (dividend >= divisor) { in __iter_div_u64_rem() 15 dividend -= divisor; in __iter_div_u64_rem()
|
/linux-6.6.21/Documentation/devicetree/bindings/clock/ |
D | vt8500.txt | 44 - divisor-reg : shall be the register offset from PMC base for the divisor 47 - divisor-mask : shall be the mask for the divisor register. Defaults to 0x1f 70 divisor-reg = <0x328>; 71 divisor-mask = <0x3f>;
|
/linux-6.6.21/drivers/usb/serial/ |
D | oti6858.c | 76 __le16 divisor; /* baud rate = 96000000 / (16 * divisor), LE */ member 114 (((a)->divisor == (priv)->pending_setup.divisor) \ 182 __le16 divisor; member 229 new_setup->divisor = priv->pending_setup.divisor; in setup_line() 406 __le16 divisor; in oti6858_set_termios() local 412 divisor = priv->pending_setup.divisor; in oti6858_set_termios() 441 divisor = 0; in oti6858_set_termios() 449 divisor = cpu_to_le16(new_divisor); in oti6858_set_termios() 491 if (divisor != priv->pending_setup.divisor in oti6858_set_termios() 494 priv->pending_setup.divisor = divisor; in oti6858_set_termios() [all …]
|