Searched refs:mod (Results 1 - 200 of 466) sorted by relevance

123

/linux-4.4.14/drivers/gpio/
H A Dgpio-janz-ttl.c62 struct ttl_module *mod = dev_get_drvdata(gpio->dev); ttl_get_value() local
67 shadow = &mod->porta_shadow; ttl_get_value()
69 shadow = &mod->portb_shadow; ttl_get_value()
72 shadow = &mod->portc_shadow; ttl_get_value()
76 spin_lock(&mod->lock); ttl_get_value()
78 spin_unlock(&mod->lock); ttl_get_value()
84 struct ttl_module *mod = dev_get_drvdata(gpio->dev); ttl_set_value() local
89 port = &mod->regs->porta; ttl_set_value()
90 shadow = &mod->porta_shadow; ttl_set_value()
92 port = &mod->regs->portb; ttl_set_value()
93 shadow = &mod->portb_shadow; ttl_set_value()
96 port = &mod->regs->portc; ttl_set_value()
97 shadow = &mod->portc_shadow; ttl_set_value()
101 spin_lock(&mod->lock); ttl_set_value()
108 spin_unlock(&mod->lock); ttl_set_value()
111 static void ttl_write_reg(struct ttl_module *mod, u8 reg, u16 val) ttl_write_reg() argument
113 iowrite16be(reg, &mod->regs->control); ttl_write_reg()
114 iowrite16be(val, &mod->regs->control); ttl_write_reg()
117 static void ttl_setup_device(struct ttl_module *mod) ttl_setup_device() argument
120 iowrite16be(0x0000, &mod->regs->control); ttl_setup_device()
121 iowrite16be(0x0001, &mod->regs->control); ttl_setup_device()
122 iowrite16be(0x0000, &mod->regs->control); ttl_setup_device()
125 ttl_write_reg(mod, PORTA_IOCTL, 0x00ff); ttl_setup_device()
126 ttl_write_reg(mod, PORTB_IOCTL, 0x00ff); ttl_setup_device()
127 ttl_write_reg(mod, PORTC_IOCTL, 0x000f); ttl_setup_device()
130 ttl_write_reg(mod, PORTA_DIRECTION, 0x0000); ttl_setup_device()
131 ttl_write_reg(mod, PORTB_DIRECTION, 0x0000); ttl_setup_device()
132 ttl_write_reg(mod, PORTC_DIRECTION, 0x0000); ttl_setup_device()
135 iowrite16be(0x0000, &mod->regs->porta); ttl_setup_device()
136 iowrite16be(0x0000, &mod->regs->portb); ttl_setup_device()
137 iowrite16be(0x0000, &mod->regs->portc); ttl_setup_device()
140 ttl_write_reg(mod, MASTER_CONF_CTL, CONF_PAE | CONF_PBE | CONF_PCE); ttl_setup_device()
147 struct ttl_module *mod; ttl_probe() local
158 mod = devm_kzalloc(dev, sizeof(*mod), GFP_KERNEL); ttl_probe()
159 if (!mod) ttl_probe()
162 platform_set_drvdata(pdev, mod); ttl_probe()
163 spin_lock_init(&mod->lock); ttl_probe()
167 mod->regs = devm_ioremap_resource(dev, res); ttl_probe()
168 if (IS_ERR(mod->regs)) ttl_probe()
169 return PTR_ERR(mod->regs); ttl_probe()
171 ttl_setup_device(mod); ttl_probe()
174 gpio = &mod->gpio; ttl_probe()
196 struct ttl_module *mod = platform_get_drvdata(pdev); ttl_remove() local
198 gpiochip_remove(&mod->gpio); ttl_remove()
/linux-4.4.14/sound/soc/sh/rcar/
H A Dmix.c17 struct rsnd_mod mod; member in struct:rsnd_mix
28 static void rsnd_mix_soft_reset(struct rsnd_mod *mod) rsnd_mix_soft_reset() argument
30 rsnd_mod_write(mod, MIX_SWRSR, 0); rsnd_mix_soft_reset()
31 rsnd_mod_write(mod, MIX_SWRSR, 1); rsnd_mix_soft_reset()
34 #define rsnd_mix_initialize_lock(mod) __rsnd_mix_initialize_lock(mod, 1)
35 #define rsnd_mix_initialize_unlock(mod) __rsnd_mix_initialize_lock(mod, 0) __rsnd_mix_initialize_lock()
36 static void __rsnd_mix_initialize_lock(struct rsnd_mod *mod, u32 enable) __rsnd_mix_initialize_lock() argument
38 rsnd_mod_write(mod, MIX_MIXIR, enable); __rsnd_mix_initialize_lock()
42 struct rsnd_mod *mod) rsnd_mix_volume_update()
46 rsnd_mod_write(mod, MIX_MDBER, 0); rsnd_mix_volume_update()
48 rsnd_mod_write(mod, MIX_MDBAR, 0); rsnd_mix_volume_update()
49 rsnd_mod_write(mod, MIX_MDBBR, 0); rsnd_mix_volume_update()
50 rsnd_mod_write(mod, MIX_MDBCR, 0); rsnd_mix_volume_update()
51 rsnd_mod_write(mod, MIX_MDBDR, 0); rsnd_mix_volume_update()
54 rsnd_mod_write(mod, MIX_MDBER, 1); rsnd_mix_volume_update()
57 static int rsnd_mix_init(struct rsnd_mod *mod, rsnd_mix_init() argument
61 rsnd_mod_power_on(mod); rsnd_mix_init()
63 rsnd_mix_soft_reset(mod); rsnd_mix_init()
65 rsnd_mix_initialize_lock(mod); rsnd_mix_init()
67 rsnd_mod_write(mod, MIX_ADINR, rsnd_get_adinr_chan(mod, io)); rsnd_mix_init()
72 rsnd_mod_write(mod, MIX_MIXMR, 0); rsnd_mix_init()
73 rsnd_mod_write(mod, MIX_MVPDR, 0); rsnd_mix_init()
75 rsnd_mix_volume_update(io, mod); rsnd_mix_init()
77 rsnd_mix_initialize_unlock(mod); rsnd_mix_init()
82 static int rsnd_mix_quit(struct rsnd_mod *mod, rsnd_mix_quit() argument
86 rsnd_mod_power_off(mod); rsnd_mix_quit()
41 rsnd_mix_volume_update(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_mix_volume_update() argument
H A Dsrc.c24 struct rsnd_mod mod; member in struct:rsnd_src
39 container_of((_mod), struct rsnd_src, mod)
121 static void rsnd_src_soft_reset(struct rsnd_mod *mod) rsnd_src_soft_reset() argument
123 rsnd_mod_write(mod, SRC_SWRSR, 0); rsnd_src_soft_reset()
124 rsnd_mod_write(mod, SRC_SWRSR, 1); rsnd_src_soft_reset()
128 #define rsnd_src_initialize_lock(mod) __rsnd_src_initialize_lock(mod, 1)
129 #define rsnd_src_initialize_unlock(mod) __rsnd_src_initialize_lock(mod, 0) __rsnd_src_initialize_lock()
130 static void __rsnd_src_initialize_lock(struct rsnd_mod *mod, u32 enable) __rsnd_src_initialize_lock() argument
132 rsnd_mod_write(mod, SRC_SRCIR, enable); __rsnd_src_initialize_lock()
136 struct rsnd_mod *mod) rsnd_src_dma_req()
138 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_src_dma_req()
142 mod, rsnd_src_dma_req()
286 static int rsnd_src_set_convert_rate(struct rsnd_mod *mod, rsnd_src_set_convert_rate() argument
290 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_set_convert_rate()
298 rsnd_mod_write(mod, SRC_ADINR, rsnd_get_adinr_bit(mod, io)); rsnd_src_set_convert_rate()
302 rsnd_mod_write(mod, SRC_IFSCR, 1); rsnd_src_set_convert_rate()
305 rsnd_mod_write(mod, SRC_IFSVR, fsrate); rsnd_src_set_convert_rate()
309 rsnd_mod_write(mod, SRC_BUSIF_MODE, 1); rsnd_src_set_convert_rate()
314 static int rsnd_src_hw_params(struct rsnd_mod *mod, rsnd_src_hw_params() argument
319 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_hw_params()
350 static int rsnd_src_init(struct rsnd_mod *mod, rsnd_src_init() argument
353 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_init()
355 rsnd_mod_power_on(mod); rsnd_src_init()
357 rsnd_src_soft_reset(mod); rsnd_src_init()
359 rsnd_src_initialize_lock(mod); rsnd_src_init()
369 static int rsnd_src_quit(struct rsnd_mod *mod, rsnd_src_quit() argument
373 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_quit()
376 rsnd_mod_power_off(mod); rsnd_src_quit()
380 rsnd_mod_name(mod), rsnd_mod_id(mod), src->err); rsnd_src_quit()
390 static int rsnd_src_start(struct rsnd_mod *mod) rsnd_src_start() argument
392 rsnd_src_initialize_unlock(mod); rsnd_src_start()
397 static int rsnd_src_stop(struct rsnd_mod *mod) rsnd_src_stop() argument
407 struct rsnd_mod *mod) rsnd_src_set_route_gen1()
427 id = rsnd_mod_id(mod); rsnd_src_set_route_gen1()
438 rsnd_mod_bset(mod, SRC_ROUTE_SEL, mask, val); rsnd_src_set_route_gen1()
444 struct rsnd_mod *mod) rsnd_src_set_convert_timing_gen1()
446 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_src_set_convert_timing_gen1()
447 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_set_convert_timing_gen1()
453 int id = rsnd_mod_id(mod); rsnd_src_set_convert_timing_gen1()
472 ret = rsnd_adg_set_convert_clk_gen1(priv, mod, rsnd_src_set_convert_timing_gen1()
488 rsnd_mod_bset(mod, SRC_TMG_SEL0, mask, val); rsnd_src_set_convert_timing_gen1()
491 rsnd_mod_bset(mod, SRC_TMG_SEL1, mask, val); rsnd_src_set_convert_timing_gen1()
494 rsnd_mod_bset(mod, SRC_TMG_SEL2, mask, val); rsnd_src_set_convert_timing_gen1()
501 static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod, rsnd_src_set_convert_rate_gen1() argument
504 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_set_convert_rate_gen1()
507 ret = rsnd_src_set_convert_rate(mod, io); rsnd_src_set_convert_rate_gen1()
512 rsnd_mod_write(mod, SRC_SRCCR, 0x00010110); rsnd_src_set_convert_rate_gen1()
515 rsnd_mod_write(mod, SRC_MNFSR, rsnd_src_set_convert_rate_gen1()
516 rsnd_mod_read(mod, SRC_IFSVR) / 100 * 98); rsnd_src_set_convert_rate_gen1()
520 rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1); rsnd_src_set_convert_rate_gen1()
527 static int rsnd_src_init_gen1(struct rsnd_mod *mod, rsnd_src_init_gen1() argument
533 ret = rsnd_src_init(mod, priv); rsnd_src_init_gen1()
537 ret = rsnd_src_set_route_gen1(io, mod); rsnd_src_init_gen1()
541 ret = rsnd_src_set_convert_rate_gen1(mod, io); rsnd_src_init_gen1()
545 ret = rsnd_src_set_convert_timing_gen1(io, mod); rsnd_src_init_gen1()
552 static int rsnd_src_start_gen1(struct rsnd_mod *mod, rsnd_src_start_gen1() argument
556 int id = rsnd_mod_id(mod); rsnd_src_start_gen1()
558 rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), (1 << id)); rsnd_src_start_gen1()
560 return rsnd_src_start(mod); rsnd_src_start_gen1()
563 static int rsnd_src_stop_gen1(struct rsnd_mod *mod, rsnd_src_stop_gen1() argument
567 int id = rsnd_mod_id(mod); rsnd_src_stop_gen1()
569 rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), 0); rsnd_src_stop_gen1()
571 return rsnd_src_stop(mod); rsnd_src_stop_gen1()
587 #define rsnd_src_irq_enable_gen2(mod) rsnd_src_irq_ctrol_gen2(mod, 1)
588 #define rsnd_src_irq_disable_gen2(mod) rsnd_src_irq_ctrol_gen2(mod, 0) rsnd_src_irq_ctrol_gen2()
589 static void rsnd_src_irq_ctrol_gen2(struct rsnd_mod *mod, int enable) rsnd_src_irq_ctrol_gen2() argument
591 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_irq_ctrol_gen2()
594 int id = rsnd_mod_id(mod); rsnd_src_irq_ctrol_gen2()
618 rsnd_mod_write(mod, SRC_INT_ENABLE0, int_val); rsnd_src_irq_ctrol_gen2()
619 rsnd_mod_bset(mod, SCU_SYS_INT_EN0, sys_int_mask, sys_int_val); rsnd_src_irq_ctrol_gen2()
620 rsnd_mod_bset(mod, SCU_SYS_INT_EN1, sys_int_mask, sys_int_val); rsnd_src_irq_ctrol_gen2()
623 static void rsnd_src_error_clear_gen2(struct rsnd_mod *mod) rsnd_src_error_clear_gen2() argument
625 u32 val = OUF_SRC(rsnd_mod_id(mod)); rsnd_src_error_clear_gen2()
627 rsnd_mod_bset(mod, SCU_SYS_STATUS0, val, val); rsnd_src_error_clear_gen2()
628 rsnd_mod_bset(mod, SCU_SYS_STATUS1, val, val); rsnd_src_error_clear_gen2()
631 static bool rsnd_src_error_record_gen2(struct rsnd_mod *mod) rsnd_src_error_record_gen2() argument
633 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_error_record_gen2()
637 val0 = val1 = OUF_SRC(rsnd_mod_id(mod)); rsnd_src_error_record_gen2()
647 if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) || rsnd_src_error_record_gen2()
648 (rsnd_mod_read(mod, SCU_SYS_STATUS1) & val1)) { rsnd_src_error_record_gen2()
649 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_error_record_gen2()
656 rsnd_src_error_clear_gen2(mod); rsnd_src_error_record_gen2()
661 static int _rsnd_src_start_gen2(struct rsnd_mod *mod, _rsnd_src_start_gen2() argument
664 struct rsnd_src *src = rsnd_mod_to_src(mod); _rsnd_src_start_gen2()
667 val = rsnd_get_dalign(mod, io); _rsnd_src_start_gen2()
669 rsnd_mod_write(mod, SRC_BUSIF_DALIGN, val); _rsnd_src_start_gen2()
679 rsnd_mod_write(mod, SRC_CTRL, val); _rsnd_src_start_gen2()
681 rsnd_src_error_clear_gen2(mod); _rsnd_src_start_gen2()
683 rsnd_src_start(mod); _rsnd_src_start_gen2()
685 rsnd_src_irq_enable_gen2(mod); _rsnd_src_start_gen2()
690 static int _rsnd_src_stop_gen2(struct rsnd_mod *mod) _rsnd_src_stop_gen2() argument
692 rsnd_src_irq_disable_gen2(mod); _rsnd_src_stop_gen2()
694 rsnd_mod_write(mod, SRC_CTRL, 0); _rsnd_src_stop_gen2()
696 rsnd_src_error_record_gen2(mod); _rsnd_src_stop_gen2()
698 return rsnd_src_stop(mod); _rsnd_src_stop_gen2()
701 static void __rsnd_src_interrupt_gen2(struct rsnd_mod *mod, __rsnd_src_interrupt_gen2() argument
704 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); __rsnd_src_interrupt_gen2()
712 if (rsnd_src_error_record_gen2(mod)) { __rsnd_src_interrupt_gen2()
713 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); __rsnd_src_interrupt_gen2()
714 struct rsnd_src *src = rsnd_mod_to_src(mod); __rsnd_src_interrupt_gen2()
718 rsnd_mod_name(mod), rsnd_mod_id(mod)); __rsnd_src_interrupt_gen2()
720 _rsnd_src_stop_gen2(mod); __rsnd_src_interrupt_gen2()
722 _rsnd_src_start_gen2(mod, io); __rsnd_src_interrupt_gen2()
733 struct rsnd_mod *mod = data; rsnd_src_interrupt_gen2() local
735 rsnd_mod_interrupt(mod, __rsnd_src_interrupt_gen2); rsnd_src_interrupt_gen2()
740 static int rsnd_src_set_convert_rate_gen2(struct rsnd_mod *mod, rsnd_src_set_convert_rate_gen2() argument
743 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_src_set_convert_rate_gen2()
746 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_set_convert_rate_gen2()
765 ret = rsnd_src_set_convert_rate(mod, io); rsnd_src_set_convert_rate_gen2()
781 rsnd_mod_write(mod, SRC_SRCCR, cr); rsnd_src_set_convert_rate_gen2()
782 rsnd_mod_write(mod, SRC_ROUTE_MODE0, route); rsnd_src_set_convert_rate_gen2()
784 switch (rsnd_mod_id(mod)) { rsnd_src_set_convert_rate_gen2()
789 rsnd_mod_write(mod, SRC_BSDSR, 0x02400000); rsnd_src_set_convert_rate_gen2()
792 rsnd_mod_write(mod, SRC_BSDSR, 0x01800000); rsnd_src_set_convert_rate_gen2()
796 rsnd_mod_write(mod, SRC_BSISR, 0x00100060); rsnd_src_set_convert_rate_gen2()
802 struct rsnd_mod *mod) rsnd_src_set_convert_timing_gen2()
805 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_set_convert_timing_gen2()
810 ret = rsnd_adg_set_convert_clk_gen2(mod, io, rsnd_src_set_convert_timing_gen2()
814 ret = rsnd_adg_set_convert_timing_gen2(mod, io); rsnd_src_set_convert_timing_gen2()
819 static int rsnd_src_probe_gen2(struct rsnd_mod *mod, rsnd_src_probe_gen2() argument
823 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_probe_gen2()
837 dev_name(dev), mod); rsnd_src_probe_gen2()
843 rsnd_mod_to_dma(mod), rsnd_src_probe_gen2()
849 static int rsnd_src_remove_gen2(struct rsnd_mod *mod, rsnd_src_remove_gen2() argument
853 rsnd_dma_quit(io, rsnd_mod_to_dma(mod)); rsnd_src_remove_gen2()
858 static int rsnd_src_init_gen2(struct rsnd_mod *mod, rsnd_src_init_gen2() argument
864 ret = rsnd_src_init(mod, priv); rsnd_src_init_gen2()
868 ret = rsnd_src_set_convert_rate_gen2(mod, io); rsnd_src_init_gen2()
872 ret = rsnd_src_set_convert_timing_gen2(io, mod); rsnd_src_init_gen2()
879 static int rsnd_src_start_gen2(struct rsnd_mod *mod, rsnd_src_start_gen2() argument
883 rsnd_dma_start(io, rsnd_mod_to_dma(mod)); rsnd_src_start_gen2()
885 return _rsnd_src_start_gen2(mod, io); rsnd_src_start_gen2()
888 static int rsnd_src_stop_gen2(struct rsnd_mod *mod, rsnd_src_stop_gen2() argument
894 ret = _rsnd_src_stop_gen2(mod); rsnd_src_stop_gen2()
896 rsnd_dma_stop(io, rsnd_mod_to_dma(mod)); rsnd_src_stop_gen2()
902 struct rsnd_mod *mod) rsnd_src_reconvert_update()
905 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_reconvert_update()
918 rsnd_mod_write(mod, SRC_IFSVR, fsrate); rsnd_src_reconvert_update()
921 static int rsnd_src_pcm_new_gen2(struct rsnd_mod *mod, rsnd_src_pcm_new_gen2() argument
927 struct rsnd_src *src = rsnd_mod_to_src(mod); rsnd_src_pcm_new_gen2()
949 ret = rsnd_kctrl_new_s(mod, io, rtd, rsnd_src_pcm_new_gen2()
958 ret = rsnd_kctrl_new_s(mod, io, rtd, rsnd_src_pcm_new_gen2()
135 rsnd_src_dma_req(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_src_dma_req() argument
406 rsnd_src_set_route_gen1(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_src_set_route_gen1() argument
443 rsnd_src_set_convert_timing_gen1(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_src_set_convert_timing_gen1() argument
801 rsnd_src_set_convert_timing_gen2(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_src_set_convert_timing_gen2() argument
901 rsnd_src_reconvert_update(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_src_reconvert_update() argument
H A Ddvc.c19 struct rsnd_mod mod; member in struct:rsnd_dvc
32 container_of((_mod), struct rsnd_dvc, mod)
67 static void rsnd_dvc_soft_reset(struct rsnd_mod *mod) rsnd_dvc_soft_reset() argument
69 rsnd_mod_write(mod, DVC_SWRSR, 0); rsnd_dvc_soft_reset()
70 rsnd_mod_write(mod, DVC_SWRSR, 1); rsnd_dvc_soft_reset()
73 #define rsnd_dvc_initialize_lock(mod) __rsnd_dvc_initialize_lock(mod, 1)
74 #define rsnd_dvc_initialize_unlock(mod) __rsnd_dvc_initialize_lock(mod, 0) __rsnd_dvc_initialize_lock()
75 static void __rsnd_dvc_initialize_lock(struct rsnd_mod *mod, u32 enable) __rsnd_dvc_initialize_lock() argument
77 rsnd_mod_write(mod, DVC_DVUIR, enable); __rsnd_dvc_initialize_lock()
81 struct rsnd_mod *mod) rsnd_dvc_volume_update()
83 struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod); rsnd_dvc_volume_update()
93 rsnd_mod_write(mod, DVC_DVUER, 0); rsnd_dvc_volume_update()
103 rsnd_mod_write(mod, DVC_VRCTR, 0xff); rsnd_dvc_volume_update()
104 rsnd_mod_write(mod, DVC_VRPDR, dvc->rup.val << 8 | rsnd_dvc_volume_update()
112 rsnd_mod_write(mod, DVC_VRDBR, rsnd_dvc_volume_update()
122 rsnd_mod_write(mod, DVC_VOL0R, val[0]); rsnd_dvc_volume_update()
123 rsnd_mod_write(mod, DVC_VOL1R, val[1]); rsnd_dvc_volume_update()
128 rsnd_mod_write(mod, DVC_ZCMCR, mute); rsnd_dvc_volume_update()
131 rsnd_mod_write(mod, DVC_DVUCR, dvucr); rsnd_dvc_volume_update()
134 rsnd_mod_write(mod, DVC_DVUER, 1); rsnd_dvc_volume_update()
137 static int rsnd_dvc_remove_gen2(struct rsnd_mod *mod, rsnd_dvc_remove_gen2() argument
141 struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod); rsnd_dvc_remove_gen2()
152 static int rsnd_dvc_init(struct rsnd_mod *mod, rsnd_dvc_init() argument
156 rsnd_mod_power_on(mod); rsnd_dvc_init()
158 rsnd_dvc_soft_reset(mod); rsnd_dvc_init()
160 rsnd_dvc_initialize_lock(mod); rsnd_dvc_init()
164 rsnd_mod_write(mod, DVC_ADINR, rsnd_get_adinr_bit(mod, io)); rsnd_dvc_init()
167 rsnd_dvc_volume_update(io, mod); rsnd_dvc_init()
169 rsnd_adg_set_cmd_timsel_gen2(mod, io); rsnd_dvc_init()
174 static int rsnd_dvc_quit(struct rsnd_mod *mod, rsnd_dvc_quit() argument
178 rsnd_mod_power_off(mod); rsnd_dvc_quit()
183 static int rsnd_dvc_start(struct rsnd_mod *mod, rsnd_dvc_start() argument
187 rsnd_dvc_initialize_unlock(mod); rsnd_dvc_start()
189 rsnd_mod_write(mod, CMD_CTRL, 0x10); rsnd_dvc_start()
194 static int rsnd_dvc_stop(struct rsnd_mod *mod, rsnd_dvc_stop() argument
198 rsnd_mod_write(mod, CMD_CTRL, 0); rsnd_dvc_stop()
203 static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, rsnd_dvc_pcm_new() argument
207 struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod); rsnd_dvc_pcm_new()
212 ret = rsnd_kctrl_new_m(mod, io, rtd, rsnd_dvc_pcm_new()
221 ret = rsnd_kctrl_new_m(mod, io, rtd, rsnd_dvc_pcm_new()
230 ret = rsnd_kctrl_new_s(mod, io, rtd, rsnd_dvc_pcm_new()
238 ret = rsnd_kctrl_new_e(mod, io, rtd, rsnd_dvc_pcm_new()
247 ret = rsnd_kctrl_new_e(mod, io, rtd, rsnd_dvc_pcm_new()
261 struct rsnd_mod *mod) rsnd_dvc_dma_req()
263 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_dvc_dma_req()
266 mod, "tx"); rsnd_dvc_dma_req()
80 rsnd_dvc_volume_update(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_dvc_volume_update() argument
260 rsnd_dvc_dma_req(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_dvc_dma_req() argument
H A Dssi.c65 struct rsnd_mod mod; member in struct:rsnd_ssi
81 #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod)
91 struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io); rsnd_ssi_use_busif() local
92 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_use_busif()
95 if (!rsnd_ssi_is_dma_mode(mod)) rsnd_ssi_use_busif()
106 static void rsnd_ssi_status_check(struct rsnd_mod *mod, rsnd_ssi_status_check() argument
109 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_ssi_status_check()
115 status = rsnd_mod_read(mod, SSISR); rsnd_ssi_status_check()
131 struct rsnd_mod *mod = rsnd_mod_get(ssi); rsnd_ssi_master_clk_start() local
151 ret = rsnd_adg_ssi_clk_try_start(mod, main_rate); rsnd_ssi_master_clk_start()
157 rsnd_mod_name(mod), rsnd_ssi_master_clk_start()
158 rsnd_mod_id(mod), rate); rsnd_ssi_master_clk_start()
170 struct rsnd_mod *mod = rsnd_mod_get(ssi); rsnd_ssi_master_clk_stop() local
173 rsnd_adg_ssi_clk_stop(mod); rsnd_ssi_master_clk_stop()
182 struct rsnd_mod *mod = rsnd_mod_get(ssi); rsnd_ssi_hw_start() local
187 rsnd_mod_power_on(mod); rsnd_ssi_hw_start()
199 if (rsnd_ssi_is_dma_mode(mod)) { rsnd_ssi_hw_start()
211 rsnd_mod_write(mod, SSICR, cr); rsnd_ssi_hw_start()
215 rsnd_mod_write(mod, SSIWSR, CONT); rsnd_ssi_hw_start()
218 rsnd_mod_write(mod, SSISR, 0); rsnd_ssi_hw_start()
223 rsnd_mod_name(mod), rsnd_mod_id(mod)); rsnd_ssi_hw_start()
228 struct rsnd_mod *mod = rsnd_mod_get(ssi); rsnd_ssi_hw_stop() local
229 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_ssi_hw_stop()
249 rsnd_mod_write(mod, SSICR, cr | EN); rsnd_ssi_hw_stop()
250 rsnd_ssi_status_check(mod, DIRQ); rsnd_ssi_hw_stop()
256 rsnd_mod_write(mod, SSICR, cr); /* disabled all */ rsnd_ssi_hw_stop()
257 rsnd_ssi_status_check(mod, IIRQ); rsnd_ssi_hw_stop()
268 rsnd_mod_power_off(mod); rsnd_ssi_hw_stop()
274 rsnd_mod_name(mod), rsnd_mod_id(mod)); rsnd_ssi_hw_stop()
278 * SSI mod common functions
280 static int rsnd_ssi_init(struct rsnd_mod *mod, rsnd_ssi_init() argument
284 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_init()
331 static int rsnd_ssi_quit(struct rsnd_mod *mod, rsnd_ssi_quit() argument
335 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_quit()
340 rsnd_mod_name(mod), rsnd_mod_id(mod), ssi->err); rsnd_ssi_quit()
348 static int rsnd_ssi_hw_params(struct rsnd_mod *mod, rsnd_ssi_hw_params() argument
353 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_hw_params()
381 struct rsnd_mod *mod = rsnd_mod_get(ssi); rsnd_ssi_record_error() local
388 rsnd_mod_write(mod, SSISR, 0); rsnd_ssi_record_error()
392 static int rsnd_ssi_start(struct rsnd_mod *mod, rsnd_ssi_start() argument
396 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_start()
398 rsnd_src_ssiu_start(mod, io, rsnd_ssi_use_busif(io)); rsnd_ssi_start()
402 rsnd_src_ssi_irq_enable(mod); rsnd_ssi_start()
407 static int rsnd_ssi_stop(struct rsnd_mod *mod, rsnd_ssi_stop() argument
411 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_stop()
413 rsnd_src_ssi_irq_disable(mod); rsnd_ssi_stop()
415 rsnd_ssi_record_error(ssi, rsnd_mod_read(mod, SSISR)); rsnd_ssi_stop()
419 rsnd_src_ssiu_stop(mod, io); rsnd_ssi_stop()
424 static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, __rsnd_ssi_interrupt() argument
427 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); __rsnd_ssi_interrupt()
428 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); __rsnd_ssi_interrupt()
429 int is_dma = rsnd_ssi_is_dma_mode(mod); __rsnd_ssi_interrupt()
439 status = rsnd_mod_read(mod, SSISR); __rsnd_ssi_interrupt()
453 rsnd_mod_write(mod, SSITDR, *buf); __rsnd_ssi_interrupt()
455 *buf = rsnd_mod_read(mod, SSIRDR); __rsnd_ssi_interrupt()
468 rsnd_mod_name(mod), rsnd_mod_id(mod)); __rsnd_ssi_interrupt()
470 rsnd_ssi_stop(mod, io, priv); __rsnd_ssi_interrupt()
472 rsnd_ssi_start(mod, io, priv); __rsnd_ssi_interrupt()
488 struct rsnd_mod *mod = data; rsnd_ssi_interrupt() local
490 rsnd_mod_interrupt(mod, __rsnd_ssi_interrupt); rsnd_ssi_interrupt()
498 static int rsnd_ssi_pio_probe(struct rsnd_mod *mod, rsnd_ssi_pio_probe() argument
503 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_pio_probe()
509 dev_name(dev), mod); rsnd_ssi_pio_probe()
524 static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, rsnd_ssi_dma_probe() argument
528 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_dma_probe()
536 dev_name(dev), mod); rsnd_ssi_dma_probe()
541 io, rsnd_mod_to_dma(mod), rsnd_ssi_dma_probe()
547 static int rsnd_ssi_dma_remove(struct rsnd_mod *mod, rsnd_ssi_dma_remove() argument
551 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); rsnd_ssi_dma_remove()
555 rsnd_dma_quit(io, rsnd_mod_to_dma(mod)); rsnd_ssi_dma_remove()
558 devm_free_irq(dev, irq, mod); rsnd_ssi_dma_remove()
563 static int rsnd_ssi_fallback(struct rsnd_mod *mod, rsnd_ssi_fallback() argument
576 mod->ops = &rsnd_ssi_pio_ops; rsnd_ssi_fallback()
579 rsnd_mod_name(mod), rsnd_mod_id(mod)); rsnd_ssi_fallback()
584 static int rsnd_ssi_dma_start(struct rsnd_mod *mod, rsnd_ssi_dma_start() argument
588 struct rsnd_dma *dma = rsnd_mod_to_dma(mod); rsnd_ssi_dma_start()
592 rsnd_ssi_start(mod, io, priv); rsnd_ssi_dma_start()
597 static int rsnd_ssi_dma_stop(struct rsnd_mod *mod, rsnd_ssi_dma_stop() argument
601 struct rsnd_dma *dma = rsnd_mod_to_dma(mod); rsnd_ssi_dma_stop()
603 rsnd_ssi_stop(mod, io, priv); rsnd_ssi_dma_stop()
611 struct rsnd_mod *mod) rsnd_ssi_dma_req()
613 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_ssi_dma_req()
623 mod, name); rsnd_ssi_dma_req()
639 int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod) rsnd_ssi_is_dma_mode() argument
641 return mod->ops == &rsnd_ssi_dma_ops; rsnd_ssi_is_dma_mode()
653 * ssi mod function
663 int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod) __rsnd_ssi_is_pin_sharing() argument
665 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); __rsnd_ssi_is_pin_sharing()
672 struct rsnd_mod *mod = rsnd_mod_get(ssi); rsnd_ssi_parent_setup() local
674 if (!__rsnd_ssi_is_pin_sharing(mod)) rsnd_ssi_parent_setup()
677 switch (rsnd_mod_id(mod)) { rsnd_ssi_parent_setup()
610 rsnd_ssi_dma_req(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_ssi_dma_req() argument
H A Dctu.c17 struct rsnd_mod mod; member in struct:rsnd_ctu
27 #define rsnd_ctu_initialize_lock(mod) __rsnd_ctu_initialize_lock(mod, 1)
28 #define rsnd_ctu_initialize_unlock(mod) __rsnd_ctu_initialize_lock(mod, 0) __rsnd_ctu_initialize_lock()
29 static void __rsnd_ctu_initialize_lock(struct rsnd_mod *mod, u32 enable) __rsnd_ctu_initialize_lock() argument
31 rsnd_mod_write(mod, CTU_CTUIR, enable); __rsnd_ctu_initialize_lock()
34 static int rsnd_ctu_init(struct rsnd_mod *mod, rsnd_ctu_init() argument
38 rsnd_mod_power_on(mod); rsnd_ctu_init()
40 rsnd_ctu_initialize_lock(mod); rsnd_ctu_init()
42 rsnd_mod_write(mod, CTU_ADINR, rsnd_get_adinr_chan(mod, io)); rsnd_ctu_init()
44 rsnd_ctu_initialize_unlock(mod); rsnd_ctu_init()
49 static int rsnd_ctu_quit(struct rsnd_mod *mod, rsnd_ctu_quit() argument
53 rsnd_mod_power_off(mod); rsnd_ctu_quit()
H A Drsnd.h180 u32 rsnd_read(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg);
181 void rsnd_write(struct rsnd_priv *priv, struct rsnd_mod *mod,
183 void rsnd_force_write(struct rsnd_priv *priv, struct rsnd_mod *mod,
185 void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg,
187 u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io);
188 u32 rsnd_get_adinr_chan(struct rsnd_mod *mod, struct rsnd_dai_stream *io);
189 u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io);
228 struct rsnd_mod *mod, char *name);
231 * R-Car sound mod
245 struct rsnd_mod *mod);
246 int (*probe)(struct rsnd_mod *mod,
249 int (*remove)(struct rsnd_mod *mod,
252 int (*init)(struct rsnd_mod *mod,
255 int (*quit)(struct rsnd_mod *mod,
258 int (*start)(struct rsnd_mod *mod,
261 int (*stop)(struct rsnd_mod *mod,
264 int (*pcm_new)(struct rsnd_mod *mod,
267 int (*hw_params)(struct rsnd_mod *mod,
271 int (*fallback)(struct rsnd_mod *mod,
330 #define rsnd_mod_to_priv(mod) ((mod)->priv)
331 #define rsnd_mod_to_dma(mod) (&(mod)->dma)
332 #define rsnd_mod_id(mod) ((mod) ? (mod)->id : -1)
333 #define rsnd_mod_power_on(mod) clk_enable((mod)->clk)
334 #define rsnd_mod_power_off(mod) clk_disable((mod)->clk)
335 #define rsnd_mod_get(ip) (&(ip)->mod)
338 struct rsnd_mod *mod,
343 void rsnd_mod_quit(struct rsnd_mod *mod);
344 char *rsnd_mod_name(struct rsnd_mod *mod);
346 struct rsnd_mod *mod);
347 void rsnd_mod_interrupt(struct rsnd_mod *mod,
348 void (*callback)(struct rsnd_mod *mod,
358 struct rsnd_mod *mod[RSND_MOD_MAX]; member in struct:rsnd_dai_stream
366 #define rsnd_io_to_mod(io, i) ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
414 struct rsnd_mod *mod,
424 int rsnd_adg_ssi_clk_stop(struct rsnd_mod *mod);
425 int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate);
430 struct rsnd_mod *mod,
433 int rsnd_adg_set_convert_clk_gen2(struct rsnd_mod *mod,
437 int rsnd_adg_set_convert_timing_gen2(struct rsnd_mod *mod,
439 int rsnd_adg_set_cmd_timsel_gen2(struct rsnd_mod *mod,
520 void (*update)(struct rsnd_dai_stream *io, struct rsnd_mod *mod);
540 int rsnd_kctrl_new_m(struct rsnd_mod *mod,
545 struct rsnd_mod *mod),
548 int rsnd_kctrl_new_s(struct rsnd_mod *mod,
553 struct rsnd_mod *mod),
556 int rsnd_kctrl_new_e(struct rsnd_mod *mod,
562 struct rsnd_mod *mod),
575 int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod);
580 int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod);
635 void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type);
H A Dcore.c54 * | +- playback -> [mod] -> [mod] -> [mod] -> ...
57 * | +- capture -> [mod] -> [mod] -> [mod] -> ...
61 * | +- playback -> [mod] -> [mod] -> [mod] -> ...
64 * | +- capture -> [mod] -> [mod] -> [mod] -> ...
90 * [mod] => [mod] => [mod] => ...
93 * [mod]->fn() -> [mod]->fn() -> [mod]->fn()...
130 void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type) rsnd_mod_make_sure() argument
132 if (mod->type != type) { rsnd_mod_make_sure()
133 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_mod_make_sure()
137 rsnd_mod_name(mod), rsnd_mod_id(mod)); rsnd_mod_make_sure()
144 char *rsnd_mod_name(struct rsnd_mod *mod) rsnd_mod_name() argument
146 if (!mod || !mod->ops) rsnd_mod_name()
149 return mod->ops->name; rsnd_mod_name()
153 struct rsnd_mod *mod) rsnd_mod_dma_req()
155 if (!mod || !mod->ops || !mod->ops->dma_req) rsnd_mod_dma_req()
158 return mod->ops->dma_req(io, mod); rsnd_mod_dma_req()
162 struct rsnd_mod *mod, rsnd_mod_init()
173 mod->id = id; rsnd_mod_init()
174 mod->ops = ops; rsnd_mod_init()
175 mod->type = type; rsnd_mod_init()
176 mod->clk = clk; rsnd_mod_init()
177 mod->priv = priv; rsnd_mod_init()
182 void rsnd_mod_quit(struct rsnd_mod *mod) rsnd_mod_quit() argument
184 if (mod->clk) rsnd_mod_quit()
185 clk_unprepare(mod->clk); rsnd_mod_quit()
188 void rsnd_mod_interrupt(struct rsnd_mod *mod, rsnd_mod_interrupt() argument
189 void (*callback)(struct rsnd_mod *mod, rsnd_mod_interrupt()
192 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_mod_interrupt()
201 if (mod == io->mod[i]) for_each_rsnd_dai()
202 callback(mod, io); for_each_rsnd_dai()
205 if (mod == io->mod[i]) for_each_rsnd_dai()
206 callback(mod, io); for_each_rsnd_dai()
220 u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io) rsnd_get_adinr_bit() argument
222 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_get_adinr_bit()
242 u32 rsnd_get_adinr_chan(struct rsnd_mod *mod, struct rsnd_dai_stream *io) rsnd_get_adinr_chan() argument
244 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_get_adinr_chan()
268 u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io) rsnd_get_dalign() argument
294 if (mod == target) rsnd_get_dalign()
303 #define rsnd_mod_call(mod, io, func, param...) \
305 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \
308 u8 val = (mod->status >> __rsnd_mod_shift_##func) & 0xF; \
311 int call = (val == __rsnd_mod_call_##func) && (mod)->ops->func; \
312 mod->status = (mod->status & ~mask) + \
315 rsnd_mod_name(mod), rsnd_mod_id(mod), \
316 mod->status, call ? #func : ""); \
318 ret = (mod)->ops->func(mod, io, param); \
324 struct rsnd_mod *mod; \
327 mod = (io)->mod[i]; \
328 if (!mod) \
330 ret |= rsnd_mod_call(mod, io, fn, param); \
335 static int rsnd_dai_connect(struct rsnd_mod *mod, rsnd_dai_connect() argument
341 if (!mod) rsnd_dai_connect()
344 priv = rsnd_mod_to_priv(mod); rsnd_dai_connect()
347 io->mod[mod->type] = mod; rsnd_dai_connect()
350 rsnd_mod_name(mod), rsnd_mod_id(mod), rsnd_dai_connect()
356 static void rsnd_dai_disconnect(struct rsnd_mod *mod, rsnd_dai_disconnect() argument
359 io->mod[mod->type] = NULL; rsnd_dai_disconnect()
577 struct rsnd_mod *mod; \
584 mod = rsnd_##type##_mod_get(priv, id); \
585 ret = rsnd_dai_connect(mod, io); \
593 struct rsnd_mod *mod; \
599 mod = rsnd_##type##_mod_get(priv, id); \
600 rsnd_dai_disconnect(mod, io); \
1008 struct rsnd_mod *mod = snd_kcontrol_chip(kctrl); rsnd_kctrl_put() local
1023 cfg->update(cfg->io, mod); rsnd_kctrl_put()
1028 static int __rsnd_kctrl_new(struct rsnd_mod *mod, __rsnd_kctrl_new() argument
1034 struct rsnd_mod *mod)) __rsnd_kctrl_new()
1050 kctrl = snd_ctl_new1(&knew, mod); __rsnd_kctrl_new()
1073 int rsnd_kctrl_new_m(struct rsnd_mod *mod, rsnd_kctrl_new_m() argument
1078 struct rsnd_mod *mod), rsnd_kctrl_new_m()
1085 return __rsnd_kctrl_new(mod, io, rtd, name, &_cfg->cfg, update); rsnd_kctrl_new_m()
1088 int rsnd_kctrl_new_s(struct rsnd_mod *mod, rsnd_kctrl_new_s() argument
1093 struct rsnd_mod *mod), rsnd_kctrl_new_s()
1100 return __rsnd_kctrl_new(mod, io, rtd, name, &_cfg->cfg, update); rsnd_kctrl_new_s()
1103 int rsnd_kctrl_new_e(struct rsnd_mod *mod, rsnd_kctrl_new_e() argument
1109 struct rsnd_mod *mod), rsnd_kctrl_new_e()
1117 return __rsnd_kctrl_new(mod, io, rtd, name, &_cfg->cfg, update); rsnd_kctrl_new_e()
152 rsnd_mod_dma_req(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_mod_dma_req() argument
161 rsnd_mod_init(struct rsnd_priv *priv, struct rsnd_mod *mod, struct rsnd_mod_ops *ops, struct clk *clk, enum rsnd_mod_type type, int id) rsnd_mod_init() argument
H A Ddma.c44 static void __rsnd_dmaen_complete(struct rsnd_mod *mod, __rsnd_dmaen_complete() argument
47 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); __rsnd_dmaen_complete()
75 struct rsnd_mod *mod = data; rsnd_dmaen_complete() local
77 rsnd_mod_interrupt(mod, __rsnd_dmaen_complete); rsnd_dmaen_complete()
90 struct rsnd_mod *mod = rsnd_dma_to_mod(dma); rsnd_dmaen_start() local
91 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_dmaen_start()
110 desc->callback_param = mod; rsnd_dmaen_start()
121 struct rsnd_mod *mod, char *name) rsnd_dma_request_channel()
128 if (i == rsnd_mod_id(mod)) for_each_child_of_node()
268 struct rsnd_mod *mod) rsnd_dmapp_get_id()
274 int id = rsnd_mod_id(mod); rsnd_dmapp_get_id()
277 if (mod == ssi) { rsnd_dmapp_get_id()
280 } else if (mod == src) { rsnd_dmapp_get_id()
283 } else if (mod == dvc) { rsnd_dmapp_get_id()
310 struct rsnd_mod *mod = rsnd_dma_to_mod(dma); rsnd_dmapp_write() local
311 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_dmapp_write()
322 struct rsnd_mod *mod = rsnd_dma_to_mod(dma); rsnd_dmapp_read() local
323 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_dmapp_read()
394 * mod / DMAC in / DMAC out / DMAC PP in / DMAC pp out
420 struct rsnd_mod *mod, rsnd_gen2_dma_addr()
427 int is_ssi = !!(rsnd_io_to_mod_ssi(io) == mod); rsnd_gen2_dma_addr()
432 int id = rsnd_mod_id(mod); rsnd_gen2_dma_addr()
482 struct rsnd_mod *mod, rsnd_dma_addr()
493 if (!mod) rsnd_dma_addr()
496 return rsnd_gen2_dma_addr(io, mod, is_play, is_from); rsnd_dma_addr()
512 struct rsnd_mod *mod[MOD_MAX]; rsnd_dma_of_path() local
523 mod[i] = NULL; rsnd_dma_of_path()
545 mod[0] = mod_start; rsnd_dma_of_path()
548 mod[i] = src; rsnd_dma_of_path()
551 mod[i] = ctu; rsnd_dma_of_path()
554 mod[i] = mix; rsnd_dma_of_path()
557 mod[i] = dvc; rsnd_dma_of_path()
561 mod[i] = mod_end; rsnd_dma_of_path()
570 *mod_from = mod[nr - 1]; rsnd_dma_of_path()
571 *mod_to = mod[nr]; rsnd_dma_of_path()
573 *mod_from = mod[0]; rsnd_dma_of_path()
574 *mod_to = mod[1]; rsnd_dma_of_path()
581 rsnd_mod_name(mod[i]), rsnd_mod_id(mod[i]), rsnd_dma_of_path()
582 (mod[i] == *mod_from) ? " from" : rsnd_dma_of_path()
583 (mod[i] == *mod_to) ? " to" : ""); rsnd_dma_of_path()
599 struct rsnd_mod *mod = rsnd_dma_to_mod(dma); rsnd_dma_quit() local
600 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_dma_quit()
120 rsnd_dma_request_channel(struct device_node *of_node, struct rsnd_mod *mod, char *name) rsnd_dma_request_channel() argument
267 rsnd_dmapp_get_id(struct rsnd_dai_stream *io, struct rsnd_mod *mod) rsnd_dmapp_get_id() argument
419 rsnd_gen2_dma_addr(struct rsnd_dai_stream *io, struct rsnd_mod *mod, int is_play, int is_from) rsnd_gen2_dma_addr() argument
481 rsnd_dma_addr(struct rsnd_dai_stream *io, struct rsnd_mod *mod, int is_play, int is_from) rsnd_dma_addr() argument
H A Dadg.c35 struct rsnd_mod mod; member in struct:rsnd_adg
71 struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io); rsnd_adg_ssi_ws_timing_gen2() local
72 int id = rsnd_mod_id(mod); rsnd_adg_ssi_ws_timing_gen2()
93 int rsnd_adg_set_cmd_timsel_gen2(struct rsnd_mod *mod, rsnd_adg_set_cmd_timsel_gen2() argument
96 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_adg_set_cmd_timsel_gen2()
99 int id = rsnd_mod_id(mod); rsnd_adg_set_cmd_timsel_gen2()
246 struct rsnd_mod *mod, rsnd_adg_set_convert_clk_gen1()
255 int id = rsnd_mod_id(mod); rsnd_adg_set_convert_clk_gen1()
340 int rsnd_adg_ssi_clk_stop(struct rsnd_mod *mod) rsnd_adg_ssi_clk_stop() argument
343 * "mod" = "ssi" here. rsnd_adg_ssi_clk_stop()
344 * we can get "ssi id" from mod rsnd_adg_ssi_clk_stop()
346 rsnd_adg_set_ssi_clk(mod, 0); rsnd_adg_ssi_clk_stop()
351 int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate) rsnd_adg_ssi_clk_try_start() argument
353 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); rsnd_adg_ssi_clk_try_start()
398 * This "mod" = "ssi" here.
399 * we can get "ssi id" from mod
401 rsnd_adg_set_ssi_clk(mod, data);
404 rsnd_mod_name(mod), rsnd_mod_id(mod),
590 * Use ADG mod without rsnd_mod_init() to make debug easy rsnd_adg_probe()
593 adg->mod.ops = &adg_ops; rsnd_adg_probe()
594 adg->mod.priv = priv; rsnd_adg_probe()
245 rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv, struct rsnd_mod *mod, unsigned int src_rate, unsigned int dst_rate) rsnd_adg_set_convert_clk_gen1() argument
H A Dgen.c75 struct rsnd_mod *mod, enum rsnd_reg reg) rsnd_read()
84 regmap_fields_read(gen->regs[reg], rsnd_mod_id(mod), &val); rsnd_read()
87 rsnd_mod_name(mod), rsnd_mod_id(mod), reg, val); rsnd_read()
93 struct rsnd_mod *mod, rsnd_write()
103 rsnd_mod_name(mod), rsnd_mod_id(mod), reg, data); rsnd_write()
105 regmap_fields_write(gen->regs[reg], rsnd_mod_id(mod), data); rsnd_write()
109 struct rsnd_mod *mod, rsnd_force_write()
119 rsnd_mod_name(mod), rsnd_mod_id(mod), reg, data); rsnd_force_write()
121 regmap_fields_force_write(gen->regs[reg], rsnd_mod_id(mod), data); rsnd_force_write()
124 void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, rsnd_bset() argument
134 rsnd_mod_name(mod), rsnd_mod_id(mod), reg, data, mask); rsnd_bset()
136 regmap_fields_update_bits(gen->regs[reg], rsnd_mod_id(mod), rsnd_bset()
74 rsnd_read(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg) rsnd_read() argument
92 rsnd_write(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg, u32 data) rsnd_write() argument
108 rsnd_force_write(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg, u32 data) rsnd_force_write() argument
/linux-4.4.14/include/trace/events/
H A Dmodule.h32 TP_PROTO(struct module *mod),
34 TP_ARGS(mod),
38 __string( name, mod->name )
42 __entry->taints = mod->taints;
43 __assign_str(name, mod->name);
51 TP_PROTO(struct module *mod),
53 TP_ARGS(mod),
56 __string( name, mod->name )
60 __assign_str(name, mod->name);
71 TP_PROTO(struct module *mod, unsigned long ip),
73 TP_ARGS(mod, ip),
78 __string( name, mod->name )
83 __entry->refcnt = atomic_read(&mod->refcnt);
84 __assign_str(name, mod->name);
93 TP_PROTO(struct module *mod, unsigned long ip),
95 TP_ARGS(mod, ip)
100 TP_PROTO(struct module *mod, unsigned long ip),
102 TP_ARGS(mod, ip)
/linux-4.4.14/drivers/net/can/
H A Djanz-ican3.c278 static inline void ican3_set_page(struct ican3_dev *mod, unsigned int page) ican3_set_page() argument
281 iowrite8(page, &mod->dpmctrl->window_address); ican3_set_page()
291 * LOCKING: must hold mod->lock
295 static int ican3_old_recv_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_old_recv_msg() argument
301 ican3_set_page(mod, QUEUE_OLD_CONTROL); ican3_old_recv_msg()
302 peer = ioread8(mod->dpm + MSYNC_PEER); ican3_old_recv_msg()
303 locl = ioread8(mod->dpm + MSYNC_LOCL); ican3_old_recv_msg()
307 netdev_dbg(mod->ndev, "no mbox for reading\n"); ican3_old_recv_msg()
319 ican3_set_page(mod, mbox_page); ican3_old_recv_msg()
320 memcpy_fromio(msg, mod->dpm, sizeof(*msg)); ican3_old_recv_msg()
328 ican3_set_page(mod, QUEUE_OLD_CONTROL); ican3_old_recv_msg()
329 iowrite8(locl, mod->dpm + MSYNC_LOCL); ican3_old_recv_msg()
336 * LOCKING: must hold mod->lock
340 static int ican3_old_send_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_old_send_msg() argument
346 ican3_set_page(mod, QUEUE_OLD_CONTROL); ican3_old_send_msg()
347 peer = ioread8(mod->dpm + MSYNC_PEER); ican3_old_send_msg()
348 locl = ioread8(mod->dpm + MSYNC_LOCL); ican3_old_send_msg()
352 netdev_err(mod->ndev, "no mbox for writing\n"); ican3_old_send_msg()
361 ican3_set_page(mod, mbox_page); ican3_old_send_msg()
362 memcpy_toio(mod->dpm, msg, sizeof(*msg)); ican3_old_send_msg()
368 ican3_set_page(mod, QUEUE_OLD_CONTROL); ican3_old_send_msg()
369 iowrite8(locl, mod->dpm + MSYNC_LOCL); ican3_old_send_msg()
377 static void ican3_init_new_host_interface(struct ican3_dev *mod) ican3_init_new_host_interface() argument
384 spin_lock_irqsave(&mod->lock, flags); ican3_init_new_host_interface()
387 mod->rx_num = 0; ican3_init_new_host_interface()
388 mod->rx_int = 0; ican3_init_new_host_interface()
391 ican3_set_page(mod, QUEUE_TOHOST); ican3_init_new_host_interface()
392 dst = mod->dpm; ican3_init_new_host_interface()
397 desc.pointer = mod->free_page; ican3_init_new_host_interface()
405 mod->free_page++; ican3_init_new_host_interface()
409 ican3_set_page(mod, QUEUE_FROMHOST_MID); ican3_init_new_host_interface()
410 dst = mod->dpm; ican3_init_new_host_interface()
413 mod->tx_num = 0; ican3_init_new_host_interface()
418 desc.pointer = mod->free_page; ican3_init_new_host_interface()
426 mod->free_page++; ican3_init_new_host_interface()
430 ican3_set_page(mod, QUEUE_FROMHOST_HIGH); ican3_init_new_host_interface()
431 dst = mod->dpm; ican3_init_new_host_interface()
435 desc.pointer = mod->free_page; ican3_init_new_host_interface()
437 mod->free_page++; ican3_init_new_host_interface()
440 ican3_set_page(mod, QUEUE_FROMHOST_LOW); ican3_init_new_host_interface()
441 dst = mod->dpm; ican3_init_new_host_interface()
445 desc.pointer = mod->free_page; ican3_init_new_host_interface()
447 mod->free_page++; ican3_init_new_host_interface()
449 spin_unlock_irqrestore(&mod->lock, flags); ican3_init_new_host_interface()
456 static void ican3_init_fast_host_interface(struct ican3_dev *mod) ican3_init_fast_host_interface() argument
464 spin_lock_irqsave(&mod->lock, flags); ican3_init_fast_host_interface()
467 mod->fastrx_start = mod->free_page; ican3_init_fast_host_interface()
468 mod->fastrx_num = 0; ican3_init_fast_host_interface()
484 ican3_set_page(mod, mod->free_page); ican3_init_fast_host_interface()
487 dst = mod->dpm + addr; ican3_init_fast_host_interface()
494 mod->free_page++; ican3_init_fast_host_interface()
500 mod->free_page++; ican3_init_fast_host_interface()
503 mod->fasttx_start = mod->free_page; ican3_init_fast_host_interface()
504 mod->fasttx_num = 0; ican3_init_fast_host_interface()
520 ican3_set_page(mod, mod->free_page); ican3_init_fast_host_interface()
523 dst = mod->dpm + addr; ican3_init_fast_host_interface()
530 mod->free_page++; ican3_init_fast_host_interface()
534 spin_unlock_irqrestore(&mod->lock, flags); ican3_init_fast_host_interface()
542 * LOCKING: must hold mod->lock
544 static int ican3_new_send_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_new_send_msg() argument
547 void __iomem *desc_addr = mod->dpm + (mod->tx_num * sizeof(desc)); ican3_new_send_msg()
550 ican3_set_page(mod, QUEUE_FROMHOST_MID); ican3_new_send_msg()
554 netdev_dbg(mod->ndev, "%s: no free buffers\n", __func__); ican3_new_send_msg()
559 ican3_set_page(mod, desc.pointer); ican3_new_send_msg()
560 memcpy_toio(mod->dpm, msg, sizeof(*msg)); ican3_new_send_msg()
563 ican3_set_page(mod, QUEUE_FROMHOST_MID); ican3_new_send_msg()
568 mod->tx_num = (desc.control & DESC_WRAP) ? 0 : (mod->tx_num + 1); ican3_new_send_msg()
573 * LOCKING: must hold mod->lock
575 static int ican3_new_recv_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_new_recv_msg() argument
578 void __iomem *desc_addr = mod->dpm + (mod->rx_num * sizeof(desc)); ican3_new_recv_msg()
581 ican3_set_page(mod, QUEUE_TOHOST); ican3_new_recv_msg()
585 netdev_dbg(mod->ndev, "%s: no buffers to recv\n", __func__); ican3_new_recv_msg()
590 ican3_set_page(mod, desc.pointer); ican3_new_recv_msg()
591 memcpy_fromio(msg, mod->dpm, sizeof(*msg)); ican3_new_recv_msg()
594 ican3_set_page(mod, QUEUE_TOHOST); ican3_new_recv_msg()
599 mod->rx_num = (desc.control & DESC_WRAP) ? 0 : (mod->rx_num + 1); ican3_new_recv_msg()
607 static int ican3_send_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_send_msg() argument
612 spin_lock_irqsave(&mod->lock, flags); ican3_send_msg()
614 if (mod->iftype == 0) ican3_send_msg()
615 ret = ican3_old_send_msg(mod, msg); ican3_send_msg()
617 ret = ican3_new_send_msg(mod, msg); ican3_send_msg()
619 spin_unlock_irqrestore(&mod->lock, flags); ican3_send_msg()
623 static int ican3_recv_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_recv_msg() argument
628 spin_lock_irqsave(&mod->lock, flags); ican3_recv_msg()
630 if (mod->iftype == 0) ican3_recv_msg()
631 ret = ican3_old_recv_msg(mod, msg); ican3_recv_msg()
633 ret = ican3_new_recv_msg(mod, msg); ican3_recv_msg()
635 spin_unlock_irqrestore(&mod->lock, flags); ican3_recv_msg()
643 static int ican3_msg_connect(struct ican3_dev *mod) ican3_msg_connect() argument
651 return ican3_send_msg(mod, &msg); ican3_msg_connect()
654 static int ican3_msg_disconnect(struct ican3_dev *mod) ican3_msg_disconnect() argument
662 return ican3_send_msg(mod, &msg); ican3_msg_disconnect()
665 static int ican3_msg_newhostif(struct ican3_dev *mod) ican3_msg_newhostif() argument
675 WARN_ON(mod->iftype != 0); ican3_msg_newhostif()
677 ret = ican3_send_msg(mod, &msg); ican3_msg_newhostif()
682 mod->iftype = 1; ican3_msg_newhostif()
686 static int ican3_msg_fasthostif(struct ican3_dev *mod) ican3_msg_fasthostif() argument
696 addr = DPM_PAGE_ADDR(mod->fastrx_start); ican3_msg_fasthostif()
703 addr = DPM_PAGE_ADDR(mod->fasttx_start); ican3_msg_fasthostif()
710 WARN_ON(mod->iftype != 1); ican3_msg_fasthostif()
712 return ican3_send_msg(mod, &msg); ican3_msg_fasthostif()
719 static int ican3_set_id_filter(struct ican3_dev *mod, bool accept) ican3_set_id_filter() argument
736 ret = ican3_send_msg(mod, &msg); ican3_set_id_filter()
757 return ican3_send_msg(mod, &msg); ican3_set_id_filter()
763 static int ican3_set_bus_state(struct ican3_dev *mod, bool on) ican3_set_bus_state() argument
765 struct can_bittiming *bt = &mod->can.bittiming; ican3_set_bus_state()
776 if (mod->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) ican3_set_bus_state()
779 if (mod->fwtype == ICAN3_FWTYPE_ICANOS) { ican3_set_bus_state()
790 res = ican3_send_msg(mod, &msg); ican3_set_bus_state()
800 return ican3_send_msg(mod, &msg); ican3_set_bus_state()
802 } else if (mod->fwtype == ICAN3_FWTYPE_CAL_CANOPEN) { ican3_set_bus_state()
817 return ican3_send_msg(mod, &msg); ican3_set_bus_state()
822 static int ican3_set_termination(struct ican3_dev *mod, bool on) ican3_set_termination() argument
832 return ican3_send_msg(mod, &msg); ican3_set_termination()
835 static int ican3_send_inquiry(struct ican3_dev *mod, u8 subspec) ican3_send_inquiry() argument
845 return ican3_send_msg(mod, &msg); ican3_send_inquiry()
848 static int ican3_set_buserror(struct ican3_dev *mod, u8 quota) ican3_set_buserror() argument
858 return ican3_send_msg(mod, &msg); ican3_set_buserror()
865 static void ican3_to_can_frame(struct ican3_dev *mod, ican3_to_can_frame() argument
897 static void can_frame_to_ican3(struct ican3_dev *mod, can_frame_to_ican3() argument
910 if (mod->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT) can_frame_to_ican3()
941 static void ican3_handle_idvers(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_idvers() argument
943 netdev_dbg(mod->ndev, "IDVERS response: %s\n", msg->data); ican3_handle_idvers()
946 static void ican3_handle_msglost(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_msglost() argument
948 struct net_device *dev = mod->ndev; ican3_handle_msglost()
959 netdev_err(mod->ndev, "lost %d control messages\n", msg->data[0]); ican3_handle_msglost()
988 static int ican3_handle_cevtind(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_cevtind() argument
990 struct net_device *dev = mod->ndev; ican3_handle_cevtind()
992 enum can_state state = mod->can.state; ican3_handle_cevtind()
999 netdev_err(mod->ndev, "unable to handle errors on non-SJA1000\n"); ican3_handle_cevtind()
1005 netdev_err(mod->ndev, "error message too short\n"); ican3_handle_cevtind()
1027 netdev_dbg(mod->ndev, "bus error interrupt\n"); ican3_handle_cevtind()
1031 kfree_skb(skb_dequeue(&mod->echoq)); ican3_handle_cevtind()
1041 ret = ican3_set_buserror(mod, 1); ican3_handle_cevtind()
1043 netdev_err(mod->ndev, "unable to re-enable bus-error\n"); ican3_handle_cevtind()
1048 if (!(mod->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)) ican3_handle_cevtind()
1058 netdev_dbg(mod->ndev, "data overrun interrupt\n"); ican3_handle_cevtind()
1067 netdev_dbg(mod->ndev, "error warning + passive interrupt\n"); ican3_handle_cevtind()
1071 mod->can.can_stats.bus_off++; ican3_handle_cevtind()
1085 mod->can.can_stats.bus_error++; ican3_handle_cevtind()
1110 if (state != mod->can.state && (state == CAN_STATE_ERROR_WARNING || ican3_handle_cevtind()
1114 mod->can.can_stats.error_warning++; ican3_handle_cevtind()
1119 mod->can.can_stats.error_passive++; ican3_handle_cevtind()
1129 mod->can.state = state; ican3_handle_cevtind()
1134 static void ican3_handle_inquiry(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_inquiry() argument
1139 mod->bec.rxerr = msg->data[5]; ican3_handle_inquiry()
1140 mod->bec.txerr = msg->data[6]; ican3_handle_inquiry()
1141 complete(&mod->buserror_comp); ican3_handle_inquiry()
1144 mod->termination_enabled = msg->data[6] & HWCONF_TERMINATE_ON; ican3_handle_inquiry()
1145 complete(&mod->termination_comp); ican3_handle_inquiry()
1148 netdev_err(mod->ndev, "received an unknown inquiry response\n"); ican3_handle_inquiry()
1153 static void ican3_handle_unknown_message(struct ican3_dev *mod, ican3_handle_unknown_message() argument
1156 netdev_warn(mod->ndev, "received unknown message: spec 0x%.2x length %d\n", ican3_handle_unknown_message()
1163 static void ican3_handle_message(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_message() argument
1165 netdev_dbg(mod->ndev, "%s: modno %d spec 0x%.2x len %d bytes\n", __func__, ican3_handle_message()
1166 mod->num, msg->spec, le16_to_cpu(msg->len)); ican3_handle_message()
1170 ican3_handle_idvers(mod, msg); ican3_handle_message()
1174 ican3_handle_msglost(mod, msg); ican3_handle_message()
1177 ican3_handle_cevtind(mod, msg); ican3_handle_message()
1180 ican3_handle_inquiry(mod, msg); ican3_handle_message()
1183 ican3_handle_unknown_message(mod, msg); ican3_handle_message()
1192 static void ican3_put_echo_skb(struct ican3_dev *mod, struct sk_buff *skb) ican3_put_echo_skb() argument
1199 skb_queue_tail(&mod->echoq, skb); ican3_put_echo_skb()
1202 static unsigned int ican3_get_echo_skb(struct ican3_dev *mod) ican3_get_echo_skb() argument
1204 struct sk_buff *skb = skb_dequeue(&mod->echoq); ican3_get_echo_skb()
1210 netdev_err(mod->ndev, "BUG: echo skb not occupied\n"); ican3_get_echo_skb()
1226 skb->dev = mod->ndev; ican3_get_echo_skb()
1240 static bool ican3_echo_skb_matches(struct ican3_dev *mod, struct sk_buff *skb) ican3_echo_skb_matches() argument
1243 struct sk_buff *echo_skb = skb_peek(&mod->echoq); ican3_echo_skb_matches()
1262 * LOCKING: must hold mod->lock
1264 static bool ican3_txok(struct ican3_dev *mod) ican3_txok() argument
1270 if (skb_queue_len(&mod->echoq) >= ICAN3_TX_BUFFERS) ican3_txok()
1274 ican3_set_page(mod, mod->fasttx_start + (mod->fasttx_num / 16)); ican3_txok()
1275 desc = mod->dpm + ((mod->fasttx_num % 16) * sizeof(*desc)); ican3_txok()
1290 static int ican3_recv_skb(struct ican3_dev *mod) ican3_recv_skb() argument
1292 struct net_device *ndev = mod->ndev; ican3_recv_skb()
1300 spin_lock_irqsave(&mod->lock, flags); ican3_recv_skb()
1303 ican3_set_page(mod, mod->fastrx_start + (mod->fastrx_num / 16)); ican3_recv_skb()
1304 desc_addr = mod->dpm + ((mod->fastrx_num % 16) * sizeof(desc)); ican3_recv_skb()
1307 spin_unlock_irqrestore(&mod->lock, flags); ican3_recv_skb()
1321 ican3_to_can_frame(mod, &desc, cf); ican3_recv_skb()
1333 if (ican3_echo_skb_matches(mod, skb)) { ican3_recv_skb()
1335 stats->tx_bytes += ican3_get_echo_skb(mod); ican3_recv_skb()
1349 spin_lock_irqsave(&mod->lock, flags); ican3_recv_skb()
1351 ican3_set_page(mod, mod->fastrx_start + (mod->fastrx_num / 16)); ican3_recv_skb()
1355 mod->fastrx_num = (desc.control & DESC_WRAP) ? 0 ican3_recv_skb()
1356 : (mod->fastrx_num + 1); ican3_recv_skb()
1359 spin_unlock_irqrestore(&mod->lock, flags); ican3_recv_skb()
1365 struct ican3_dev *mod = container_of(napi, struct ican3_dev, napi); ican3_napi() local
1373 ret = ican3_recv_msg(mod, &msg); ican3_napi()
1377 ican3_handle_message(mod, &msg); ican3_napi()
1382 ret = ican3_recv_skb(mod); ican3_napi()
1394 spin_lock_irqsave(&mod->lock, flags); ican3_napi()
1397 if (netif_queue_stopped(mod->ndev) && ican3_txok(mod)) ican3_napi()
1398 netif_wake_queue(mod->ndev); ican3_napi()
1400 spin_unlock_irqrestore(&mod->lock, flags); ican3_napi()
1403 iowrite8(1 << mod->num, &mod->ctrl->int_enable); ican3_napi()
1409 struct ican3_dev *mod = dev_id; ican3_irq() local
1416 stat = ioread8(&mod->ctrl->int_disable) & (1 << mod->num); ican3_irq()
1417 if (stat == (1 << mod->num)) ican3_irq()
1421 ioread8(&mod->dpmctrl->interrupt); ican3_irq()
1424 iowrite8(1 << mod->num, &mod->ctrl->int_disable); ican3_irq()
1425 napi_schedule(&mod->napi); ican3_irq()
1438 static int ican3_reset_module(struct ican3_dev *mod) ican3_reset_module() argument
1444 iowrite8(1 << mod->num, &mod->ctrl->int_disable); ican3_reset_module()
1447 mod->free_page = DPM_FREE_START; ican3_reset_module()
1449 ican3_set_page(mod, QUEUE_OLD_CONTROL); ican3_reset_module()
1450 runold = ioread8(mod->dpm + TARGET_RUNNING); ican3_reset_module()
1453 iowrite8(0x00, &mod->dpmctrl->hwreset); ican3_reset_module()
1458 ican3_set_page(mod, QUEUE_OLD_CONTROL); ican3_reset_module()
1459 runnew = ioread8(mod->dpm + TARGET_RUNNING); ican3_reset_module()
1466 netdev_err(mod->ndev, "failed to reset CAN module\n"); ican3_reset_module()
1470 static void ican3_shutdown_module(struct ican3_dev *mod) ican3_shutdown_module() argument
1472 ican3_msg_disconnect(mod); ican3_shutdown_module()
1473 ican3_reset_module(mod); ican3_shutdown_module()
1479 static int ican3_startup_module(struct ican3_dev *mod) ican3_startup_module() argument
1483 ret = ican3_reset_module(mod); ican3_startup_module()
1485 netdev_err(mod->ndev, "unable to reset module\n"); ican3_startup_module()
1490 memcpy_fromio(mod->fwinfo, mod->dpm + FIRMWARE_STAMP, sizeof(mod->fwinfo) - 1); ican3_startup_module()
1491 if (strncmp(mod->fwinfo, "JANZ-ICAN3", 10)) { ican3_startup_module()
1492 netdev_err(mod->ndev, "ICAN3 not detected (found %s)\n", mod->fwinfo); ican3_startup_module()
1495 if (strstr(mod->fwinfo, "CAL/CANopen")) ican3_startup_module()
1496 mod->fwtype = ICAN3_FWTYPE_CAL_CANOPEN; ican3_startup_module()
1498 mod->fwtype = ICAN3_FWTYPE_ICANOS; ican3_startup_module()
1501 iowrite8(1 << mod->num, &mod->ctrl->int_enable); ican3_startup_module()
1503 ret = ican3_msg_connect(mod); ican3_startup_module()
1505 netdev_err(mod->ndev, "unable to connect to module\n"); ican3_startup_module()
1509 ican3_init_new_host_interface(mod); ican3_startup_module()
1510 ret = ican3_msg_newhostif(mod); ican3_startup_module()
1512 netdev_err(mod->ndev, "unable to switch to new-style interface\n"); ican3_startup_module()
1517 ret = ican3_set_termination(mod, true); ican3_startup_module()
1519 netdev_err(mod->ndev, "unable to enable termination\n"); ican3_startup_module()
1524 ret = ican3_set_buserror(mod, 1); ican3_startup_module()
1526 netdev_err(mod->ndev, "unable to set bus-error\n"); ican3_startup_module()
1530 ican3_init_fast_host_interface(mod); ican3_startup_module()
1531 ret = ican3_msg_fasthostif(mod); ican3_startup_module()
1533 netdev_err(mod->ndev, "unable to switch to fast host interface\n"); ican3_startup_module()
1537 ret = ican3_set_id_filter(mod, true); ican3_startup_module()
1539 netdev_err(mod->ndev, "unable to set acceptance filter\n"); ican3_startup_module()
1552 struct ican3_dev *mod = netdev_priv(ndev); ican3_open() local
1558 netdev_err(mod->ndev, "unable to start CAN layer\n"); ican3_open()
1563 ret = ican3_set_bus_state(mod, true); ican3_open()
1565 netdev_err(mod->ndev, "unable to set bus-on\n"); ican3_open()
1571 mod->can.state = CAN_STATE_ERROR_ACTIVE; ican3_open()
1579 struct ican3_dev *mod = netdev_priv(ndev); ican3_stop() local
1584 mod->can.state = CAN_STATE_STOPPED; ican3_stop()
1587 ret = ican3_set_bus_state(mod, false); ican3_stop()
1589 netdev_err(mod->ndev, "unable to set bus-off\n"); ican3_stop()
1594 skb_queue_purge(&mod->echoq); ican3_stop()
1603 struct ican3_dev *mod = netdev_priv(ndev); ican3_xmit() local
1612 spin_lock_irqsave(&mod->lock, flags); ican3_xmit()
1615 if (!ican3_txok(mod)) { ican3_xmit()
1616 netdev_err(mod->ndev, "BUG: no free descriptors\n"); ican3_xmit()
1617 spin_unlock_irqrestore(&mod->lock, flags); ican3_xmit()
1622 ican3_set_page(mod, mod->fasttx_start + (mod->fasttx_num / 16)); ican3_xmit()
1623 desc_addr = mod->dpm + ((mod->fasttx_num % 16) * sizeof(desc)); ican3_xmit()
1628 can_frame_to_ican3(mod, cf, &desc); ican3_xmit()
1636 ican3_put_echo_skb(mod, skb); ican3_xmit()
1647 iowrite8(0x01, &mod->dpmctrl->interrupt); ican3_xmit()
1653 mod->fasttx_num = (desc.control & DESC_WRAP) ? 0 ican3_xmit()
1654 : (mod->fasttx_num + 1); ican3_xmit()
1657 if (!ican3_txok(mod)) ican3_xmit()
1660 spin_unlock_irqrestore(&mod->lock, flags); ican3_xmit()
1690 struct ican3_dev *mod = netdev_priv(ndev); ican3_set_mode() local
1697 ret = ican3_set_bus_state(mod, true); ican3_set_mode()
1704 mod->can.state = CAN_STATE_ERROR_ACTIVE; ican3_set_mode()
1715 struct ican3_dev *mod = netdev_priv(ndev); ican3_get_berr_counter() local
1718 ret = ican3_send_inquiry(mod, INQUIRY_STATUS); ican3_get_berr_counter()
1722 if (!wait_for_completion_timeout(&mod->buserror_comp, HZ)) { ican3_get_berr_counter()
1723 netdev_info(mod->ndev, "%s timed out\n", __func__); ican3_get_berr_counter()
1727 bec->rxerr = mod->bec.rxerr; ican3_get_berr_counter()
1728 bec->txerr = mod->bec.txerr; ican3_get_berr_counter()
1740 struct ican3_dev *mod = netdev_priv(to_net_dev(dev)); ican3_sysfs_show_term() local
1743 ret = ican3_send_inquiry(mod, INQUIRY_TERMINATION); ican3_sysfs_show_term()
1747 if (!wait_for_completion_timeout(&mod->termination_comp, HZ)) { ican3_sysfs_show_term()
1748 netdev_info(mod->ndev, "%s timed out\n", __func__); ican3_sysfs_show_term()
1752 return snprintf(buf, PAGE_SIZE, "%u\n", mod->termination_enabled); ican3_sysfs_show_term()
1759 struct ican3_dev *mod = netdev_priv(to_net_dev(dev)); ican3_sysfs_set_term() local
1766 ret = ican3_set_termination(mod, enable); ican3_sysfs_set_term()
1777 struct ican3_dev *mod = netdev_priv(to_net_dev(dev)); ican3_sysfs_show_fwinfo() local
1779 return scnprintf(buf, PAGE_SIZE, "%s\n", mod->fwinfo); ican3_sysfs_show_fwinfo()
1804 struct ican3_dev *mod; ican3_probe() local
1819 ndev = alloc_candev(sizeof(*mod), 0); ican3_probe()
1827 mod = netdev_priv(ndev); ican3_probe()
1828 mod->ndev = ndev; ican3_probe()
1829 mod->num = pdata->modno; ican3_probe()
1830 netif_napi_add(ndev, &mod->napi, ican3_napi, ICAN3_RX_BUFFERS); ican3_probe()
1831 skb_queue_head_init(&mod->echoq); ican3_probe()
1832 spin_lock_init(&mod->lock); ican3_probe()
1833 init_completion(&mod->termination_comp); ican3_probe()
1834 init_completion(&mod->buserror_comp); ican3_probe()
1840 mod->free_page = DPM_FREE_START; ican3_probe()
1846 mod->can.clock.freq = ICAN3_CAN_CLOCK; ican3_probe()
1847 mod->can.bittiming_const = &ican3_bittiming_const; ican3_probe()
1848 mod->can.do_set_mode = ican3_set_mode; ican3_probe()
1849 mod->can.do_get_berr_counter = ican3_get_berr_counter; ican3_probe()
1850 mod->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES ican3_probe()
1855 mod->irq = platform_get_irq(pdev, 0); ican3_probe()
1856 if (mod->irq < 0) { ican3_probe()
1862 ndev->irq = mod->irq; ican3_probe()
1872 mod->dpm = ioremap(res->start, resource_size(res)); ican3_probe()
1873 if (!mod->dpm) { ican3_probe()
1879 mod->dpmctrl = mod->dpm + DPM_PAGE_SIZE; ican3_probe()
1889 mod->ctrl = ioremap(res->start, resource_size(res)); ican3_probe()
1890 if (!mod->ctrl) { ican3_probe()
1897 iowrite8(1 << mod->num, &mod->ctrl->int_disable); ican3_probe()
1898 ret = request_irq(mod->irq, ican3_irq, IRQF_SHARED, DRV_NAME, mod); ican3_probe()
1905 napi_enable(&mod->napi); ican3_probe()
1906 ret = ican3_startup_module(mod); ican3_probe()
1919 netdev_info(mod->ndev, "module %d: registered CAN device\n", pdata->modno); ican3_probe()
1923 napi_disable(&mod->napi); ican3_probe()
1924 iowrite8(1 << mod->num, &mod->ctrl->int_disable); ican3_probe()
1925 free_irq(mod->irq, mod); ican3_probe()
1927 iounmap(mod->ctrl); ican3_probe()
1929 iounmap(mod->dpm); ican3_probe()
1939 struct ican3_dev *mod = netdev_priv(ndev); ican3_remove() local
1943 napi_disable(&mod->napi); ican3_remove()
1944 iowrite8(1 << mod->num, &mod->ctrl->int_disable); ican3_remove()
1945 free_irq(mod->irq, mod); ican3_remove()
1948 ican3_shutdown_module(mod); ican3_remove()
1951 iounmap(mod->ctrl); ican3_remove()
1952 iounmap(mod->dpm); ican3_remove()
/linux-4.4.14/kernel/
H A Dmodule.c126 struct module *mod = mtn->mod; __mod_tree_val() local
128 if (unlikely(mtn == &mod->mtn_init)) __mod_tree_val()
129 return (unsigned long)mod->module_init; __mod_tree_val()
131 return (unsigned long)mod->module_core; __mod_tree_val()
137 struct module *mod = mtn->mod; __mod_tree_size() local
139 if (unlikely(mtn == &mod->mtn_init)) __mod_tree_size()
140 return (unsigned long)mod->init_size; __mod_tree_size()
142 return (unsigned long)mod->core_size; __mod_tree_size()
198 static void mod_tree_insert(struct module *mod) mod_tree_insert() argument
200 mod->mtn_core.mod = mod; mod_tree_insert()
201 mod->mtn_init.mod = mod; mod_tree_insert()
203 __mod_tree_insert(&mod->mtn_core); mod_tree_insert()
204 if (mod->init_size) mod_tree_insert()
205 __mod_tree_insert(&mod->mtn_init); mod_tree_insert()
208 static void mod_tree_remove_init(struct module *mod) mod_tree_remove_init() argument
210 if (mod->init_size) mod_tree_remove_init()
211 __mod_tree_remove(&mod->mtn_init); mod_tree_remove_init()
214 static void mod_tree_remove(struct module *mod) mod_tree_remove() argument
216 __mod_tree_remove(&mod->mtn_core); mod_tree_remove()
217 mod_tree_remove_init(mod); mod_tree_remove()
228 return container_of(ltn, struct mod_tree_node, node)->mod; mod_find()
235 static void mod_tree_insert(struct module *mod) { } mod_tree_remove_init() argument
236 static void mod_tree_remove_init(struct module *mod) { } mod_tree_remove() argument
237 static void mod_tree_remove(struct module *mod) { } mod_tree_remove() argument
241 struct module *mod; mod_find() local
243 list_for_each_entry_rcu(mod, &modules, list) { mod_find()
244 if (within_module(addr, mod)) mod_find()
245 return mod; mod_find()
268 static void mod_update_bounds(struct module *mod) mod_update_bounds() argument
270 __mod_update_bounds(mod->module_core, mod->core_size); mod_update_bounds()
271 if (mod->init_size) mod_update_bounds()
272 __mod_update_bounds(mod->module_init, mod->init_size); mod_update_bounds()
334 unsigned int sym, str, mod, vers, info, pcpu; member in struct:load_info::__anon14810
340 static inline int strong_try_module_get(struct module *mod) strong_try_module_get() argument
342 BUG_ON(mod && mod->state == MODULE_STATE_UNFORMED); strong_try_module_get()
343 if (mod && mod->state == MODULE_STATE_COMING) strong_try_module_get()
345 if (try_module_get(mod)) strong_try_module_get()
351 static inline void add_taint_module(struct module *mod, unsigned flag, add_taint_module() argument
355 mod->taints |= (1U << flag); add_taint_module()
362 void __module_put_and_exit(struct module *mod, long code) __module_put_and_exit() argument
364 module_put(mod); __module_put_and_exit()
453 struct module *mod; each_symbol_section() local
478 list_for_each_entry_rcu(mod, &modules, list) { each_symbol_section()
480 { mod->syms, mod->syms + mod->num_syms, mod->crcs, each_symbol_section()
482 { mod->gpl_syms, mod->gpl_syms + mod->num_gpl_syms, each_symbol_section()
483 mod->gpl_crcs, each_symbol_section()
485 { mod->gpl_future_syms, each_symbol_section()
486 mod->gpl_future_syms + mod->num_gpl_future_syms, each_symbol_section()
487 mod->gpl_future_crcs, each_symbol_section()
490 { mod->unused_syms, each_symbol_section()
491 mod->unused_syms + mod->num_unused_syms, each_symbol_section()
492 mod->unused_crcs, each_symbol_section()
494 { mod->unused_gpl_syms, each_symbol_section()
495 mod->unused_gpl_syms + mod->num_unused_gpl_syms, each_symbol_section()
496 mod->unused_gpl_crcs, each_symbol_section()
501 if (mod->state == MODULE_STATE_UNFORMED) each_symbol_section()
504 if (each_symbol_in_section(arr, ARRAY_SIZE(arr), mod, fn, data)) each_symbol_section()
615 struct module *mod; find_module_all() local
619 list_for_each_entry(mod, &modules, list) { find_module_all()
620 if (!even_unformed && mod->state == MODULE_STATE_UNFORMED) find_module_all()
622 if (strlen(mod->name) == len && !memcmp(mod->name, name, len)) find_module_all()
623 return mod; find_module_all()
637 static inline void __percpu *mod_percpu(struct module *mod) mod_percpu() argument
639 return mod->percpu; mod_percpu()
642 static int percpu_modalloc(struct module *mod, struct load_info *info) percpu_modalloc() argument
652 mod->name, align, PAGE_SIZE); percpu_modalloc()
656 mod->percpu = __alloc_reserved_percpu(pcpusec->sh_size, align); percpu_modalloc()
657 if (!mod->percpu) { percpu_modalloc()
659 mod->name, (unsigned long)pcpusec->sh_size); percpu_modalloc()
662 mod->percpu_size = pcpusec->sh_size; percpu_modalloc()
666 static void percpu_modfree(struct module *mod) percpu_modfree() argument
668 free_percpu(mod->percpu); percpu_modfree()
676 static void percpu_modcopy(struct module *mod, percpu_modcopy() argument
682 memcpy(per_cpu_ptr(mod->percpu, cpu), from, size); percpu_modcopy()
696 struct module *mod; is_module_percpu_address() local
701 list_for_each_entry_rcu(mod, &modules, list) { is_module_percpu_address()
702 if (mod->state == MODULE_STATE_UNFORMED) is_module_percpu_address()
704 if (!mod->percpu_size) is_module_percpu_address()
707 void *start = per_cpu_ptr(mod->percpu, cpu); for_each_possible_cpu()
710 (void *)addr < start + mod->percpu_size) { for_each_possible_cpu()
723 static inline void __percpu *mod_percpu(struct module *mod) mod_percpu() argument
727 static int percpu_modalloc(struct module *mod, struct load_info *info) percpu_modalloc() argument
734 static inline void percpu_modfree(struct module *mod) percpu_modfree() argument
741 static inline void percpu_modcopy(struct module *mod, percpu_modcopy() argument
755 static void setup_modinfo_##field(struct module *mod, const char *s) \
757 mod->field = kstrdup(s, GFP_KERNEL); \
762 return scnprintf(buffer, PAGE_SIZE, "%s\n", mk->mod->field); \
764 static int modinfo_##field##_exists(struct module *mod) \
766 return mod->field != NULL; \
768 static void free_modinfo_##field(struct module *mod) \
770 kfree(mod->field); \
771 mod->field = NULL; \
794 static int module_unload_init(struct module *mod) module_unload_init() argument
800 atomic_set(&mod->refcnt, MODULE_REF_BASE); module_unload_init()
802 INIT_LIST_HEAD(&mod->source_list); module_unload_init()
803 INIT_LIST_HEAD(&mod->target_list); module_unload_init()
806 atomic_inc(&mod->refcnt); module_unload_init()
874 static void module_unload_free(struct module *mod) module_unload_free() argument
879 list_for_each_entry_safe(use, tmp, &mod->target_list, target_list) { module_unload_free()
881 pr_debug("%s unusing %s\n", mod->name, i->name); module_unload_free()
906 static int try_release_module_ref(struct module *mod) try_release_module_ref() argument
911 ret = atomic_sub_return(MODULE_REF_BASE, &mod->refcnt); try_release_module_ref()
915 ret = atomic_add_unless(&mod->refcnt, MODULE_REF_BASE, 0); try_release_module_ref()
920 static int try_stop_module(struct module *mod, int flags, int *forced) try_stop_module() argument
923 if (try_release_module_ref(mod) != 0) { try_stop_module()
930 mod->state = MODULE_STATE_GOING; try_stop_module()
938 * @mod: the module we're checking
944 int module_refcount(struct module *mod) module_refcount() argument
946 return atomic_read(&mod->refcnt) - MODULE_REF_BASE; module_refcount()
951 static void free_module(struct module *mod);
956 struct module *mod; SYSCALL_DEFINE2() local
970 mod = find_module(name); SYSCALL_DEFINE2()
971 if (!mod) { SYSCALL_DEFINE2()
976 if (!list_empty(&mod->source_list)) { SYSCALL_DEFINE2()
983 if (mod->state != MODULE_STATE_LIVE) { SYSCALL_DEFINE2()
985 pr_debug("%s already dying\n", mod->name); SYSCALL_DEFINE2()
991 if (mod->init && !mod->exit) { SYSCALL_DEFINE2()
1001 ret = try_stop_module(mod, flags, &forced); SYSCALL_DEFINE2()
1007 if (mod->exit != NULL) SYSCALL_DEFINE2()
1008 mod->exit(); SYSCALL_DEFINE2()
1010 MODULE_STATE_GOING, mod); SYSCALL_DEFINE2()
1014 strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); SYSCALL_DEFINE2()
1016 free_module(mod); SYSCALL_DEFINE2()
1023 static inline void print_unload_info(struct seq_file *m, struct module *mod) print_unload_info() argument
1028 seq_printf(m, " %i ", module_refcount(mod)); print_unload_info()
1034 list_for_each_entry(use, &mod->source_list, source_list) { print_unload_info()
1039 if (mod->init != NULL && mod->exit == NULL) { print_unload_info()
1084 return sprintf(buffer, "%i\n", module_refcount(mk->mod)); show_refcnt()
1135 static inline void print_unload_info(struct seq_file *m, struct module *mod) print_unload_info() argument
1141 static inline void module_unload_free(struct module *mod) module_unload_free() argument
1151 static inline int module_unload_init(struct module *mod) module_unload_init() argument
1157 static size_t module_flags_taint(struct module *mod, char *buf) module_flags_taint() argument
1161 if (mod->taints & (1 << TAINT_PROPRIETARY_MODULE)) module_flags_taint()
1163 if (mod->taints & (1 << TAINT_OOT_MODULE)) module_flags_taint()
1165 if (mod->taints & (1 << TAINT_FORCED_MODULE)) module_flags_taint()
1167 if (mod->taints & (1 << TAINT_CRAP)) module_flags_taint()
1169 if (mod->taints & (1 << TAINT_UNSIGNED_MODULE)) module_flags_taint()
1184 switch (mk->mod->state) { show_initstate()
1220 return sprintf(buffer, "%u\n", mk->mod->core_size); show_coresize()
1229 return sprintf(buffer, "%u\n", mk->mod->init_size); show_initsize()
1240 l = module_flags_taint(mk->mod, buffer); show_taint()
1264 static int try_to_force_load(struct module *mod, const char *reason) try_to_force_load() argument
1268 pr_warn("%s: %s: kernel tainted.\n", mod->name, reason); try_to_force_load()
1269 add_taint_module(mod, TAINT_FORCED_MODULE, LOCKDEP_NOW_UNRELIABLE); try_to_force_load()
1291 struct module *mod, check_version()
1304 return try_to_force_load(mod, symname) == 0; check_version()
1321 pr_warn("%s: no symbol version for %s\n", mod->name, symname); check_version()
1326 mod->name, symname); check_version()
1332 struct module *mod) check_modstruct_version()
1348 VMLINUX_SYMBOL_STR(module_layout), mod, crc, check_modstruct_version()
1366 struct module *mod, check_version()
1375 struct module *mod) check_modstruct_version()
1388 static const struct kernel_symbol *resolve_symbol(struct module *mod, resolve_symbol() argument
1406 !(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)), true); resolve_symbol()
1410 if (!check_version(info->sechdrs, info->index.vers, name, mod, crc, resolve_symbol()
1416 err = ref_module(mod, owner); resolve_symbol()
1431 resolve_symbol_wait(struct module *mod, resolve_symbol_wait() argument
1439 !IS_ERR(ksym = resolve_symbol(mod, info, name, owner)) resolve_symbol_wait()
1443 mod->name, owner); resolve_symbol_wait()
1489 static void add_sect_attrs(struct module *mod, const struct load_info *info) add_sect_attrs() argument
1534 if (sysfs_create_group(&mod->mkobj.kobj, &sect_attrs->grp)) add_sect_attrs()
1537 mod->sect_attrs = sect_attrs; add_sect_attrs()
1543 static void remove_sect_attrs(struct module *mod) remove_sect_attrs() argument
1545 if (mod->sect_attrs) { remove_sect_attrs()
1546 sysfs_remove_group(&mod->mkobj.kobj, remove_sect_attrs()
1547 &mod->sect_attrs->grp); remove_sect_attrs()
1550 free_sect_attrs(mod->sect_attrs); remove_sect_attrs()
1551 mod->sect_attrs = NULL; remove_sect_attrs()
1588 static void add_notes_attrs(struct module *mod, const struct load_info *info) add_notes_attrs() argument
1595 if (!mod->sect_attrs) add_notes_attrs()
1621 nattr->attr.name = mod->sect_attrs->attrs[loaded].name; add_notes_attrs()
1631 notes_attrs->dir = kobject_create_and_add("notes", &mod->mkobj.kobj); add_notes_attrs()
1640 mod->notes_attrs = notes_attrs; add_notes_attrs()
1647 static void remove_notes_attrs(struct module *mod) remove_notes_attrs() argument
1649 if (mod->notes_attrs) remove_notes_attrs()
1650 free_notes_attrs(mod->notes_attrs, mod->notes_attrs->notes); remove_notes_attrs()
1655 static inline void add_sect_attrs(struct module *mod, add_sect_attrs() argument
1660 static inline void remove_sect_attrs(struct module *mod) remove_sect_attrs() argument
1664 static inline void add_notes_attrs(struct module *mod, add_notes_attrs() argument
1669 static inline void remove_notes_attrs(struct module *mod) remove_notes_attrs() argument
1674 static void add_usage_links(struct module *mod) add_usage_links() argument
1681 list_for_each_entry(use, &mod->target_list, target_list) { add_usage_links()
1683 &mod->mkobj.kobj, mod->name); add_usage_links()
1689 static void del_usage_links(struct module *mod) del_usage_links() argument
1695 list_for_each_entry(use, &mod->target_list, target_list) del_usage_links()
1696 sysfs_remove_link(use->target->holders_dir, mod->name); del_usage_links()
1701 static int module_add_modinfo_attrs(struct module *mod) module_add_modinfo_attrs() argument
1708 mod->modinfo_attrs = kzalloc((sizeof(struct module_attribute) * module_add_modinfo_attrs()
1711 if (!mod->modinfo_attrs) module_add_modinfo_attrs()
1714 temp_attr = mod->modinfo_attrs; module_add_modinfo_attrs()
1717 (attr->test && attr->test(mod))) { module_add_modinfo_attrs()
1720 error = sysfs_create_file(&mod->mkobj.kobj, module_add_modinfo_attrs()
1728 static void module_remove_modinfo_attrs(struct module *mod) module_remove_modinfo_attrs() argument
1733 for (i = 0; (attr = &mod->modinfo_attrs[i]); i++) { module_remove_modinfo_attrs()
1737 sysfs_remove_file(&mod->mkobj.kobj, &attr->attr); module_remove_modinfo_attrs()
1739 attr->free(mod); module_remove_modinfo_attrs()
1741 kfree(mod->modinfo_attrs); module_remove_modinfo_attrs()
1744 static void mod_kobject_put(struct module *mod) mod_kobject_put() argument
1747 mod->mkobj.kobj_completion = &c; mod_kobject_put()
1748 kobject_put(&mod->mkobj.kobj); mod_kobject_put()
1752 static int mod_sysfs_init(struct module *mod) mod_sysfs_init() argument
1758 pr_err("%s: module sysfs not initialized\n", mod->name); mod_sysfs_init()
1763 kobj = kset_find_obj(module_kset, mod->name); mod_sysfs_init()
1765 pr_err("%s: module is already loaded\n", mod->name); mod_sysfs_init()
1771 mod->mkobj.mod = mod; mod_sysfs_init()
1773 memset(&mod->mkobj.kobj, 0, sizeof(mod->mkobj.kobj)); mod_sysfs_init()
1774 mod->mkobj.kobj.kset = module_kset; mod_sysfs_init()
1775 err = kobject_init_and_add(&mod->mkobj.kobj, &module_ktype, NULL, mod_sysfs_init()
1776 "%s", mod->name); mod_sysfs_init()
1778 mod_kobject_put(mod); mod_sysfs_init()
1785 static int mod_sysfs_setup(struct module *mod, mod_sysfs_setup() argument
1792 err = mod_sysfs_init(mod); mod_sysfs_setup()
1796 mod->holders_dir = kobject_create_and_add("holders", &mod->mkobj.kobj); mod_sysfs_setup()
1797 if (!mod->holders_dir) { mod_sysfs_setup()
1802 err = module_param_sysfs_setup(mod, kparam, num_params); mod_sysfs_setup()
1806 err = module_add_modinfo_attrs(mod); mod_sysfs_setup()
1810 add_usage_links(mod); mod_sysfs_setup()
1811 add_sect_attrs(mod, info); mod_sysfs_setup()
1812 add_notes_attrs(mod, info); mod_sysfs_setup()
1814 kobject_uevent(&mod->mkobj.kobj, KOBJ_ADD); mod_sysfs_setup()
1818 module_param_sysfs_remove(mod); mod_sysfs_setup()
1820 kobject_put(mod->holders_dir); mod_sysfs_setup()
1822 mod_kobject_put(mod); mod_sysfs_setup()
1827 static void mod_sysfs_fini(struct module *mod) mod_sysfs_fini() argument
1829 remove_notes_attrs(mod); mod_sysfs_fini()
1830 remove_sect_attrs(mod); mod_sysfs_fini()
1831 mod_kobject_put(mod); mod_sysfs_fini()
1834 static void init_param_lock(struct module *mod) init_param_lock() argument
1836 mutex_init(&mod->param_lock); init_param_lock()
1840 static int mod_sysfs_setup(struct module *mod, mod_sysfs_setup() argument
1848 static void mod_sysfs_fini(struct module *mod) mod_sysfs_fini() argument
1852 static void module_remove_modinfo_attrs(struct module *mod) module_remove_modinfo_attrs() argument
1856 static void del_usage_links(struct module *mod) del_usage_links() argument
1860 static void init_param_lock(struct module *mod) init_param_lock() argument
1865 static void mod_sysfs_teardown(struct module *mod) mod_sysfs_teardown() argument
1867 del_usage_links(mod); mod_sysfs_teardown()
1868 module_remove_modinfo_attrs(mod); mod_sysfs_teardown()
1869 module_param_sysfs_remove(mod); mod_sysfs_teardown()
1870 kobject_put(mod->mkobj.drivers_dir); mod_sysfs_teardown()
1871 kobject_put(mod->holders_dir); mod_sysfs_teardown()
1872 mod_sysfs_fini(mod); mod_sysfs_teardown()
1919 static void unset_module_core_ro_nx(struct module *mod) unset_module_core_ro_nx() argument
1921 set_page_attributes(mod->module_core + mod->core_text_size, unset_module_core_ro_nx()
1922 mod->module_core + mod->core_size, unset_module_core_ro_nx()
1924 set_page_attributes(mod->module_core, unset_module_core_ro_nx()
1925 mod->module_core + mod->core_ro_size, unset_module_core_ro_nx()
1929 static void unset_module_init_ro_nx(struct module *mod) unset_module_init_ro_nx() argument
1931 set_page_attributes(mod->module_init + mod->init_text_size, unset_module_init_ro_nx()
1932 mod->module_init + mod->init_size, unset_module_init_ro_nx()
1934 set_page_attributes(mod->module_init, unset_module_init_ro_nx()
1935 mod->module_init + mod->init_ro_size, unset_module_init_ro_nx()
1942 struct module *mod; set_all_modules_text_rw() local
1945 list_for_each_entry_rcu(mod, &modules, list) { set_all_modules_text_rw()
1946 if (mod->state == MODULE_STATE_UNFORMED) set_all_modules_text_rw()
1948 if ((mod->module_core) && (mod->core_text_size)) { set_all_modules_text_rw()
1949 set_page_attributes(mod->module_core, set_all_modules_text_rw()
1950 mod->module_core + mod->core_text_size, set_all_modules_text_rw()
1953 if ((mod->module_init) && (mod->init_text_size)) { set_all_modules_text_rw()
1954 set_page_attributes(mod->module_init, set_all_modules_text_rw()
1955 mod->module_init + mod->init_text_size, set_all_modules_text_rw()
1965 struct module *mod; set_all_modules_text_ro() local
1968 list_for_each_entry_rcu(mod, &modules, list) { set_all_modules_text_ro()
1969 if (mod->state == MODULE_STATE_UNFORMED) set_all_modules_text_ro()
1971 if ((mod->module_core) && (mod->core_text_size)) { set_all_modules_text_ro()
1972 set_page_attributes(mod->module_core, set_all_modules_text_ro()
1973 mod->module_core + mod->core_text_size, set_all_modules_text_ro()
1976 if ((mod->module_init) && (mod->init_text_size)) { set_all_modules_text_ro()
1977 set_page_attributes(mod->module_init, set_all_modules_text_ro()
1978 mod->module_init + mod->init_text_size, set_all_modules_text_ro()
1986 static void unset_module_core_ro_nx(struct module *mod) { } unset_module_init_ro_nx() argument
1987 static void unset_module_init_ro_nx(struct module *mod) { } unset_module_init_ro_nx() argument
1995 void __weak module_arch_cleanup(struct module *mod) module_arch_cleanup() argument
1999 void __weak module_arch_freeing_init(struct module *mod) module_arch_freeing_init() argument
2004 static void free_module(struct module *mod) free_module() argument
2006 trace_module_free(mod); free_module()
2008 mod_sysfs_teardown(mod); free_module()
2013 mod->state = MODULE_STATE_UNFORMED; free_module()
2017 ddebug_remove_module(mod->name); free_module()
2020 module_arch_cleanup(mod); free_module()
2023 module_unload_free(mod); free_module()
2026 destroy_params(mod->kp, mod->num_kp); free_module()
2031 list_del_rcu(&mod->list); free_module()
2032 mod_tree_remove(mod); free_module()
2034 module_bug_cleanup(mod); free_module()
2035 /* Wait for RCU-sched synchronizing before releasing mod->list and buglist. */ free_module()
2040 unset_module_init_ro_nx(mod); free_module()
2041 module_arch_freeing_init(mod); free_module()
2042 module_memfree(mod->module_init); free_module()
2043 kfree(mod->args); free_module()
2044 percpu_modfree(mod); free_module()
2047 lockdep_free_key_range(mod->module_core, mod->core_size); free_module()
2050 unset_module_core_ro_nx(mod); free_module()
2051 module_memfree(mod->module_core); free_module()
2079 static int verify_export_symbols(struct module *mod) verify_export_symbols() argument
2088 { mod->syms, mod->num_syms }, verify_export_symbols()
2089 { mod->gpl_syms, mod->num_gpl_syms }, verify_export_symbols()
2090 { mod->gpl_future_syms, mod->num_gpl_future_syms }, verify_export_symbols()
2092 { mod->unused_syms, mod->num_unused_syms }, verify_export_symbols()
2093 { mod->unused_gpl_syms, mod->num_unused_gpl_syms }, verify_export_symbols()
2102 mod->name, s->name, module_name(owner)); verify_export_symbols()
2111 static int simplify_symbols(struct module *mod, const struct load_info *info) simplify_symbols() argument
2133 mod->name); simplify_symbols()
2144 ksym = resolve_symbol_wait(mod, info, name); simplify_symbols()
2156 mod->name, name, PTR_ERR(ksym)); simplify_symbols()
2163 secbase = (unsigned long)mod_percpu(mod); simplify_symbols()
2174 static int apply_relocations(struct module *mod, const struct load_info *info) apply_relocations() argument
2193 info->index.sym, i, mod); apply_relocations()
2196 info->index.sym, i, mod); apply_relocations()
2204 unsigned int __weak arch_mod_section_prepend(struct module *mod, arch_mod_section_prepend() argument
2212 static long get_offset(struct module *mod, unsigned int *size, get_offset() argument
2217 *size += arch_mod_section_prepend(mod, section); get_offset()
2227 static void layout_sections(struct module *mod, struct load_info *info) layout_sections() argument
2254 s->sh_entsize = get_offset(mod, &mod->core_size, s, i); layout_sections()
2259 mod->core_size = debug_align(mod->core_size); layout_sections()
2260 mod->core_text_size = mod->core_size; layout_sections()
2263 mod->core_size = debug_align(mod->core_size); layout_sections()
2264 mod->core_ro_size = mod->core_size; layout_sections()
2267 mod->core_size = debug_align(mod->core_size); layout_sections()
2283 s->sh_entsize = (get_offset(mod, &mod->init_size, s, i) layout_sections()
2289 mod->init_size = debug_align(mod->init_size); layout_sections()
2290 mod->init_text_size = mod->init_size; layout_sections()
2293 mod->init_size = debug_align(mod->init_size); layout_sections()
2294 mod->init_ro_size = mod->init_size; layout_sections()
2297 mod->init_size = debug_align(mod->init_size); layout_sections()
2303 static void set_license(struct module *mod, const char *license) set_license() argument
2311 mod->name, license); set_license()
2312 add_taint_module(mod, TAINT_PROPRIETARY_MODULE, set_license()
2350 static void setup_modinfo(struct module *mod, struct load_info *info) setup_modinfo() argument
2357 attr->setup(mod, get_modinfo(info, attr->attr.name)); setup_modinfo()
2361 static void free_modinfo(struct module *mod) free_modinfo() argument
2368 attr->free(mod); free_modinfo()
2384 const struct module *mod) is_exported()
2387 if (!mod) is_exported()
2390 ks = lookup_symbol(name, mod->syms, mod->syms + mod->num_syms); is_exported()
2463 static void layout_symtab(struct module *mod, struct load_info *info) layout_symtab() argument
2472 symsect->sh_entsize = get_offset(mod, &mod->init_size, symsect, layout_symtab()
2489 info->symoffs = ALIGN(mod->core_size, symsect->sh_addralign ?: 1); layout_symtab()
2490 info->stroffs = mod->core_size = info->symoffs + ndst * sizeof(Elf_Sym); layout_symtab()
2491 mod->core_size += strtab_size; layout_symtab()
2492 mod->core_size = debug_align(mod->core_size); layout_symtab()
2496 strsect->sh_entsize = get_offset(mod, &mod->init_size, strsect, layout_symtab()
2501 mod->init_size = ALIGN(mod->init_size, layout_symtab()
2503 info->mod_kallsyms_init_off = mod->init_size; layout_symtab()
2504 mod->init_size += sizeof(struct mod_kallsyms); layout_symtab()
2505 mod->init_size = debug_align(mod->init_size); layout_symtab()
2513 static void add_kallsyms(struct module *mod, const struct load_info *info) add_kallsyms() argument
2522 mod->kallsyms = mod->module_init + info->mod_kallsyms_init_off; add_kallsyms()
2524 mod->kallsyms->symtab = (void *)symsec->sh_addr; add_kallsyms()
2525 mod->kallsyms->num_symtab = symsec->sh_size / sizeof(Elf_Sym); add_kallsyms()
2527 mod->kallsyms->strtab = (void *)info->sechdrs[info->index.str].sh_addr; add_kallsyms()
2530 for (i = 0; i < mod->kallsyms->num_symtab; i++) add_kallsyms()
2531 mod->kallsyms->symtab[i].st_info add_kallsyms()
2532 = elf_type(&mod->kallsyms->symtab[i], info); add_kallsyms()
2535 mod->core_kallsyms.symtab = dst = mod->module_core + info->symoffs; add_kallsyms()
2536 mod->core_kallsyms.strtab = s = mod->module_core + info->stroffs; add_kallsyms()
2537 src = mod->kallsyms->symtab; add_kallsyms()
2538 for (ndst = i = 0; i < mod->kallsyms->num_symtab; i++) { add_kallsyms()
2542 dst[ndst++].st_name = s - mod->core_kallsyms.strtab; add_kallsyms()
2543 s += strlcpy(s, &mod->kallsyms->strtab[src[i].st_name], add_kallsyms()
2547 mod->core_kallsyms.num_symtab = ndst; add_kallsyms()
2550 static inline void layout_symtab(struct module *mod, struct load_info *info) layout_symtab() argument
2554 static void add_kallsyms(struct module *mod, const struct load_info *info) add_kallsyms() argument
2582 static void kmemleak_load_module(const struct module *mod, kmemleak_load_module() argument
2588 kmemleak_scan_area(mod, sizeof(struct module), GFP_KERNEL); kmemleak_load_module()
2602 static inline void kmemleak_load_module(const struct module *mod, kmemleak_load_module() argument
2613 const void *mod = info->hdr; module_sig_check() local
2616 memcmp(mod + info->len - markerlen, MODULE_SIG_STRING, markerlen) == 0) { module_sig_check()
2619 err = mod_verify_sig(mod, &info->len); module_sig_check()
2816 struct module *mod; setup_load_info() local
2838 info->index.mod = find_sec(info, ".gnu.linkonce.this_module"); setup_load_info()
2839 if (!info->index.mod) { setup_load_info()
2843 /* This is temporary: point mod into copy of data. */ setup_load_info()
2844 mod = (void *)info->sechdrs[info->index.mod].sh_addr; setup_load_info()
2847 pr_warn("%s: module has no symbols (stripped?)\n", mod->name); setup_load_info()
2854 if (!check_modstruct_version(info->sechdrs, info->index.vers, mod)) setup_load_info()
2857 return mod; setup_load_info()
2860 static int check_modinfo(struct module *mod, struct load_info *info, int flags) check_modinfo() argument
2870 err = try_to_force_load(mod, "bad vermagic"); check_modinfo()
2875 mod->name, modmagic, vermagic); check_modinfo()
2880 add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); check_modinfo()
2883 add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK); check_modinfo()
2885 "is unknown, you have been warned.\n", mod->name); check_modinfo()
2889 set_license(mod, get_modinfo(info, "license")); check_modinfo()
2894 static int find_module_sections(struct module *mod, struct load_info *info) find_module_sections() argument
2896 mod->kp = section_objs(info, "__param", find_module_sections()
2897 sizeof(*mod->kp), &mod->num_kp); find_module_sections()
2898 mod->syms = section_objs(info, "__ksymtab", find_module_sections()
2899 sizeof(*mod->syms), &mod->num_syms); find_module_sections()
2900 mod->crcs = section_addr(info, "__kcrctab"); find_module_sections()
2901 mod->gpl_syms = section_objs(info, "__ksymtab_gpl", find_module_sections()
2902 sizeof(*mod->gpl_syms), find_module_sections()
2903 &mod->num_gpl_syms); find_module_sections()
2904 mod->gpl_crcs = section_addr(info, "__kcrctab_gpl"); find_module_sections()
2905 mod->gpl_future_syms = section_objs(info, find_module_sections()
2907 sizeof(*mod->gpl_future_syms), find_module_sections()
2908 &mod->num_gpl_future_syms); find_module_sections()
2909 mod->gpl_future_crcs = section_addr(info, "__kcrctab_gpl_future"); find_module_sections()
2912 mod->unused_syms = section_objs(info, "__ksymtab_unused", find_module_sections()
2913 sizeof(*mod->unused_syms), find_module_sections()
2914 &mod->num_unused_syms); find_module_sections()
2915 mod->unused_crcs = section_addr(info, "__kcrctab_unused"); find_module_sections()
2916 mod->unused_gpl_syms = section_objs(info, "__ksymtab_unused_gpl", find_module_sections()
2917 sizeof(*mod->unused_gpl_syms), find_module_sections()
2918 &mod->num_unused_gpl_syms); find_module_sections()
2919 mod->unused_gpl_crcs = section_addr(info, "__kcrctab_unused_gpl"); find_module_sections()
2922 mod->ctors = section_objs(info, ".ctors", find_module_sections()
2923 sizeof(*mod->ctors), &mod->num_ctors); find_module_sections()
2924 if (!mod->ctors) find_module_sections()
2925 mod->ctors = section_objs(info, ".init_array", find_module_sections()
2926 sizeof(*mod->ctors), &mod->num_ctors); find_module_sections()
2933 mod->name); find_module_sections()
2939 mod->tracepoints_ptrs = section_objs(info, "__tracepoints_ptrs", find_module_sections()
2940 sizeof(*mod->tracepoints_ptrs), find_module_sections()
2941 &mod->num_tracepoints); find_module_sections()
2944 mod->jump_entries = section_objs(info, "__jump_table", find_module_sections()
2945 sizeof(*mod->jump_entries), find_module_sections()
2946 &mod->num_jump_entries); find_module_sections()
2949 mod->trace_events = section_objs(info, "_ftrace_events", find_module_sections()
2950 sizeof(*mod->trace_events), find_module_sections()
2951 &mod->num_trace_events); find_module_sections()
2952 mod->trace_enums = section_objs(info, "_ftrace_enum_map", find_module_sections()
2953 sizeof(*mod->trace_enums), find_module_sections()
2954 &mod->num_trace_enums); find_module_sections()
2957 mod->trace_bprintk_fmt_start = section_objs(info, "__trace_printk_fmt", find_module_sections()
2958 sizeof(*mod->trace_bprintk_fmt_start), find_module_sections()
2959 &mod->num_trace_bprintk_fmt); find_module_sections()
2963 mod->ftrace_callsites = section_objs(info, "__mcount_loc", find_module_sections()
2964 sizeof(*mod->ftrace_callsites), find_module_sections()
2965 &mod->num_ftrace_callsites); find_module_sections()
2968 mod->extable = section_objs(info, "__ex_table", find_module_sections()
2969 sizeof(*mod->extable), &mod->num_exentries); find_module_sections()
2972 pr_warn("%s: Ignoring obsolete parameters\n", mod->name); find_module_sections()
2980 static int move_module(struct module *mod, struct load_info *info) move_module() argument
2986 ptr = module_alloc(mod->core_size); move_module()
2996 memset(ptr, 0, mod->core_size); move_module()
2997 mod->module_core = ptr; move_module()
2999 if (mod->init_size) { move_module()
3000 ptr = module_alloc(mod->init_size); move_module()
3009 module_memfree(mod->module_core); move_module()
3012 memset(ptr, 0, mod->init_size); move_module()
3013 mod->module_init = ptr; move_module()
3015 mod->module_init = NULL; move_module()
3027 dest = mod->module_init move_module()
3030 dest = mod->module_core + shdr->sh_entsize; move_module()
3043 static int check_module_license_and_versions(struct module *mod) check_module_license_and_versions() argument
3050 if (strcmp(mod->name, "ndiswrapper") == 0) check_module_license_and_versions()
3054 if (strcmp(mod->name, "driverloader") == 0) check_module_license_and_versions()
3055 add_taint_module(mod, TAINT_PROPRIETARY_MODULE, check_module_license_and_versions()
3059 if (strcmp(mod->name, "lve") == 0) check_module_license_and_versions()
3060 add_taint_module(mod, TAINT_PROPRIETARY_MODULE, check_module_license_and_versions()
3064 if ((mod->num_syms && !mod->crcs) check_module_license_and_versions()
3065 || (mod->num_gpl_syms && !mod->gpl_crcs) check_module_license_and_versions()
3066 || (mod->num_gpl_future_syms && !mod->gpl_future_crcs) check_module_license_and_versions()
3068 || (mod->num_unused_syms && !mod->unused_crcs) check_module_license_and_versions()
3069 || (mod->num_unused_gpl_syms && !mod->unused_gpl_crcs) check_module_license_and_versions()
3072 return try_to_force_load(mod, check_module_license_and_versions()
3079 static void flush_module_icache(const struct module *mod) flush_module_icache() argument
3092 if (mod->module_init) flush_module_icache()
3093 flush_icache_range((unsigned long)mod->module_init, flush_module_icache()
3094 (unsigned long)mod->module_init flush_module_icache()
3095 + mod->init_size); flush_module_icache()
3096 flush_icache_range((unsigned long)mod->module_core, flush_module_icache()
3097 (unsigned long)mod->module_core + mod->core_size); flush_module_icache()
3105 struct module *mod) module_frob_arch_sections()
3113 struct module *mod; layout_and_allocate() local
3116 mod = setup_load_info(info, flags); layout_and_allocate()
3117 if (IS_ERR(mod)) layout_and_allocate()
3118 return mod; layout_and_allocate()
3120 err = check_modinfo(mod, info, flags); layout_and_allocate()
3126 info->secstrings, mod); layout_and_allocate()
3136 layout_sections(mod, info); layout_and_allocate()
3137 layout_symtab(mod, info); layout_and_allocate()
3140 err = move_module(mod, info); layout_and_allocate()
3145 mod = (void *)info->sechdrs[info->index.mod].sh_addr; layout_and_allocate()
3146 kmemleak_load_module(mod, info); layout_and_allocate()
3147 return mod; layout_and_allocate()
3150 /* mod is no longer valid after this! */ module_deallocate()
3151 static void module_deallocate(struct module *mod, struct load_info *info) module_deallocate() argument
3153 percpu_modfree(mod); module_deallocate()
3154 module_arch_freeing_init(mod); module_deallocate()
3155 module_memfree(mod->module_init); module_deallocate()
3156 module_memfree(mod->module_core); module_deallocate()
3166 static int post_relocation(struct module *mod, const struct load_info *info) post_relocation() argument
3169 sort_extable(mod->extable, mod->extable + mod->num_exentries); post_relocation()
3172 percpu_modcopy(mod, (void *)info->sechdrs[info->index.pcpu].sh_addr, post_relocation()
3176 add_kallsyms(mod, info); post_relocation()
3179 return module_finalize(info->hdr, info->sechdrs, mod); post_relocation()
3185 struct module *mod; finished_loading() local
3195 mod = find_module_all(name, strlen(name), true); finished_loading()
3196 ret = !mod || mod->state == MODULE_STATE_LIVE finished_loading()
3197 || mod->state == MODULE_STATE_GOING; finished_loading()
3204 static void do_mod_ctors(struct module *mod) do_mod_ctors() argument
3209 for (i = 0; i < mod->num_ctors; i++) do_mod_ctors()
3210 mod->ctors[i](); do_mod_ctors()
3233 static noinline int do_init_module(struct module *mod) do_init_module() argument
3243 freeinit->module_init = mod->module_init; do_init_module()
3246 * We want to find out whether @mod uses async during init. Clear do_init_module()
3251 do_mod_ctors(mod); do_init_module()
3253 if (mod->init != NULL) do_init_module()
3254 ret = do_one_initcall(mod->init); do_init_module()
3262 __func__, mod->name, ret, __func__); do_init_module()
3267 mod->state = MODULE_STATE_LIVE; do_init_module()
3269 MODULE_STATE_LIVE, mod); do_init_module()
3288 if (!mod->async_probe_requested && (current->flags & PF_USED_ASYNC)) do_init_module()
3293 module_put(mod); do_init_module()
3294 trim_init_extable(mod); do_init_module()
3297 rcu_assign_pointer(mod->kallsyms, &mod->core_kallsyms); do_init_module()
3299 mod_tree_remove_init(mod); do_init_module()
3300 unset_module_init_ro_nx(mod); do_init_module()
3301 module_arch_freeing_init(mod); do_init_module()
3302 mod->module_init = NULL; do_init_module()
3303 mod->init_size = 0; do_init_module()
3304 mod->init_ro_size = 0; do_init_module()
3305 mod->init_text_size = 0; do_init_module()
3322 mod->state = MODULE_STATE_GOING; do_init_module()
3324 module_put(mod); do_init_module()
3326 MODULE_STATE_GOING, mod); do_init_module()
3327 free_module(mod); do_init_module()
3345 static int add_unformed_module(struct module *mod) add_unformed_module() argument
3350 mod->state = MODULE_STATE_UNFORMED; add_unformed_module()
3354 old = find_module_all(mod->name, strlen(mod->name), true); add_unformed_module()
3361 finished_loading(mod->name)); add_unformed_module()
3369 mod_update_bounds(mod); add_unformed_module()
3370 list_add_rcu(&mod->list, &modules); add_unformed_module()
3371 mod_tree_insert(mod); add_unformed_module()
3380 static int complete_formation(struct module *mod, struct load_info *info) complete_formation() argument
3387 err = verify_export_symbols(mod); complete_formation()
3392 module_bug_finalize(info->hdr, info->sechdrs, mod); complete_formation()
3395 set_section_ro_nx(mod->module_core, complete_formation()
3396 mod->core_text_size, complete_formation()
3397 mod->core_ro_size, complete_formation()
3398 mod->core_size); complete_formation()
3401 set_section_ro_nx(mod->module_init, complete_formation()
3402 mod->init_text_size, complete_formation()
3403 mod->init_ro_size, complete_formation()
3404 mod->init_size); complete_formation()
3408 mod->state = MODULE_STATE_COMING; complete_formation()
3412 MODULE_STATE_COMING, mod); complete_formation()
3423 struct module *mod = arg; unknown_module_param_cb() local
3427 mod->async_probe_requested = true; unknown_module_param_cb()
3443 struct module *mod; load_module() local
3456 mod = layout_and_allocate(info, flags); load_module()
3457 if (IS_ERR(mod)) { load_module()
3458 err = PTR_ERR(mod); load_module()
3463 err = add_unformed_module(mod); load_module()
3468 mod->sig_ok = info->sig_ok; load_module()
3469 if (!mod->sig_ok) { load_module()
3472 "kernel\n", mod->name); load_module()
3473 add_taint_module(mod, TAINT_UNSIGNED_MODULE, LOCKDEP_STILL_OK); load_module()
3478 err = percpu_modalloc(mod, info); load_module()
3483 err = module_unload_init(mod); load_module()
3487 init_param_lock(mod); load_module()
3491 err = find_module_sections(mod, info); load_module()
3495 err = check_module_license_and_versions(mod); load_module()
3500 setup_modinfo(mod, info); load_module()
3503 err = simplify_symbols(mod, info); load_module()
3507 err = apply_relocations(mod, info); load_module()
3511 err = post_relocation(mod, info); load_module()
3515 flush_module_icache(mod); load_module()
3518 mod->args = strndup_user(uargs, ~0UL >> 1); load_module()
3519 if (IS_ERR(mod->args)) { load_module()
3520 err = PTR_ERR(mod->args); load_module()
3527 ftrace_module_init(mod); load_module()
3530 err = complete_formation(mod, info); load_module()
3535 after_dashes = parse_args(mod->name, mod->args, mod->kp, mod->num_kp, load_module()
3536 -32768, 32767, mod, load_module()
3543 mod->name, after_dashes); load_module()
3547 err = mod_sysfs_setup(mod, info, mod->kp, mod->num_kp); load_module()
3555 trace_module_load(mod); load_module()
3557 return do_init_module(mod); load_module()
3562 module_bug_cleanup(mod); load_module()
3566 MODULE_STATE_GOING, mod); load_module()
3569 unset_module_init_ro_nx(mod); load_module()
3570 unset_module_core_ro_nx(mod); load_module()
3575 kfree(mod->args); load_module()
3577 module_arch_cleanup(mod); load_module()
3579 free_modinfo(mod); load_module()
3581 module_unload_free(mod); load_module()
3585 list_del_rcu(&mod->list); load_module()
3586 mod_tree_remove(mod); load_module()
3588 /* Wait for RCU-sched synchronizing before releasing mod->list. */ load_module()
3597 ftrace_release_mod(mod); load_module()
3599 lockdep_free_key_range(mod->module_core, mod->core_size); load_module()
3601 module_deallocate(mod, info); load_module()
3672 static const char *get_ksymbol(struct module *mod, get_ksymbol() argument
3679 struct mod_kallsyms *kallsyms = rcu_dereference_sched(mod->kallsyms); get_ksymbol()
3682 if (within_module_init(addr, mod)) get_ksymbol()
3683 nextval = (unsigned long)mod->module_init+mod->init_text_size; get_ksymbol()
3685 nextval = (unsigned long)mod->module_core+mod->core_text_size; get_ksymbol()
3726 struct module *mod; module_address_lookup() local
3729 mod = __module_address(addr); module_address_lookup()
3730 if (mod) { module_address_lookup()
3732 *modname = mod->name; module_address_lookup()
3733 ret = get_ksymbol(mod, addr, size, offset); module_address_lookup()
3747 struct module *mod; lookup_module_symbol_name() local
3750 list_for_each_entry_rcu(mod, &modules, list) { lookup_module_symbol_name()
3751 if (mod->state == MODULE_STATE_UNFORMED) lookup_module_symbol_name()
3753 if (within_module(addr, mod)) { lookup_module_symbol_name()
3756 sym = get_ksymbol(mod, addr, NULL, NULL); lookup_module_symbol_name()
3772 struct module *mod; lookup_module_symbol_attrs() local
3775 list_for_each_entry_rcu(mod, &modules, list) { lookup_module_symbol_attrs()
3776 if (mod->state == MODULE_STATE_UNFORMED) lookup_module_symbol_attrs()
3778 if (within_module(addr, mod)) { lookup_module_symbol_attrs()
3781 sym = get_ksymbol(mod, addr, size, offset); lookup_module_symbol_attrs()
3785 strlcpy(modname, mod->name, MODULE_NAME_LEN); lookup_module_symbol_attrs()
3800 struct module *mod; module_get_kallsym() local
3803 list_for_each_entry_rcu(mod, &modules, list) { module_get_kallsym()
3806 if (mod->state == MODULE_STATE_UNFORMED) module_get_kallsym()
3808 kallsyms = rcu_dereference_sched(mod->kallsyms); module_get_kallsym()
3813 strlcpy(module_name, mod->name, MODULE_NAME_LEN); module_get_kallsym()
3814 *exported = is_exported(name, *value, mod); module_get_kallsym()
3824 static unsigned long mod_find_symname(struct module *mod, const char *name) mod_find_symname() argument
3827 struct mod_kallsyms *kallsyms = rcu_dereference_sched(mod->kallsyms); mod_find_symname()
3839 struct module *mod; module_kallsyms_lookup_name() local
3846 if ((mod = find_module_all(name, colon - name, false)) != NULL) module_kallsyms_lookup_name()
3847 ret = mod_find_symname(mod, colon+1); module_kallsyms_lookup_name()
3849 list_for_each_entry_rcu(mod, &modules, list) { module_kallsyms_lookup_name()
3850 if (mod->state == MODULE_STATE_UNFORMED) module_kallsyms_lookup_name()
3852 if ((ret = mod_find_symname(mod, name)) != 0) module_kallsyms_lookup_name()
3864 struct module *mod; module_kallsyms_on_each_symbol() local
3870 list_for_each_entry(mod, &modules, list) { module_kallsyms_on_each_symbol()
3872 struct mod_kallsyms *kallsyms = mod->kallsyms; module_kallsyms_on_each_symbol()
3874 if (mod->state == MODULE_STATE_UNFORMED) module_kallsyms_on_each_symbol()
3878 mod, kallsyms->symtab[i].st_value); module_kallsyms_on_each_symbol()
3887 static char *module_flags(struct module *mod, char *buf) module_flags() argument
3891 BUG_ON(mod->state == MODULE_STATE_UNFORMED); module_flags()
3892 if (mod->taints || module_flags()
3893 mod->state == MODULE_STATE_GOING || module_flags()
3894 mod->state == MODULE_STATE_COMING) { module_flags()
3896 bx += module_flags_taint(mod, buf + bx); module_flags()
3898 if (mod->state == MODULE_STATE_GOING) module_flags()
3901 if (mod->state == MODULE_STATE_COMING) module_flags()
3930 struct module *mod = list_entry(p, struct module, list); m_show() local
3934 if (mod->state == MODULE_STATE_UNFORMED) m_show()
3938 mod->name, mod->init_size + mod->core_size); m_show()
3939 print_unload_info(m, mod); m_show()
3943 mod->state == MODULE_STATE_GOING ? "Unloading" : m_show()
3944 mod->state == MODULE_STATE_COMING ? "Loading" : m_show()
3947 seq_printf(m, " 0x%pK", mod->module_core); m_show()
3950 if (mod->taints) m_show()
3951 seq_printf(m, " %s", module_flags(mod, buf)); m_show()
3993 struct module *mod; search_module_extables() local
3996 list_for_each_entry_rcu(mod, &modules, list) { search_module_extables()
3997 if (mod->state == MODULE_STATE_UNFORMED) search_module_extables()
3999 if (mod->num_exentries == 0) search_module_extables()
4002 e = search_extable(mod->extable, search_module_extables()
4003 mod->extable + mod->num_exentries - 1, search_module_extables()
4042 struct module *mod; __module_address() local
4049 mod = mod_find(addr); __module_address()
4050 if (mod) { __module_address()
4051 BUG_ON(!within_module(addr, mod)); __module_address()
4052 if (mod->state == MODULE_STATE_UNFORMED) __module_address()
4053 mod = NULL; __module_address()
4055 return mod; __module_address()
4087 struct module *mod = __module_address(addr); __module_text_address() local
4088 if (mod) { __module_text_address()
4090 if (!within(addr, mod->module_init, mod->init_text_size) __module_text_address()
4091 && !within(addr, mod->module_core, mod->core_text_size)) __module_text_address()
4092 mod = NULL; __module_text_address()
4094 return mod; __module_text_address()
4101 struct module *mod; print_modules() local
4107 list_for_each_entry_rcu(mod, &modules, list) { print_modules()
4108 if (mod->state == MODULE_STATE_UNFORMED) print_modules()
4110 pr_cont(" %s%s", mod->name, module_flags(mod, buf)); print_modules()
4121 void module_layout(struct module *mod, module_layout() argument
1288 check_version(Elf_Shdr *sechdrs, unsigned int versindex, const char *symname, struct module *mod, const unsigned long *crc, const struct module *crc_owner) check_version() argument
1330 check_modstruct_version(Elf_Shdr *sechdrs, unsigned int versindex, struct module *mod) check_modstruct_version() argument
1363 check_version(Elf_Shdr *sechdrs, unsigned int versindex, const char *symname, struct module *mod, const unsigned long *crc, const struct module *crc_owner) check_version() argument
1373 check_modstruct_version(Elf_Shdr *sechdrs, unsigned int versindex, struct module *mod) check_modstruct_version() argument
2383 is_exported(const char *name, unsigned long value, const struct module *mod) is_exported() argument
3102 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) module_frob_arch_sections() argument
H A Djump_label.c250 struct module *mod; member in struct:static_key_mod
255 struct module *mod; __jump_label_mod_text_reserved() local
257 mod = __module_text_address((unsigned long)start); __jump_label_mod_text_reserved()
258 if (!mod) __jump_label_mod_text_reserved()
261 WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod); __jump_label_mod_text_reserved()
263 return __jump_label_text_reserved(mod->jump_entries, __jump_label_mod_text_reserved()
264 mod->jump_entries + mod->num_jump_entries, __jump_label_mod_text_reserved()
270 struct static_key_mod *mod; __jump_label_mod_update() local
272 for (mod = key->next; mod; mod = mod->next) { __jump_label_mod_update()
273 struct module *m = mod->mod; __jump_label_mod_update()
275 __jump_label_update(key, mod->entries, __jump_label_mod_update()
282 * @mod: module to patch
288 void jump_label_apply_nops(struct module *mod) jump_label_apply_nops() argument
290 struct jump_entry *iter_start = mod->jump_entries; jump_label_apply_nops()
291 struct jump_entry *iter_stop = iter_start + mod->num_jump_entries; jump_label_apply_nops()
305 static int jump_label_add_module(struct module *mod) jump_label_add_module() argument
307 struct jump_entry *iter_start = mod->jump_entries; jump_label_add_module()
308 struct jump_entry *iter_stop = iter_start + mod->num_jump_entries; jump_label_add_module()
327 if (within_module(iter->key, mod)) { jump_label_add_module()
338 jlm->mod = mod; jump_label_add_module()
351 static void jump_label_del_module(struct module *mod) jump_label_del_module() argument
353 struct jump_entry *iter_start = mod->jump_entries; jump_label_del_module()
354 struct jump_entry *iter_stop = iter_start + mod->num_jump_entries; jump_label_del_module()
365 if (within_module(iter->key, mod)) jump_label_del_module()
371 while (jlm && jlm->mod != mod) { jump_label_del_module()
383 static void jump_label_invalidate_module_init(struct module *mod) jump_label_invalidate_module_init() argument
385 struct jump_entry *iter_start = mod->jump_entries; jump_label_invalidate_module_init()
386 struct jump_entry *iter_stop = iter_start + mod->num_jump_entries; jump_label_invalidate_module_init()
390 if (within_module_init(iter->code, mod)) jump_label_invalidate_module_init()
399 struct module *mod = data; jump_label_module_notify() local
405 ret = jump_label_add_module(mod); jump_label_module_notify()
407 jump_label_del_module(mod); jump_label_module_notify()
412 jump_label_del_module(mod); jump_label_module_notify()
417 jump_label_invalidate_module_init(mod); jump_label_module_notify()
470 struct module *mod; jump_label_update() local
475 mod = __module_address((unsigned long)key); jump_label_update()
476 if (mod) jump_label_update()
477 stop = mod->jump_entries + mod->num_jump_entries; jump_label_update()
H A Dmodule_signing.c41 int mod_verify_sig(const void *mod, unsigned long *_modlen) mod_verify_sig() argument
51 memcpy(&ms, mod + (modlen - sizeof(ms)), sizeof(ms)); mod_verify_sig()
76 return system_verify_data(mod, modlen, mod + modlen, sig_len, mod_verify_sig()
H A Dtracepoint.c326 bool trace_module_has_bad_taint(struct module *mod) trace_module_has_bad_taint() argument
328 return mod->taints & ~((1 << TAINT_OOT_MODULE) | (1 << TAINT_CRAP) | trace_module_has_bad_taint()
400 static int tracepoint_module_coming(struct module *mod) tracepoint_module_coming() argument
405 if (!mod->num_tracepoints) tracepoint_module_coming()
413 if (trace_module_has_bad_taint(mod)) tracepoint_module_coming()
421 tp_mod->mod = mod; tracepoint_module_coming()
430 static void tracepoint_module_going(struct module *mod) tracepoint_module_going() argument
434 if (!mod->num_tracepoints) tracepoint_module_going()
439 if (tp_mod->mod == mod) { tracepoint_module_going()
448 tp_module_going_check_quiescent(mod->tracepoints_ptrs, tracepoint_module_going()
449 mod->tracepoints_ptrs + mod->num_tracepoints); tracepoint_module_going()
465 struct module *mod = data; tracepoint_module_notify() local
470 ret = tracepoint_module_coming(mod); tracepoint_module_notify()
475 tracepoint_module_going(mod); tracepoint_module_notify()
H A Dparams.c34 #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
36 #define KPARAM_MUTEX(mod) (&param_lock)
39 static inline void check_kparam_locked(struct module *mod) check_kparam_locked() argument
41 BUG_ON(!mutex_is_locked(KPARAM_MUTEX(mod))); check_kparam_locked()
44 static inline void check_kparam_locked(struct module *mod) check_kparam_locked() argument
146 kernel_param_lock(params[i].mod); parse_one()
149 kernel_param_unlock(params[i].mod); parse_one()
449 static int param_array(struct module *mod, param_array() argument
481 check_kparam_locked(mod); param_array()
503 return param_array(kp->mod, kp->name, val, 1, arr->max, arr->elem, param_array_set()
518 check_kparam_locked(p.mod); param_array_get()
601 kernel_param_lock(mk->mod); param_attr_show()
603 kernel_param_unlock(mk->mod); param_attr_show()
622 kernel_param_lock(mk->mod); param_attr_store()
625 kernel_param_unlock(mk->mod); param_attr_store()
639 void kernel_param_lock(struct module *mod) kernel_param_lock() argument
641 mutex_lock(KPARAM_MUTEX(mod)); kernel_param_lock()
644 void kernel_param_unlock(struct module *mod) kernel_param_unlock() argument
646 mutex_unlock(KPARAM_MUTEX(mod)); kernel_param_unlock()
736 * @mod: module
741 * /sys/module/[mod->name]/parameters/
743 int module_param_sysfs_setup(struct module *mod, module_param_sysfs_setup() argument
753 err = add_sysfs_param(&mod->mkobj, &kparam[i], kparam[i].name); module_param_sysfs_setup()
755 free_module_param_attrs(&mod->mkobj); module_param_sysfs_setup()
765 err = sysfs_create_group(&mod->mkobj.kobj, &mod->mkobj.mp->grp); module_param_sysfs_setup()
767 free_module_param_attrs(&mod->mkobj); module_param_sysfs_setup()
773 * @mod: module
778 void module_param_sysfs_remove(struct module *mod) module_param_sysfs_remove() argument
780 if (mod->mkobj.mp) { module_param_sysfs_remove()
781 sysfs_remove_group(&mod->mkobj.kobj, &mod->mkobj.mp->grp); module_param_sysfs_remove()
784 free_module_param_attrs(&mod->mkobj); module_param_sysfs_remove()
811 mk->mod = THIS_MODULE; locate_module_kobject()
H A Dcpu.c315 unsigned long mod; member in struct:take_cpu_down_param
330 cpu_notify(CPU_DYING | param->mod, param->hcpu); take_cpu_down()
343 unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0; _cpu_down() local
345 .mod = mod, _cpu_down()
357 err = __cpu_notify(CPU_DOWN_PREPARE | mod, hcpu, -1, &nr_calls); _cpu_down()
360 __cpu_notify(CPU_DOWN_FAILED | mod, hcpu, nr_calls, NULL); _cpu_down()
395 cpu_notify_nofail(CPU_DOWN_FAILED | mod, hcpu); _cpu_down()
422 cpu_notify_nofail(CPU_DEAD | mod, hcpu); _cpu_down()
429 cpu_notify_nofail(CPU_POST_DEAD | mod, hcpu); _cpu_down()
490 unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0; _cpu_up() local
510 ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls); _cpu_up()
526 cpu_notify(CPU_ONLINE | mod, hcpu); _cpu_up()
530 __cpu_notify(CPU_UP_CANCELED | mod, hcpu, nr_calls, NULL); _cpu_up()
/linux-4.4.14/arch/arm/kernel/
H A Dmodule-plts.c33 static bool in_init(const struct module *mod, u32 addr) in_init() argument
35 return addr - (u32)mod->module_init < mod->init_size; in_init()
38 u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val) get_module_plt() argument
43 if (in_init(mod, loc)) { get_module_plt()
44 plt = (void *)mod->arch.init_plt->sh_addr; get_module_plt()
45 plt_end = (void *)plt + mod->arch.init_plt->sh_size; get_module_plt()
46 count = &mod->arch.init_plt_count; get_module_plt()
48 plt = (void *)mod->arch.core_plt->sh_addr; get_module_plt()
49 plt_end = (void *)plt + mod->arch.core_plt->sh_size; get_module_plt()
50 count = &mod->arch.core_plt_count; get_module_plt()
133 char *secstrings, struct module *mod) module_frob_arch_sections()
144 mod->arch.core_plt = s; module_frob_arch_sections()
146 mod->arch.init_plt = s; module_frob_arch_sections()
148 if (!mod->arch.core_plt || !mod->arch.init_plt) { module_frob_arch_sections()
149 pr_err("%s: sections missing\n", mod->name); module_frob_arch_sections()
167 mod->arch.core_plt->sh_type = SHT_NOBITS; module_frob_arch_sections()
168 mod->arch.core_plt->sh_flags = SHF_EXECINSTR | SHF_ALLOC; module_frob_arch_sections()
169 mod->arch.core_plt->sh_addralign = L1_CACHE_BYTES; module_frob_arch_sections()
170 mod->arch.core_plt->sh_size = round_up(core_plts * PLT_ENT_SIZE, module_frob_arch_sections()
172 mod->arch.core_plt_count = 0; module_frob_arch_sections()
174 mod->arch.init_plt->sh_type = SHT_NOBITS; module_frob_arch_sections()
175 mod->arch.init_plt->sh_flags = SHF_EXECINSTR | SHF_ALLOC; module_frob_arch_sections()
176 mod->arch.init_plt->sh_addralign = L1_CACHE_BYTES; module_frob_arch_sections()
177 mod->arch.init_plt->sh_size = round_up(init_plts * PLT_ENT_SIZE, module_frob_arch_sections()
179 mod->arch.init_plt_count = 0; module_frob_arch_sections()
181 mod->arch.core_plt->sh_size, mod->arch.init_plt->sh_size); module_frob_arch_sections()
132 module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) module_frob_arch_sections() argument
H A Dmodule.c324 struct module *mod) module_finalize()
365 mod->arch.unwind[i] = module_finalize()
387 module_arch_cleanup(struct module *mod) module_arch_cleanup() argument
393 if (mod->arch.unwind[i]) module_arch_cleanup()
394 unwind_table_del(mod->arch.unwind[i]); module_arch_cleanup()
323 module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) module_finalize() argument
/linux-4.4.14/arch/ia64/kernel/
H A Dmodule.c154 apply_imm64 (struct module *mod, struct insn *insn, uint64_t val) apply_imm64() argument
158 mod->name, slot(insn)); apply_imm64()
166 apply_imm60 (struct module *mod, struct insn *insn, uint64_t val) apply_imm60() argument
170 mod->name, slot(insn)); apply_imm60()
175 mod->name, (long) val); apply_imm60()
183 apply_imm22 (struct module *mod, struct insn *insn, uint64_t val) apply_imm22() argument
187 mod->name, (long)val); apply_imm22()
198 apply_imm21b (struct module *mod, struct insn *insn, uint64_t val) apply_imm21b() argument
202 mod->name, (long)val); apply_imm21b()
233 patch_plt (struct module *mod, struct plt_entry *plt, long target_ip, unsigned long target_gp) patch_plt() argument
235 if (apply_imm64(mod, (struct insn *) (plt->bundle[0] + 2), target_gp) patch_plt()
236 && apply_imm60(mod, (struct insn *) (plt->bundle[1] + 2), patch_plt()
283 patch_plt (struct module *mod, struct plt_entry *plt, long target_ip, unsigned long target_gp) patch_plt() argument
285 if (apply_imm64(mod, (struct insn *) (plt->bundle[0] + 2), target_ip) patch_plt()
286 && apply_imm64(mod, (struct insn *) (plt->bundle[1] + 2), target_gp)) patch_plt()
308 module_arch_freeing_init (struct module *mod) module_arch_freeing_init() argument
310 if (mod->arch.init_unw_table) { module_arch_freeing_init()
311 unw_remove_unwind_table(mod->arch.init_unw_table); module_arch_freeing_init()
312 mod->arch.init_unw_table = NULL; module_arch_freeing_init()
422 struct module *mod) module_frob_arch_sections()
433 mod->arch.core_plt = s; module_frob_arch_sections()
435 mod->arch.init_plt = s; module_frob_arch_sections()
437 mod->arch.got = s; module_frob_arch_sections()
439 mod->arch.opd = s; module_frob_arch_sections()
441 mod->arch.unwind = s; module_frob_arch_sections()
443 if (!mod->arch.core_plt || !mod->arch.init_plt || !mod->arch.got || !mod->arch.opd) { module_frob_arch_sections()
444 printk(KERN_ERR "%s: sections missing\n", mod->name); module_frob_arch_sections()
464 mod->arch.core_plt->sh_type = SHT_NOBITS; module_frob_arch_sections()
465 mod->arch.core_plt->sh_flags = SHF_EXECINSTR | SHF_ALLOC; module_frob_arch_sections()
466 mod->arch.core_plt->sh_addralign = 16; module_frob_arch_sections()
467 mod->arch.core_plt->sh_size = core_plts * sizeof(struct plt_entry); module_frob_arch_sections()
468 mod->arch.init_plt->sh_type = SHT_NOBITS; module_frob_arch_sections()
469 mod->arch.init_plt->sh_flags = SHF_EXECINSTR | SHF_ALLOC; module_frob_arch_sections()
470 mod->arch.init_plt->sh_addralign = 16; module_frob_arch_sections()
471 mod->arch.init_plt->sh_size = init_plts * sizeof(struct plt_entry); module_frob_arch_sections()
472 mod->arch.got->sh_type = SHT_NOBITS; module_frob_arch_sections()
473 mod->arch.got->sh_flags = ARCH_SHF_SMALL | SHF_ALLOC; module_frob_arch_sections()
474 mod->arch.got->sh_addralign = 8; module_frob_arch_sections()
475 mod->arch.got->sh_size = gots * sizeof(struct got_entry); module_frob_arch_sections()
476 mod->arch.opd->sh_type = SHT_NOBITS; module_frob_arch_sections()
477 mod->arch.opd->sh_flags = SHF_ALLOC; module_frob_arch_sections()
478 mod->arch.opd->sh_addralign = 8; module_frob_arch_sections()
479 mod->arch.opd->sh_size = fdescs * sizeof(struct fdesc); module_frob_arch_sections()
481 __func__, mod->arch.core_plt->sh_size, mod->arch.init_plt->sh_size, module_frob_arch_sections()
482 mod->arch.got->sh_size, mod->arch.opd->sh_size); module_frob_arch_sections()
487 in_init (const struct module *mod, uint64_t addr) in_init() argument
489 return addr - (uint64_t) mod->module_init < mod->init_size; in_init()
493 in_core (const struct module *mod, uint64_t addr) in_core() argument
495 return addr - (uint64_t) mod->module_core < mod->core_size; in_core()
499 is_internal (const struct module *mod, uint64_t value) is_internal() argument
501 return in_init(mod, value) || in_core(mod, value); is_internal()
508 get_ltoff (struct module *mod, uint64_t value, int *okp) get_ltoff() argument
515 got = (void *) mod->arch.got->sh_addr; get_ltoff()
516 for (e = got; e < got + mod->arch.next_got_entry; ++e) get_ltoff()
521 BUG_ON(e >= (struct got_entry *) (mod->arch.got->sh_addr + mod->arch.got->sh_size)); get_ltoff()
524 ++mod->arch.next_got_entry; get_ltoff()
526 return (uint64_t) e - mod->arch.gp; get_ltoff()
530 gp_addressable (struct module *mod, uint64_t value) gp_addressable() argument
532 return value - mod->arch.gp + MAX_LTOFF/2 < MAX_LTOFF; gp_addressable()
537 get_plt (struct module *mod, const struct insn *insn, uint64_t value, int *okp) get_plt() argument
545 if (in_init(mod, (uint64_t) insn)) { get_plt()
546 plt = (void *) mod->arch.init_plt->sh_addr; get_plt()
547 plt_end = (void *) plt + mod->arch.init_plt->sh_size; get_plt()
549 plt = (void *) mod->arch.core_plt->sh_addr; get_plt()
550 plt_end = (void *) plt + mod->arch.core_plt->sh_size; get_plt()
565 if (!patch_plt(mod, plt, target_ip, target_gp)) { get_plt()
583 get_fdesc (struct module *mod, uint64_t value, int *okp) get_fdesc() argument
585 struct fdesc *fdesc = (void *) mod->arch.opd->sh_addr; get_fdesc()
591 printk(KERN_ERR "%s: fdesc for zero requested!\n", mod->name); get_fdesc()
595 if (!is_internal(mod, value)) get_fdesc()
606 if ((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size) get_fdesc()
612 fdesc->gp = mod->arch.gp; get_fdesc()
617 do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend, do_reloc() argument
632 case RV_GPREL: val -= mod->arch.gp; break; do_reloc()
633 case RV_LTREL: val = get_ltoff(mod, val, &ok); break; do_reloc()
634 case RV_PLTREL: val = get_plt(mod, location, val, &ok); break; do_reloc()
635 case RV_FPTR: val = get_fdesc(mod, val, &ok); break; do_reloc()
637 case RV_LTREL_FPTR: val = get_ltoff(mod, get_fdesc(mod, val, &ok), &ok); break; do_reloc()
642 if ((in_init(mod, val) && in_core(mod, (uint64_t)location)) || do_reloc()
643 (in_core(mod, val) && in_init(mod, (uint64_t)location))) { do_reloc()
650 val = get_fdesc(mod, val, &ok); do_reloc()
651 val = get_plt(mod, location, val, &ok); do_reloc()
653 } else if (!is_internal(mod, val)) do_reloc()
654 val = get_plt(mod, location, val, &ok); do_reloc()
678 val -= (uint64_t) (in_init(mod, val) ? mod->module_init : mod->module_core); do_reloc()
688 if (!is_internal(mod, val)) { do_reloc()
703 val = get_fdesc(mod, get_plt(mod, location, val, &ok), &ok); do_reloc()
715 if (gp_addressable(mod, val)) do_reloc()
716 val -= mod->arch.gp; do_reloc()
718 val = get_ltoff(mod, val, &ok); do_reloc()
723 if (gp_addressable(mod, val)) { do_reloc()
733 mod->name, reloc_name[r_type]); do_reloc()
736 mod->name, r_type); do_reloc()
748 mod->name, reloc_name[r_type] ? reloc_name[r_type] : "?"); do_reloc()
752 printk(KERN_ERR "%s: unknown reloc %x\n", mod->name, r_type); do_reloc()
763 case RF_INSN21B: ok = apply_imm21b(mod, location, (int64_t) val / 16); break; do_reloc()
764 case RF_INSN22: ok = apply_imm22(mod, location, val); break; do_reloc()
765 case RF_INSN64: ok = apply_imm64(mod, location, val); break; do_reloc()
766 case RF_INSN60: ok = apply_imm60(mod, location, (int64_t) val / 16); break; do_reloc()
775 mod->name, format, reloc_name[r_type] ? reloc_name[r_type] : "?"); do_reloc()
780 mod->name, reloc_name[r_type] ? reloc_name[r_type] : "?", format); do_reloc()
788 unsigned int relsec, struct module *mod) apply_relocate_add()
807 if (!mod->arch.gp) { apply_relocate_add()
813 if (mod->core_size > MAX_LTOFF) apply_relocate_add()
818 gp = mod->core_size - MAX_LTOFF / 2; apply_relocate_add()
820 gp = mod->core_size / 2; apply_relocate_add()
821 gp = (uint64_t) mod->module_core + ((gp + 7) & -8); apply_relocate_add()
822 mod->arch.gp = gp; apply_relocate_add()
827 ret = do_reloc(mod, ELF64_R_TYPE(rela[i].r_info), apply_relocate_add()
845 register_unwind_table (struct module *mod) register_unwind_table() argument
847 struct unw_table_entry *start = (void *) mod->arch.unwind->sh_addr; register_unwind_table()
848 struct unw_table_entry *end = start + mod->arch.unwind->sh_size / sizeof (*start); register_unwind_table()
854 if (in_init(mod, e1->start_offset)) register_unwind_table()
875 if (in_init(mod, start->start_offset)) { register_unwind_table()
884 mod->name, mod->arch.gp, num_init, num_core); register_unwind_table()
890 mod->arch.core_unw_table = unw_add_unwind_table(mod->name, 0, mod->arch.gp, register_unwind_table()
893 mod->arch.core_unw_table, core, core + num_core); register_unwind_table()
896 mod->arch.init_unw_table = unw_add_unwind_table(mod->name, 0, mod->arch.gp, register_unwind_table()
899 mod->arch.init_unw_table, init, init + num_init); register_unwind_table()
904 module_finalize (const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) module_finalize() argument
906 DEBUGP("%s: init: entry=%p\n", __func__, mod->init); module_finalize()
907 if (mod->arch.unwind) module_finalize()
908 register_unwind_table(mod); module_finalize()
913 module_arch_cleanup (struct module *mod) module_arch_cleanup() argument
915 if (mod->arch.init_unw_table) module_arch_cleanup()
916 unw_remove_unwind_table(mod->arch.init_unw_table); module_arch_cleanup()
917 if (mod->arch.core_unw_table) module_arch_cleanup()
918 unw_remove_unwind_table(mod->arch.core_unw_table); module_arch_cleanup()
421 module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) module_frob_arch_sections() argument
787 apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, unsigned int symindex, unsigned int relsec, struct module *mod) apply_relocate_add() argument
/linux-4.4.14/drivers/usb/renesas_usbhs/
H A DMakefile7 renesas_usbhs-y := common.o mod.o pipe.o fifo.o rcar2.o
H A Dmod.c20 #include "mod.h"
75 void usbhs_mod_register(struct usbhs_priv *priv, struct usbhs_mod *mod, int id) usbhs_mod_register() argument
79 info->mod[id] = mod; usbhs_mod_register()
80 mod->priv = priv; usbhs_mod_register()
91 ret = info->mod[id]; usbhs_mod_get()
100 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhs_mod_is_host() local
103 if (!mod) usbhs_mod_is_host()
106 return info->mod[USBHS_HOST] == mod; usbhs_mod_is_host()
119 struct usbhs_mod *mod = NULL; usbhs_mod_change() local
126 mod = info->mod[id]; usbhs_mod_change()
131 info->curt = mod; usbhs_mod_change()
214 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhs_status_get_each_irq() local
231 if (mod) { usbhs_status_get_each_irq()
236 state->bempsts &= mod->irq_bempsts; usbhs_status_get_each_irq()
237 state->brdysts &= mod->irq_brdysts; usbhs_status_get_each_irq()
328 void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod) usbhs_irq_callback_update() argument
356 * but "mod->irq_dev_state" will be called. usbhs_irq_callback_update()
361 if (mod) { usbhs_irq_callback_update()
365 if (mod->irq_ctrl_stage) usbhs_irq_callback_update()
368 if (mod->irq_empty && mod->irq_bempsts) { usbhs_irq_callback_update()
369 usbhs_write(priv, BEMPENB, mod->irq_bempsts); usbhs_irq_callback_update()
373 if (mod->irq_ready && mod->irq_brdysts) { usbhs_irq_callback_update()
374 usbhs_write(priv, BRDYENB, mod->irq_brdysts); usbhs_irq_callback_update()
382 if (mod->irq_attch) usbhs_irq_callback_update()
385 if (mod->irq_dtch) usbhs_irq_callback_update()
388 if (mod->irq_sign) usbhs_irq_callback_update()
391 if (mod->irq_sack) usbhs_irq_callback_update()
H A Dmod.h90 struct usbhs_mod *mod[USBHS_MAX]; member in struct:usbhs_mod_info
91 struct usbhs_mod *curt; /* current mod */
129 void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod);
134 struct usbhs_mod *mod; \
135 mod = usbhs_mod_get_current(priv); \
136 !mod ? -ENODEV : \
137 !mod->func ? 0 : \
138 mod->func(param); \
H A Dmod_gadget.c48 struct usbhs_mod mod; member in struct:usbhsg_gpriv
81 struct usbhsg_gpriv, mod)
101 #define usbhsg_gpriv_to_dev(gp) usbhs_priv_to_dev((gp)->mod.priv)
102 #define usbhsg_gpriv_to_priv(gp) ((gp)->mod.priv)
788 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhsg_try_start() local
836 mod->irq_dev_state = usbhsg_irq_dev_state; usbhsg_try_start()
837 mod->irq_ctrl_stage = usbhsg_irq_ctrl_stage; usbhsg_try_start()
838 usbhs_irq_callback_update(priv, mod); usbhsg_try_start()
846 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhsg_try_stop() local
872 mod->irq_dev_state = NULL; usbhsg_try_stop()
873 mod->irq_ctrl_stage = NULL; usbhsg_try_stop()
874 usbhs_irq_callback_update(priv, mod); usbhsg_try_stop()
1081 usbhs_mod_register(priv, &gpriv->mod, USBHS_GADGET); usbhs_mod_gadget_probe()
1084 gpriv->mod.name = "gadget"; usbhs_mod_gadget_probe()
1085 gpriv->mod.start = usbhsg_start; usbhs_mod_gadget_probe()
1086 gpriv->mod.stop = usbhsg_stop; usbhs_mod_gadget_probe()
H A Dmod_host.c94 struct usbhs_mod mod; member in struct:usbhsh_hpriv
111 container_of(usbhs_mod_get(priv, USBHS_HOST), struct usbhsh_hpriv, mod)
127 #define usbhsh_hpriv_to_priv(h) ((h)->mod.priv)
201 * by checking mod.irq_attch usbhsh_is_running()
206 return (hpriv->mod.irq_attch == NULL); usbhsh_is_running()
1346 hpriv->mod.irq_attch = NULL; usbhsh_irq_attch()
1347 usbhs_irq_callback_update(priv, &hpriv->mod); usbhsh_irq_attch()
1372 hpriv->mod.irq_attch = usbhsh_irq_attch; usbhsh_irq_dtch()
1373 usbhs_irq_callback_update(priv, &hpriv->mod); usbhsh_irq_dtch()
1465 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhsh_start() local
1494 mod->irq_attch = usbhsh_irq_attch; usbhsh_start()
1495 mod->irq_dtch = usbhsh_irq_dtch; usbhsh_start()
1496 mod->irq_sack = usbhsh_irq_setup_ack; usbhsh_start()
1497 mod->irq_sign = usbhsh_irq_setup_err; usbhsh_start()
1498 usbhs_irq_callback_update(priv, mod); usbhsh_start()
1509 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhsh_stop() local
1515 mod->irq_attch = NULL; usbhsh_stop()
1516 mod->irq_dtch = NULL; usbhsh_stop()
1517 mod->irq_sack = NULL; usbhsh_stop()
1518 mod->irq_sign = NULL; usbhsh_stop()
1519 usbhs_irq_callback_update(priv, mod); usbhsh_stop()
1560 usbhs_mod_register(priv, &hpriv->mod, USBHS_HOST); usbhs_mod_host_probe()
1563 hpriv->mod.name = "host"; usbhs_mod_host_probe()
1564 hpriv->mod.start = usbhsh_start; usbhs_mod_host_probe()
1565 hpriv->mod.stop = usbhsh_stop; usbhs_mod_host_probe()
H A Dcommon.c34 * mod.c
373 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhsc_hotplug() local
389 if (enable && !mod) { usbhsc_hotplug()
417 } else if (!enable && mod) { usbhsc_hotplug()
718 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhsc_suspend() local
720 if (mod) { usbhsc_suspend()
725 if (mod || !usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL)) usbhsc_suspend()
H A Dfifo.c224 struct usbhs_mod *mod = usbhs_mod_get_current(priv); \
226 if (!mod) \
229 mod->status |= status; \
231 mod->status &= ~status; \
232 usbhs_irq_callback_update(priv, mod); \
1377 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhs_fifo_init() local
1382 mod->irq_empty = usbhsf_irq_empty; usbhs_fifo_init()
1383 mod->irq_ready = usbhsf_irq_ready; usbhs_fifo_init()
1384 mod->irq_bempsts = 0; usbhs_fifo_init()
1385 mod->irq_brdysts = 0; usbhs_fifo_init()
1394 struct usbhs_mod *mod = usbhs_mod_get_current(priv); usbhs_fifo_quit() local
1396 mod->irq_empty = NULL; usbhs_fifo_quit()
1397 mod->irq_ready = NULL; usbhs_fifo_quit()
1398 mod->irq_bempsts = 0; usbhs_fifo_quit()
1399 mod->irq_brdysts = 0; usbhs_fifo_quit()
/linux-4.4.14/net/9p/
H A DMakefile6 mod.o \
/linux-4.4.14/tools/power/cpupower/debug/kernel/
H A DMakefile15 - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c
/linux-4.4.14/include/linux/
H A Dmoduleloader.h19 struct module *mod);
22 unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section);
40 struct module *mod);
63 struct module *mod);
80 struct module *mod);
83 void module_arch_cleanup(struct module *mod);
85 /* Any cleanup before freeing mod->module_init */
86 void module_arch_freeing_init(struct module *mod);
H A Dkmod.h37 #define request_module(mod...) __request_module(true, mod)
38 #define request_module_nowait(mod...) __request_module(false, mod)
39 #define try_then_request_module(x, mod...) \
40 ((x) ?: (__request_module(true, mod), (x)))
44 #define try_then_request_module(x, mod...) (x) request_module_nowait()
H A Dmodule.h43 struct module *mod; member in struct:module_kobject
301 struct module *mod; member in struct:mod_tree_node
380 * init_text_size, core_text_size and mtn_core::{mod,node[0]}
396 * We want mtn_core::{mod,node[0]} to be in the same cacheline as the
495 static inline int module_is_live(struct module *mod) module_is_live() argument
497 return mod->state != MODULE_STATE_GOING; module_is_live()
507 const struct module *mod) within_module_core()
509 return (unsigned long)mod->module_core <= addr && within_module_core()
510 addr < (unsigned long)mod->module_core + mod->core_size; within_module_core()
514 const struct module *mod) within_module_init()
516 return (unsigned long)mod->module_init <= addr && within_module_init()
517 addr < (unsigned long)mod->module_init + mod->init_size; within_module_init()
520 static inline bool within_module(unsigned long addr, const struct module *mod) within_module() argument
522 return within_module_init(addr, mod) || within_module_core(addr, mod); within_module()
571 extern void __module_put_and_exit(struct module *mod, long code)
576 int module_refcount(struct module *mod);
609 #define module_name(mod) \
611 struct module *__mod = (mod); \
691 #define module_name(mod) "kernel"
786 struct module *mod) module_bug_finalize()
789 static inline void module_bug_cleanup(struct module *mod) {} module_bug_cleanup() argument
506 within_module_core(unsigned long addr, const struct module *mod) within_module_core() argument
513 within_module_init(unsigned long addr, const struct module *mod) within_module_init() argument
784 module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) module_bug_finalize() argument
H A Dlivepatch.h91 * @mod: kernel module associated with the patched object
103 struct module *mod; member in struct:klp_object
109 * @mod: reference to the live patch module
117 struct module *mod; member in struct:klp_patch
H A Dmoduleparam.h70 struct module *mod; member in struct:kernel_param
243 extern void kernel_param_lock(struct module *mod);
244 extern void kernel_param_unlock(struct module *mod);
246 static inline void kernel_param_lock(struct module *mod) kernel_param_lock() argument
249 static inline void kernel_param_unlock(struct module *mod) kernel_param_unlock() argument
465 extern int module_param_sysfs_setup(struct module *mod,
469 extern void module_param_sysfs_remove(struct module *mod);
471 static inline int module_param_sysfs_setup(struct module *mod, module_param_sysfs_setup() argument
478 static inline void module_param_sysfs_remove(struct module *mod) module_param_sysfs_remove() argument
H A Dccp.h284 * @mod: RSA modulus
291 * - key_size, exp, exp_len, mod, mod_len, src, dst, src_len
299 struct scatterlist *mod; member in struct:ccp_rsa_engine
457 * @mod: ECC modulus
464 * - function, mod, mod_len
471 struct scatterlist *mod; member in struct:ccp_ecc_engine
H A Ddynamic_debug.h114 static inline int ddebug_remove_module(const char *mod) ddebug_remove_module() argument
H A Dhighuid.h45 /* prevent uid mod 65536 effect by returning a default value for high UIDs */
H A Dioc3.h52 spinlock_t ir_lock; /* SIO_IE[SC] mod lock */
/linux-4.4.14/drivers/usb/gadget/
H A Dfunctions.c23 if (!try_module_get(fd->mod)) { try_get_usb_function_instance()
29 module_put(fd->mod); try_get_usb_function_instance()
70 struct module *mod; usb_put_function_instance() local
75 mod = fi->fd->mod; usb_put_function_instance()
77 module_put(mod); usb_put_function_instance()
/linux-4.4.14/arch/blackfin/kernel/
H A Dmodule.c7 #define pr_fmt(fmt) "module %s: " fmt, mod->name
22 char *secstrings, struct module *mod) module_frob_arch_sections()
28 * in mod->arch to correctly free L1 I/D sram later. module_frob_arch_sections()
29 * NOTE: this breaks the semantic of mod->arch structure. module_frob_arch_sections()
45 mod->arch.text_l1 = dest; module_frob_arch_sections()
57 mod->arch.data_a_l1 = dest; module_frob_arch_sections()
69 mod->arch.bss_a_l1 = dest; module_frob_arch_sections()
78 mod->arch.data_b_l1 = dest; module_frob_arch_sections()
88 mod->arch.bss_b_l1 = dest; module_frob_arch_sections()
100 mod->arch.text_l2 = dest; module_frob_arch_sections()
112 mod->arch.data_l2 = dest; module_frob_arch_sections()
124 mod->arch.bss_l2 = dest; module_frob_arch_sections()
153 struct module *mod) apply_relocate_add()
235 const Elf_Shdr * sechdrs, struct module *mod) module_finalize()
270 symindex, i, mod); module_finalize()
279 void module_arch_cleanup(struct module *mod) module_arch_cleanup() argument
281 l1_inst_sram_free(mod->arch.text_l1); module_arch_cleanup()
282 l1_data_A_sram_free(mod->arch.data_a_l1); module_arch_cleanup()
283 l1_data_A_sram_free(mod->arch.bss_a_l1); module_arch_cleanup()
284 l1_data_B_sram_free(mod->arch.data_b_l1); module_arch_cleanup()
285 l1_data_B_sram_free(mod->arch.bss_b_l1); module_arch_cleanup()
286 l2_sram_free(mod->arch.text_l2); module_arch_cleanup()
287 l2_sram_free(mod->arch.data_l2); module_arch_cleanup()
288 l2_sram_free(mod->arch.bss_l2); module_arch_cleanup()
21 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) module_frob_arch_sections() argument
151 apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, unsigned int symindex, unsigned int relsec, struct module *mod) apply_relocate_add() argument
234 module_finalize(const Elf_Ehdr * hdr, const Elf_Shdr * sechdrs, struct module *mod) module_finalize() argument
H A Dbfin_dma.c485 s16 mod; _dma_memcpy() local
507 mod = 1 << shift; _dma_memcpy()
509 mod *= -1; _dma_memcpy()
510 dst += size + mod; _dma_memcpy()
511 src += size + mod; _dma_memcpy()
520 __dma_memcpy(dst, mod, src, mod, size, conf); _dma_memcpy()
H A Dftrace.c41 int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, ftrace_make_nop() argument
/linux-4.4.14/net/can/
H A Dgw.c102 struct cf_mod *mod);
136 struct cf_mod mod; member in struct:cgw_job
157 struct cf_mod *mod) { op ; }
159 MODFUNC(mod_and_id, cf->can_id &= mod->modframe.and.can_id)
160 MODFUNC(mod_and_dlc, cf->can_dlc &= mod->modframe.and.can_dlc)
161 MODFUNC(mod_and_data, *(u64 *)cf->data &= *(u64 *)mod->modframe.and.data)
162 MODFUNC(mod_or_id, cf->can_id |= mod->modframe.or.can_id)
163 MODFUNC(mod_or_dlc, cf->can_dlc |= mod->modframe.or.can_dlc)
164 MODFUNC(mod_or_data, *(u64 *)cf->data |= *(u64 *)mod->modframe.or.data)
165 MODFUNC(mod_xor_id, cf->can_id ^= mod->modframe.xor.can_id)
166 MODFUNC(mod_xor_dlc, cf->can_dlc ^= mod->modframe.xor.can_dlc)
167 MODFUNC(mod_xor_data, *(u64 *)cf->data ^= *(u64 *)mod->modframe.xor.data)
168 MODFUNC(mod_set_id, cf->can_id = mod->modframe.set.can_id)
169 MODFUNC(mod_set_dlc, cf->can_dlc = mod->modframe.set.can_dlc)
170 MODFUNC(mod_set_data, *(u64 *)cf->data = *(u64 *)mod->modframe.set.data)
395 if (gwj->mod.modfunc[0]) can_can_gw_rcv()
418 while (modidx < MAX_MODFUNCTIONS && gwj->mod.modfunc[modidx]) can_can_gw_rcv()
419 (*gwj->mod.modfunc[modidx++])(cf, &gwj->mod); can_can_gw_rcv()
423 if (gwj->mod.csumfunc.crc8) can_can_gw_rcv()
424 (*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8); can_can_gw_rcv()
426 if (gwj->mod.csumfunc.xor) can_can_gw_rcv()
427 (*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor); can_can_gw_rcv()
524 if (gwj->mod.modtype.and) { cgw_put_job()
525 memcpy(&mb.cf, &gwj->mod.modframe.and, sizeof(mb.cf)); cgw_put_job()
526 mb.modtype = gwj->mod.modtype.and; cgw_put_job()
531 if (gwj->mod.modtype.or) { cgw_put_job()
532 memcpy(&mb.cf, &gwj->mod.modframe.or, sizeof(mb.cf)); cgw_put_job()
533 mb.modtype = gwj->mod.modtype.or; cgw_put_job()
538 if (gwj->mod.modtype.xor) { cgw_put_job()
539 memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf)); cgw_put_job()
540 mb.modtype = gwj->mod.modtype.xor; cgw_put_job()
545 if (gwj->mod.modtype.set) { cgw_put_job()
546 memcpy(&mb.cf, &gwj->mod.modframe.set, sizeof(mb.cf)); cgw_put_job()
547 mb.modtype = gwj->mod.modtype.set; cgw_put_job()
552 if (gwj->mod.uid) { cgw_put_job()
553 if (nla_put_u32(skb, CGW_MOD_UID, gwj->mod.uid) < 0) cgw_put_job()
557 if (gwj->mod.csumfunc.crc8) { cgw_put_job()
559 &gwj->mod.csum.crc8) < 0) cgw_put_job()
563 if (gwj->mod.csumfunc.xor) { cgw_put_job()
565 &gwj->mod.csum.xor) < 0) cgw_put_job()
632 static int cgw_parse_attr(struct nlmsghdr *nlh, struct cf_mod *mod, cgw_parse_attr() argument
641 memset(mod, 0, sizeof(*mod)); cgw_parse_attr()
660 canframecpy(&mod->modframe.and, &mb.cf); cgw_parse_attr()
661 mod->modtype.and = mb.modtype; cgw_parse_attr()
664 mod->modfunc[modidx++] = mod_and_id; cgw_parse_attr()
667 mod->modfunc[modidx++] = mod_and_dlc; cgw_parse_attr()
670 mod->modfunc[modidx++] = mod_and_data; cgw_parse_attr()
676 canframecpy(&mod->modframe.or, &mb.cf); cgw_parse_attr()
677 mod->modtype.or = mb.modtype; cgw_parse_attr()
680 mod->modfunc[modidx++] = mod_or_id; cgw_parse_attr()
683 mod->modfunc[modidx++] = mod_or_dlc; cgw_parse_attr()
686 mod->modfunc[modidx++] = mod_or_data; cgw_parse_attr()
692 canframecpy(&mod->modframe.xor, &mb.cf); cgw_parse_attr()
693 mod->modtype.xor = mb.modtype; cgw_parse_attr()
696 mod->modfunc[modidx++] = mod_xor_id; cgw_parse_attr()
699 mod->modfunc[modidx++] = mod_xor_dlc; cgw_parse_attr()
702 mod->modfunc[modidx++] = mod_xor_data; cgw_parse_attr()
708 canframecpy(&mod->modframe.set, &mb.cf); cgw_parse_attr()
709 mod->modtype.set = mb.modtype; cgw_parse_attr()
712 mod->modfunc[modidx++] = mod_set_id; cgw_parse_attr()
715 mod->modfunc[modidx++] = mod_set_dlc; cgw_parse_attr()
718 mod->modfunc[modidx++] = mod_set_data; cgw_parse_attr()
732 nla_memcpy(&mod->csum.crc8, tb[CGW_CS_CRC8], cgw_parse_attr()
741 mod->csumfunc.crc8 = cgw_csum_crc8_rel; cgw_parse_attr()
743 mod->csumfunc.crc8 = cgw_csum_crc8_pos; cgw_parse_attr()
745 mod->csumfunc.crc8 = cgw_csum_crc8_neg; cgw_parse_attr()
756 nla_memcpy(&mod->csum.xor, tb[CGW_CS_XOR], cgw_parse_attr()
765 mod->csumfunc.xor = cgw_csum_xor_rel; cgw_parse_attr()
767 mod->csumfunc.xor = cgw_csum_xor_pos; cgw_parse_attr()
769 mod->csumfunc.xor = cgw_csum_xor_neg; cgw_parse_attr()
773 nla_memcpy(&mod->uid, tb[CGW_MOD_UID], sizeof(u32)); cgw_parse_attr()
816 struct cf_mod mod; cgw_create_job() local
835 err = cgw_parse_attr(nlh, &mod, CGW_TYPE_CAN_CAN, &ccgw, &limhops); cgw_create_job()
839 if (mod.uid) { cgw_create_job()
846 if (gwj->mod.uid != mod.uid) cgw_create_job()
855 memcpy(&gwj->mod, &mod, sizeof(mod)); cgw_create_job()
877 memcpy(&gwj->mod, &mod, sizeof(mod)); cgw_create_job()
929 struct cf_mod mod; cgw_remove_job() local
948 err = cgw_parse_attr(nlh, &mod, CGW_TYPE_CAN_CAN, &ccgw, &limhops); cgw_remove_job()
972 if (gwj->mod.uid || mod.uid) { cgw_remove_job()
973 if (gwj->mod.uid != mod.uid) cgw_remove_job()
977 if (memcmp(&gwj->mod, &mod, sizeof(mod))) cgw_remove_job()
/linux-4.4.14/drivers/gpu/drm/tilcdc/
H A Dtilcdc_tfp410.c52 struct tfp410_module *mod; member in struct:tfp410_encoder
74 gpio_direction_output(tfp410_encoder->mod->gpio, 1); tfp410_encoder_dpms()
77 gpio_direction_output(tfp410_encoder->mod->gpio, 0); tfp410_encoder_dpms()
122 struct tfp410_module *mod) tfp410_encoder_create()
135 tfp410_encoder->mod = mod; tfp410_encoder_create()
162 struct tfp410_module *mod; member in struct:tfp410_connector
181 if (drm_probe_ddc(tfp410_connector->mod->i2c)) tfp410_connector_detect()
193 edid = drm_get_edid(connector, tfp410_connector->mod->i2c); tfp410_connector_get_modes()
234 struct tfp410_module *mod, struct drm_encoder *encoder) tfp410_connector_create()
247 tfp410_connector->mod = mod; tfp410_connector_create()
278 static int tfp410_modeset_init(struct tilcdc_module *mod, struct drm_device *dev) tfp410_modeset_init() argument
280 struct tfp410_module *tfp410_mod = to_tfp410_module(mod); tfp410_modeset_init()
314 struct tilcdc_module *mod; tfp410_probe() local
329 mod = &tfp410_mod->base; tfp410_probe()
330 pdev->dev.platform_data = mod; tfp410_probe()
332 tilcdc_module_init(mod, "tfp410", &tfp410_module_ops); tfp410_probe()
343 mod->preferred_bpp = dvi_info.bpp; tfp410_probe()
379 tilcdc_module_cleanup(mod); tfp410_probe()
385 struct tilcdc_module *mod = dev_get_platdata(&pdev->dev); tfp410_remove() local
386 struct tfp410_module *tfp410_mod = to_tfp410_module(mod); tfp410_remove()
391 tilcdc_module_cleanup(mod); tfp410_remove()
121 tfp410_encoder_create(struct drm_device *dev, struct tfp410_module *mod) tfp410_encoder_create() argument
233 tfp410_connector_create(struct drm_device *dev, struct tfp410_module *mod, struct drm_encoder *encoder) tfp410_connector_create() argument
H A Dtilcdc_panel.c44 struct panel_module *mod; member in struct:panel_encoder
59 struct backlight_device *backlight = panel_encoder->mod->backlight; panel_encoder_dpms()
60 struct gpio_desc *gpio = panel_encoder->mod->enable_gpio; panel_encoder_dpms()
85 tilcdc_crtc_set_panel_info(encoder->crtc, panel_encoder->mod->info); panel_encoder_prepare()
113 struct panel_module *mod) panel_encoder_create()
125 panel_encoder->mod = mod; panel_encoder_create()
152 struct panel_module *mod; member in struct:panel_connector
176 struct display_timings *timings = panel_connector->mod->timings; panel_connector_get_modes()
229 struct panel_module *mod, struct drm_encoder *encoder) panel_connector_create()
242 panel_connector->mod = mod; panel_connector_create()
270 static int panel_modeset_init(struct tilcdc_module *mod, struct drm_device *dev) panel_modeset_init() argument
272 struct panel_module *panel_mod = to_panel_module(mod); panel_modeset_init()
353 struct tilcdc_module *mod; panel_probe() local
389 mod = &panel_mod->base; panel_probe()
390 pdev->dev.platform_data = mod; panel_probe()
392 tilcdc_module_init(mod, "panel", &panel_module_ops); panel_probe()
412 mod->preferred_bpp = panel_mod->info->bpp; panel_probe()
420 tilcdc_module_cleanup(mod); panel_probe()
430 struct tilcdc_module *mod = dev_get_platdata(&pdev->dev); panel_remove() local
431 struct panel_module *panel_mod = to_panel_module(mod); panel_remove()
439 tilcdc_module_cleanup(mod); panel_remove()
112 panel_encoder_create(struct drm_device *dev, struct panel_module *mod) panel_encoder_create() argument
228 panel_connector_create(struct drm_device *dev, struct panel_module *mod, struct drm_encoder *encoder) panel_connector_create() argument
H A Dtilcdc_drv.c32 void tilcdc_module_init(struct tilcdc_module *mod, const char *name, tilcdc_module_init() argument
35 mod->name = name; tilcdc_module_init()
36 mod->funcs = funcs; tilcdc_module_init()
37 INIT_LIST_HEAD(&mod->list); tilcdc_module_init()
38 list_add(&mod->list, &module_list); tilcdc_module_init()
41 void tilcdc_module_cleanup(struct tilcdc_module *mod) tilcdc_module_cleanup() argument
43 list_del(&mod->list); tilcdc_module_cleanup()
68 struct tilcdc_module *mod; modeset_init() local
74 list_for_each_entry(mod, &module_list, list) { modeset_init()
75 DBG("loading module: %s", mod->name); modeset_init()
76 mod->funcs->modeset_init(mod, dev); modeset_init()
152 struct tilcdc_module *mod; tilcdc_load() local
290 list_for_each_entry(mod, &module_list, list) { tilcdc_load()
291 DBG("%s: preferred_bpp: %d", mod->name, mod->preferred_bpp); tilcdc_load()
292 bpp = mod->preferred_bpp; tilcdc_load()
510 struct tilcdc_module *mod; tilcdc_debugfs_init() local
517 list_for_each_entry(mod, &module_list, list) tilcdc_debugfs_init()
518 if (mod->funcs->debugfs_init) tilcdc_debugfs_init()
519 mod->funcs->debugfs_init(mod, minor); tilcdc_debugfs_init()
531 struct tilcdc_module *mod; tilcdc_debugfs_cleanup() local
535 list_for_each_entry(mod, &module_list, list) tilcdc_debugfs_cleanup()
536 if (mod->funcs->debugfs_cleanup) tilcdc_debugfs_cleanup()
537 mod->funcs->debugfs_cleanup(mod, minor); tilcdc_debugfs_cleanup()
H A Dtilcdc_drv.h103 int (*modeset_init)(struct tilcdc_module *mod, struct drm_device *dev);
106 int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor);
108 void (*debugfs_cleanup)(struct tilcdc_module *mod, struct drm_minor *minor);
119 void tilcdc_module_init(struct tilcdc_module *mod, const char *name,
121 void tilcdc_module_cleanup(struct tilcdc_module *mod);
/linux-4.4.14/lib/
H A Dbug.c66 struct module *mod; module_find_bug() local
70 list_for_each_entry_rcu(mod, &module_bug_list, bug_list) { module_find_bug()
73 bug = mod->bug_table; module_find_bug()
74 for (i = 0; i < mod->num_bugs; ++i, ++bug) module_find_bug()
86 struct module *mod) module_bug_finalize()
93 mod->bug_table = NULL; module_bug_finalize()
94 mod->num_bugs = 0; module_bug_finalize()
101 mod->bug_table = (void *) sechdrs[i].sh_addr; module_bug_finalize()
102 mod->num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry); module_bug_finalize()
113 list_add_rcu(&mod->bug_list, &module_bug_list); module_bug_finalize()
116 void module_bug_cleanup(struct module *mod) module_bug_cleanup() argument
119 list_del_rcu(&mod->bug_list); module_bug_cleanup()
85 module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) module_bug_finalize() argument
H A Dbch.c225 * tttttttt mod g = r0 (precomputed) encode_bch()
226 * zzzzzzzz 00000000 mod g = r1 (precomputed) encode_bch()
227 * yyyyyyyy 00000000 00000000 mod g = r2 (precomputed) encode_bch()
228 * xxxxxxxx 00000000 00000000 00000000 mod g = r3 (precomputed) encode_bch()
229 * xxxxxxxx yyyyyyyy zzzzzzzz tttttttt mod g = r0^r1^r2^r3 encode_bch()
753 /* compute a mod b (modifies a) */ gf_poly_div()
792 * Given a polynomial f and an integer k, compute Tr(a^kX) mod f
802 /* z contains z^2j mod f */ compute_trace_bk_mod()
814 /* add a^(k*2^i)(z^(2^i) mod f) and compute (z^(2^i) mod f)^2 */ compute_trace_bk_mod()
825 /* z^(2(i+1)) mod f = (z^(2^i) mod f)^2 mod f */ compute_trace_bk_mod()
832 dbg("Tr(a^%d.X) mod f = %s\n", k, gf_poly_str(out)); compute_trace_bk_mod()
852 /* tk = Tr(a^k.X) mod f */ factor_polynomial()
1092 /* we want to compute (p(X).X^(8*b+deg(g))) mod g(X) */ build_mod8_tables()
H A Ddiv64.c176 * Iterative div/mod for use when dividend is not expected to be much
/linux-4.4.14/arch/arc/kernel/
H A Dmodule.c34 char *secstr, struct module *mod) module_frob_arch_sections()
39 mod->arch.unw_sec_idx = 0; module_frob_arch_sections()
40 mod->arch.unw_info = NULL; module_frob_arch_sections()
45 mod->arch.unw_sec_idx = i; module_frob_arch_sections()
53 void module_arch_cleanup(struct module *mod) module_arch_cleanup() argument
56 if (mod->arch.unw_info) module_arch_cleanup()
57 unwind_remove_table(mod->arch.unw_info, 0); module_arch_cleanup()
132 struct module *mod) module_finalize()
136 int unwsec = mod->arch.unw_sec_idx; module_finalize()
139 unw = unwind_add_table(mod, (void *)sechdrs[unwsec].sh_addr, module_finalize()
141 mod->arch.unw_info = unw; module_finalize()
33 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstr, struct module *mod) module_frob_arch_sections() argument
131 module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) module_finalize() argument
/linux-4.4.14/sound/soc/samsung/
H A Ds3c-i2s-v2.c81 u32 fic, con, mod; s3c2412_snd_txctrl() local
87 mod = readl(regs + S3C2412_IISMOD); s3c2412_snd_txctrl()
89 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); s3c2412_snd_txctrl()
96 switch (mod & S3C2412_IISMOD_MODE_MASK) { s3c2412_snd_txctrl()
103 mod &= ~S3C2412_IISMOD_MODE_MASK; s3c2412_snd_txctrl()
104 mod |= S3C2412_IISMOD_MODE_TXRX; s3c2412_snd_txctrl()
109 mod & S3C2412_IISMOD_MODE_MASK); s3c2412_snd_txctrl()
114 writel(mod, regs + S3C2412_IISMOD); s3c2412_snd_txctrl()
125 switch (mod & S3C2412_IISMOD_MODE_MASK) { s3c2412_snd_txctrl()
127 mod &= ~S3C2412_IISMOD_MODE_MASK; s3c2412_snd_txctrl()
128 mod |= S3C2412_IISMOD_MODE_RXONLY; s3c2412_snd_txctrl()
132 mod &= ~S3C2412_IISMOD_MODE_MASK; s3c2412_snd_txctrl()
138 mod & S3C2412_IISMOD_MODE_MASK); s3c2412_snd_txctrl()
142 writel(mod, regs + S3C2412_IISMOD); s3c2412_snd_txctrl()
148 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); s3c2412_snd_txctrl()
154 u32 fic, con, mod; s3c2412_snd_rxctrl() local
160 mod = readl(regs + S3C2412_IISMOD); s3c2412_snd_rxctrl()
162 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); s3c2412_snd_rxctrl()
169 switch (mod & S3C2412_IISMOD_MODE_MASK) { s3c2412_snd_rxctrl()
176 mod &= ~S3C2412_IISMOD_MODE_MASK; s3c2412_snd_rxctrl()
177 mod |= S3C2412_IISMOD_MODE_TXRX; s3c2412_snd_rxctrl()
182 mod & S3C2412_IISMOD_MODE_MASK); s3c2412_snd_rxctrl()
185 writel(mod, regs + S3C2412_IISMOD); s3c2412_snd_rxctrl()
194 switch (mod & S3C2412_IISMOD_MODE_MASK) { s3c2412_snd_rxctrl()
197 mod &= ~S3C2412_IISMOD_MODE_MASK; s3c2412_snd_rxctrl()
201 mod &= ~S3C2412_IISMOD_MODE_MASK; s3c2412_snd_rxctrl()
202 mod |= S3C2412_IISMOD_MODE_TXONLY; s3c2412_snd_rxctrl()
207 mod & S3C2412_IISMOD_MODE_MASK); s3c2412_snd_rxctrl()
211 writel(mod, regs + S3C2412_IISMOD); s3c2412_snd_rxctrl()
215 pr_debug("%s: IIS: CON=%x MOD=%x FIC=%x\n", __func__, con, mod, fic); s3c2412_snd_rxctrl()
H A Di2s.c119 u32 mod = readl(i2s->addr + I2SMOD); is_slave() local
120 return (mod & (1 << i2s->variant_regs->mss_off)) ? true : false; is_slave()
249 u32 mod = readl(i2s->addr + I2SMOD); set_rfs() local
252 mod &= ~(i2s->variant_regs->rfs_mask << rfs_shift); set_rfs()
256 mod |= (EXYNOS7_MOD_RCLK_192FS << rfs_shift); set_rfs()
259 mod |= (EXYNOS7_MOD_RCLK_96FS << rfs_shift); set_rfs()
262 mod |= (EXYNOS7_MOD_RCLK_128FS << rfs_shift); set_rfs()
265 mod |= (EXYNOS7_MOD_RCLK_64FS << rfs_shift); set_rfs()
268 mod |= (MOD_RCLK_768FS << rfs_shift); set_rfs()
271 mod |= (MOD_RCLK_512FS << rfs_shift); set_rfs()
274 mod |= (MOD_RCLK_384FS << rfs_shift); set_rfs()
277 mod |= (MOD_RCLK_256FS << rfs_shift); set_rfs()
281 writel(mod, i2s->addr + I2SMOD); set_rfs()
307 u32 mod = readl(i2s->addr + I2SMOD); set_bfs() local
317 mod &= ~(i2s->variant_regs->bfs_mask << bfs_shift); set_bfs()
321 mod |= (MOD_BCLK_48FS << bfs_shift); set_bfs()
324 mod |= (MOD_BCLK_32FS << bfs_shift); set_bfs()
327 mod |= (MOD_BCLK_24FS << bfs_shift); set_bfs()
330 mod |= (MOD_BCLK_16FS << bfs_shift); set_bfs()
333 mod |= (EXYNOS5420_MOD_BCLK_64FS << bfs_shift); set_bfs()
336 mod |= (EXYNOS5420_MOD_BCLK_96FS << bfs_shift); set_bfs()
339 mod |= (EXYNOS5420_MOD_BCLK_128FS << bfs_shift); set_bfs()
342 mod |= (EXYNOS5420_MOD_BCLK_192FS << bfs_shift); set_bfs()
345 mod |= (EXYNOS5420_MOD_BCLK_256FS << bfs_shift); set_bfs()
352 writel(mod, i2s->addr + I2SMOD); set_bfs()
375 u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off); i2s_txctrl() local
390 mod |= 2 << txr_off; i2s_txctrl()
392 mod |= 0 << txr_off; i2s_txctrl()
410 mod |= 1 << txr_off; i2s_txctrl()
415 writel(mod, addr + I2SMOD); i2s_txctrl()
425 u32 mod = readl(addr + I2SMOD) & ~(3 << txr_off); i2s_rxctrl() local
432 mod |= 2 << txr_off; i2s_rxctrl()
434 mod |= 1 << txr_off; i2s_rxctrl()
440 mod |= 0 << txr_off; i2s_rxctrl()
445 writel(mod, addr + I2SMOD); i2s_rxctrl()
482 u32 mod, mask, val = 0; i2s_set_sysclk() local
486 mod = readl(i2s->addr + I2SMOD); i2s_set_sysclk()
503 && !(mod & cdcon_mask)) || i2s_set_sysclk()
505 && (mod & cdcon_mask))))) { i2s_set_sysclk()
529 if ((clk_id && !(mod & rsrc_mask)) || i2s_set_sysclk()
530 (!clk_id && (mod & rsrc_mask))) { i2s_set_sysclk()
558 } else if ((!clk_id && (mod & rsrc_mask)) i2s_set_sysclk()
559 || (clk_id && !(mod & rsrc_mask))) { i2s_set_sysclk()
579 mod = readl(i2s->addr + I2SMOD); i2s_set_sysclk()
580 mod = (mod & ~mask) | val; i2s_set_sysclk()
581 writel(mod, i2s->addr + I2SMOD); i2s_set_sysclk()
592 u32 mod, tmp = 0; i2s_set_fmt() local
654 mod = readl(i2s->addr + I2SMOD); i2s_set_fmt()
660 ((mod & (sdf_mask | lrp_rlow | mod_slave)) != tmp)) { i2s_set_fmt()
667 mod &= ~(sdf_mask | lrp_rlow | mod_slave); i2s_set_fmt()
668 mod |= tmp; i2s_set_fmt()
669 writel(mod, i2s->addr + I2SMOD); i2s_set_fmt()
679 u32 mod, mask = 0, val = 0; i2s_hw_params() local
750 mod = readl(i2s->addr + I2SMOD); i2s_hw_params()
751 mod = (mod & ~mask) | val; i2s_hw_params()
752 writel(mod, i2s->addr + I2SMOD); i2s_hw_params()
H A Didma.c152 u32 mod = readl(idma.regs + I2SMOD); idma_hw_params() local
156 mod |= MOD_TXS_IDMA; idma_hw_params()
158 writel(mod, idma.regs + I2SMOD); idma_hw_params()
/linux-4.4.14/kernel/livepatch/
H A Dcore.c86 return !obj->name || obj->mod; klp_is_object_loaded()
89 /* sets obj->mod if object is not vmlinux and module is found */ klp_find_object_module()
92 struct module *mod; klp_find_object_module() local
103 mod = find_module(obj->name); klp_find_object_module()
108 * until mod->exit() finishes. This is especially important for klp_find_object_module()
111 if (mod && mod->klp_alive) klp_find_object_module()
112 obj->mod = mod; klp_find_object_module()
148 struct module *mod, unsigned long addr) klp_find_callback()
152 if ((mod && !args->objname) || (!mod && args->objname)) klp_find_callback()
158 if (args->objname && strcmp(args->objname, mod->name)) klp_find_callback()
206 struct module *mod, unsigned long addr) klp_verify_callback()
210 if (!mod && klp_verify_callback()
314 ret = klp_find_object_symbol(obj->mod->name, klp_write_object_relocations()
481 pr_notice("disabling patch '%s'\n", patch->mod->name); __klp_disable_patch()
541 pr_notice("enabling patch '%s'\n", patch->mod->name); __klp_enable_patch()
707 obj->mod = NULL; klp_free_object_loaded()
753 ret = klp_write_object_relocations(patch->mod, obj); klp_init_object_loaded()
777 obj->mod = NULL; klp_init_object()
820 klp_root_kobj, "%s", patch->mod->name); klp_init_patch()
892 if (!patch || !patch->mod) klp_register_patch()
902 if (!try_module_get(patch->mod)) klp_register_patch()
907 module_put(patch->mod); klp_register_patch()
916 struct module *pmod = patch->mod; klp_module_notify_coming()
917 struct module *mod = obj->mod; klp_module_notify_coming() local
923 pmod->name, mod->name, ret); klp_module_notify_coming()
931 pmod->name, mod->name); klp_module_notify_coming()
936 pmod->name, mod->name, ret); klp_module_notify_coming()
943 struct module *pmod = patch->mod; klp_module_notify_going()
944 struct module *mod = obj->mod; klp_module_notify_going() local
950 pmod->name, mod->name); klp_module_notify_going()
962 struct module *mod = data; klp_module_notify() local
976 mod->klp_alive = true; klp_module_notify()
978 mod->klp_alive = false; klp_module_notify()
982 if (!klp_is_module(obj) || strcmp(obj->name, mod->name)) klp_for_each_object()
986 obj->mod = mod; klp_for_each_object()
989 obj->mod = NULL; klp_for_each_object()
991 patch->mod->name); klp_for_each_object()
147 klp_find_callback(void *data, const char *name, struct module *mod, unsigned long addr) klp_find_callback() argument
205 klp_verify_callback(void *data, const char *name, struct module *mod, unsigned long addr) klp_verify_callback() argument
/linux-4.4.14/sound/aoa/core/
H A Dalsa.h13 extern int aoa_alsa_init(char *name, struct module *mod, struct device *dev);
H A Dalsa.c17 int aoa_alsa_init(char *name, struct module *mod, struct device *dev) aoa_alsa_init() argument
26 err = snd_card_new(dev, index, name, mod, sizeof(struct aoa_card), aoa_alsa_init()
/linux-4.4.14/arch/cris/include/arch-v32/mach-fs/mach/hwregs/
H A Dreg_map.h6 * file: ../../mod/fakereg.rmap
12 * file: ../../mod/modreg.rmap
16 * by /n/asic/design/tools/rdesc/src/rdes2c -map -base 0xb0000000 ../../rtl/global.rmap ../../mod/modreg.rmap ../../inst/io_proc/rtl/guinness/iop_top.r ../../inst/memarb/rtl/guinness/marb_top.r ../../mod/fakereg.rmap
/linux-4.4.14/arch/x86/kernel/
H A Dlivepatch.c30 * @mod: module in which the section to be modified is found
38 int klp_write_module_reloc(struct module *mod, unsigned long type, klp_write_module_reloc() argument
44 unsigned long core = (unsigned long)mod->module_core; klp_write_module_reloc()
45 unsigned long core_size = mod->core_size; klp_write_module_reloc()
75 if (loc < core + mod->core_ro_size) klp_write_module_reloc()
H A Dalternative.c466 struct module *mod; member in struct:smp_alt_module
483 void __init_or_module alternatives_smp_module_add(struct module *mod, alternatives_smp_module_add() argument
503 smp->mod = mod; alternatives_smp_module_add()
520 void __init_or_module alternatives_smp_module_del(struct module *mod) alternatives_smp_module_del() argument
526 if (mod != item->mod) alternatives_smp_module_del()
537 struct smp_alt_module *mod; alternatives_enable_smp() local
549 list_for_each_entry(mod, &smp_alt_modules, next) alternatives_enable_smp()
550 alternatives_smp_lock(mod->locks, mod->locks_end, alternatives_enable_smp()
551 mod->text, mod->text_end); alternatives_enable_smp()
560 struct smp_alt_module *mod; alternatives_text_reserved() local
565 list_for_each_entry(mod, &smp_alt_modules, next) { alternatives_text_reserved()
566 if (mod->text > text_end || mod->text_end < text_start) alternatives_text_reserved()
568 for (poff = mod->locks; poff < mod->locks_end; poff++) { alternatives_text_reserved()
H A Dtest_nx.c47 struct module *mod = THIS_MODULE; fudze_exception_table() local
56 if (mod->num_exentries > 1) { fudze_exception_table()
61 extable = (struct exception_table_entry *)mod->extable; fudze_exception_table()
/linux-4.4.14/arch/microblaze/lib/
H A Dmodsi3.S7 * Output: op1 mod op2 in Reg r3
34 addik r3, r0, 0 /* clear mod */
45 addc r3, r3, r3 /* move that bit into the mod register */
48 /* move the r31 to mod since the result was positive */
62 or r3, r0, r0 /* set result to 0 [both mod as well as div are 0] */
H A Dumodsi3.S7 * Output: op1 mod op2 in Reg r3
26 addik r30, r0, 0 /* clear mod */
61 addc r3, r3, r3 /* move that bit into the mod register */
64 /* move the r31 to mod since the result was positive */
H A Ddivsi3.S31 addik r30, r0, 0 /* clear mod */
45 addc r30, r30, r30 /* move that bit into the mod register */
48 /* move the r31 to mod since the result was positive */
H A Dudivsi3.S26 addik r30, r0, 0 /* clear mod */
59 addc r30, r30, r30 /* move that bit into the mod register */
62 /* move the r31 to mod since the result was positive */
/linux-4.4.14/arch/x86/math-emu/
H A Dget_address.c70 /* Decode the SIB byte. This function assumes mod != 0 */ sib()
71 static int sib(int mod, unsigned long *fpu_eip) sib() argument
85 if ((mod == 0) && (base == 5)) sib()
99 if (mod == 1) { sib()
108 } else if (mod == 2 || base == 5) { /* The second condition also has mod==0 */ sib()
211 u_char mod; FPU_get_address() local
225 mod = (FPU_modrm >> 6) & 3; FPU_get_address()
227 if (rm == 4 && mod != 3) { FPU_get_address()
228 address = sib(mod, fpu_eip); FPU_get_address()
231 switch (mod) { FPU_get_address()
296 u_char mod; FPU_get_address_16() local
298 int address = 0; /* Default used for mod == 0 */ FPU_get_address_16()
309 mod = (FPU_modrm >> 6) & 3; FPU_get_address_16()
311 switch (mod) { FPU_get_address_16()
/linux-4.4.14/arch/powerpc/kernel/
H A Dftrace.c106 __ftrace_make_nop(struct module *mod, __ftrace_make_nop() argument
134 if (module_trampoline_target(mod, tramp, &ptr)) { __ftrace_make_nop()
171 __ftrace_make_nop(struct module *mod, __ftrace_make_nop() argument
241 int ftrace_make_nop(struct module *mod, ftrace_make_nop() argument
265 if (!rec->arch.mod) { ftrace_make_nop()
266 if (!mod) { ftrace_make_nop()
270 rec->arch.mod = mod; ftrace_make_nop()
271 } else if (mod) { ftrace_make_nop()
272 if (mod != rec->arch.mod) { ftrace_make_nop()
273 pr_err("Record mod %p not equal to passed in mod %p\n", ftrace_make_nop()
274 rec->arch.mod, mod); ftrace_make_nop()
277 /* nothing to do if mod == rec->arch.mod */ ftrace_make_nop()
279 mod = rec->arch.mod; ftrace_make_nop()
281 return __ftrace_make_nop(mod, rec, addr); ftrace_make_nop()
315 if (!rec->arch.mod->arch.tramp) { __ftrace_make_call()
321 if (!create_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { __ftrace_make_call()
326 if (patch_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { __ftrace_make_call()
351 if (!rec->arch.mod->arch.tramp) { __ftrace_make_call()
358 rec->arch.mod->arch.tramp, BRANCH_SET_LINK); __ftrace_make_call()
397 if (!rec->arch.mod) { ftrace_make_call()
H A Dmodule_32.c185 struct module *mod) do_plt_call()
191 if (location >= mod->module_core do_plt_call()
192 && location < mod->module_core + mod->core_size) do_plt_call()
193 entry = (void *)sechdrs[mod->arch.core_plt_section].sh_addr; do_plt_call()
195 entry = (void *)sechdrs[mod->arch.init_plt_section].sh_addr; do_plt_call()
182 do_plt_call(void *location, Elf32_Addr val, Elf32_Shdr *sechdrs, struct module *mod) do_plt_call() argument
/linux-4.4.14/scripts/mod/
H A Dmodpost.c122 struct module *mod; find_module() local
124 for (mod = modules; mod; mod = mod->next) find_module()
125 if (strcmp(mod->name, modname) == 0) find_module()
127 return mod; find_module()
132 struct module *mod; new_module() local
135 mod = NOFAIL(malloc(sizeof(*mod))); new_module()
136 memset(mod, 0, sizeof(*mod)); new_module()
142 mod->is_dot_o = 1; new_module()
146 mod->name = p; new_module()
147 mod->gpl_compatible = -1; new_module()
148 mod->next = modules; new_module()
149 modules = mod; new_module()
151 return mod; new_module()
306 static struct symbol *sym_add_exported(const char *name, struct module *mod, sym_add_exported() argument
312 s = new_symbol(name, mod, export); sym_add_exported()
316 "was in %s%s\n", mod->name, name, sym_add_exported()
321 s->module = mod; sym_add_exported()
325 s->vmlinux = is_vmlinux(mod->name); sym_add_exported()
331 static void sym_update_crc(const char *name, struct module *mod, sym_update_crc() argument
337 s = new_symbol(name, mod, export); sym_update_crc()
606 static void handle_modversions(struct module *mod, struct elf_info *info, handle_modversions() argument
612 if ((!is_vmlinux(mod->name) || mod->is_dot_o) && handle_modversions()
621 sym_update_crc(symname + strlen(CRC_PFX), mod, crc, handle_modversions()
630 warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); handle_modversions()
665 mod->unres = alloc_symbol(symname, handle_modversions()
667 mod->unres); handle_modversions()
672 sym_add_exported(symname + strlen(KSYMTAB_PFX), mod, handle_modversions()
676 mod->has_init = 1; handle_modversions()
678 mod->has_cleanup = 1; handle_modversions()
1624 "OTHER_TEXT_SECTIONS in scripts/mod/modpost.c.\n", report_extable_warnings()
1896 static void check_sec_ref(struct module *mod, const char *modname, check_sec_ref() argument
1930 struct module *mod; read_symbols() local
1937 mod = new_module(modname); read_symbols()
1943 mod->skip = 1; read_symbols()
1953 mod->gpl_compatible = 1; read_symbols()
1955 mod->gpl_compatible = 0; read_symbols()
1965 handle_modversions(mod, &info, sym, symname); read_symbols()
1966 handle_moddevtable(mod, &info, sym, symname); read_symbols()
1970 check_sec_ref(mod, modname, &info); read_symbols()
1977 get_src_version(modname, mod->srcversion, read_symbols()
1978 sizeof(mod->srcversion)-1); read_symbols()
1987 mod->unres = alloc_symbol("module_layout", 0, mod->unres); read_symbols()
2081 static void check_exports(struct module *mod) check_exports() argument
2085 for (s = mod->unres; s; s = s->next) { check_exports()
2088 if (!exp || exp->module == mod) check_exports()
2090 basename = strrchr(mod->name, '/'); check_exports()
2094 basename = mod->name; check_exports()
2095 if (!mod->gpl_compatible) check_exports()
2104 static void add_header(struct buffer *b, struct module *mod) add_header() argument
2115 if (mod->has_init) add_header()
2117 if (mod->has_cleanup) add_header()
2147 static int add_versions(struct buffer *b, struct module *mod) add_versions() argument
2152 for (s = mod->unres; s; s = s->next) { add_versions()
2154 if (!exp || exp->module == mod) { add_versions()
2158 s->name, mod->name); add_versions()
2161 s->name, mod->name); add_versions()
2180 for (s = mod->unres; s; s = s->next) { add_versions()
2185 s->name, mod->name); add_versions()
2190 s->name, mod->name); add_versions()
2203 static void add_depends(struct buffer *b, struct module *mod, add_depends() argument
2218 for (s = mod->unres; s; s = s->next) { add_depends()
2238 static void add_srcversion(struct buffer *b, struct module *mod) add_srcversion() argument
2240 if (mod->srcversion[0]) { add_srcversion()
2243 mod->srcversion); add_srcversion()
2307 struct module *mod; read_dump() local
2323 mod = find_module(modname); read_dump()
2324 if (!mod) { read_dump()
2327 mod = new_module(modname); read_dump()
2328 mod->skip = 1; read_dump()
2330 s = sym_add_exported(symname, mod, export_no(export)); read_dump()
2333 sym_update_crc(symname, mod, crc, export_no(export)); read_dump()
2382 struct module *mod; main() local
2457 for (mod = modules; mod; mod = mod->next) { main()
2458 if (mod->skip) main()
2460 check_exports(mod); main()
2465 for (mod = modules; mod; mod = mod->next) { main()
2468 if (mod->skip) main()
2473 add_header(&buf, mod); main()
2475 add_staging_flag(&buf, mod->name); main()
2476 err |= add_versions(&buf, mod); main()
2477 add_depends(&buf, mod, modules); main()
2478 add_moddevtable(&buf, mod); main()
2479 add_srcversion(&buf, mod); main()
2481 sprintf(fname, "%s.mod.c", mod->name); main()
H A Dfile2alias.c190 unsigned char max, struct module *mod) do_usb_entry()
251 buf_printf(&mod->dev_table_buf, do_usb_entry()
294 static void do_usb_entry_multi(void *symval, struct module *mod) do_usb_entry_multi() argument
341 do_usb_entry(symval, devlo, ndigits, clo, chi, max, mod); do_usb_entry_multi()
349 ndigits, clo, max, max, mod); do_usb_entry_multi()
355 ndigits, 0x0, chi, max, mod); do_usb_entry_multi()
360 struct module *mod) do_usb_table()
365 device_id_check(mod->name, "usb", size, id_size, symval); do_usb_table()
371 do_usb_entry_multi(symval + i, mod); do_usb_table()
568 struct module *mod) do_pnp_device_entry()
574 device_id_check(mod->name, "pnp", size, id_size, symval); do_pnp_device_entry()
581 buf_printf(&mod->dev_table_buf, do_pnp_device_entry()
587 buf_printf(&mod->dev_table_buf, do_pnp_device_entry()
594 struct module *mod) do_pnp_card_entries()
600 device_id_check(mod->name, "pnp", size, id_size, symval); do_pnp_card_entries()
636 buf_printf(&mod->dev_table_buf, do_pnp_card_entries()
642 buf_printf(&mod->dev_table_buf, do_pnp_card_entries()
1187 ADD(alias, "mod", model != X86_MODEL_ANY, model); do_x86cpu_entry()
1287 struct module *mod) do_table()
1293 device_id_check(mod->name, device_id, size, id_size, symval); do_table()
1298 if (do_entry(mod->name, symval+i, alias)) { do_table()
1299 buf_printf(&mod->dev_table_buf, do_table()
1307 * so we write into the mod->dev_table_buf buffer. */ handle_moddevtable()
1308 void handle_moddevtable(struct module *mod, struct elf_info *info, handle_moddevtable() argument
1351 do_usb_table(symval, sym->st_size, mod); handle_moddevtable()
1353 do_pnp_device_entry(symval, sym->st_size, mod); handle_moddevtable()
1355 do_pnp_card_entries(symval, sym->st_size, mod); handle_moddevtable()
1363 (*p)->device_id, (*p)->function, mod); handle_moddevtable()
1372 void add_moddevtable(struct buffer *buf, struct module *mod) add_moddevtable() argument
1375 buf_write(buf, mod->dev_table_buf.p, mod->dev_table_buf.pos); add_moddevtable()
1376 free(mod->dev_table_buf.p); add_moddevtable()
187 do_usb_entry(void *symval, unsigned int bcdDevice_initial, int bcdDevice_initial_digits, unsigned char range_lo, unsigned char range_hi, unsigned char max, struct module *mod) do_usb_entry() argument
359 do_usb_table(void *symval, unsigned long size, struct module *mod) do_usb_table() argument
567 do_pnp_device_entry(void *symval, unsigned long size, struct module *mod) do_pnp_device_entry() argument
593 do_pnp_card_entries(void *symval, unsigned long size, struct module *mod) do_pnp_card_entries() argument
1283 do_table(void *symval, unsigned long size, unsigned long id_size, const char *device_id, void *function, struct module *mod) do_table() argument
H A Dmodpost.h175 void handle_moddevtable(struct module *mod, struct elf_info *info,
177 void add_moddevtable(struct buffer *buf, struct module *mod);
H A Dsumversion.c413 /* Source files for module are in .tmp_versions/modname.mod, get_src_version()
419 snprintf(filelist, sizeof(filelist), "%s/%.*s.mod", modverdir, get_src_version()
424 /* not a module or .mod file missing - ignore */ get_src_version()
/linux-4.4.14/arch/x86/lib/
H A Dinsn.c156 * In 32-bits mode, if the [7:6] bits (mod bits of insn_get_prefixes()
257 insn_byte_t pfx_id, mod; insn_get_modrm() local
264 mod = get_next(insn_byte_t, insn); insn_get_modrm()
265 modrm->value = mod; insn_get_modrm()
269 insn->attr = inat_get_group_attribute(mod, pfx_id, insn_get_modrm()
301 * For rip-relative instructions, the mod field (top 2 bits) insn_rip_relative()
347 insn_byte_t mod, rm, base; insn_get_displacement() local
356 * mod = 00 - no displacement fields (exceptions below) insn_get_displacement()
357 * mod = 01 - 1-byte displacement field insn_get_displacement()
358 * mod = 10 - displacement field is 4 bytes, or 2 bytes if insn_get_displacement()
360 * mod = 11 - no memory operand insn_get_displacement()
363 * mod = 00, r/m = 110 - displacement field is 2 bytes insn_get_displacement()
366 * mod != 11, r/m = 100 - SIB byte exists insn_get_displacement()
367 * mod = 00, SIB base = 101 - displacement field is 4 bytes insn_get_displacement()
368 * mod = 00, r/m = 101 - rip-relative addressing, displacement insn_get_displacement()
371 mod = X86_MODRM_MOD(insn->modrm.value); insn_get_displacement()
374 if (mod == 3) insn_get_displacement()
376 if (mod == 1) { insn_get_displacement()
380 if ((mod == 0 && rm == 6) || mod == 2) { insn_get_displacement()
386 if ((mod == 0 && rm == 5) || mod == 2 || insn_get_displacement()
387 (mod == 0 && base == 5)) { insn_get_displacement()
/linux-4.4.14/tools/perf/util/intel-pt-decoder/
H A Dinsn.c156 * In 32-bits mode, if the [7:6] bits (mod bits of insn_get_prefixes()
257 insn_byte_t pfx_id, mod; insn_get_modrm() local
264 mod = get_next(insn_byte_t, insn); insn_get_modrm()
265 modrm->value = mod; insn_get_modrm()
269 insn->attr = inat_get_group_attribute(mod, pfx_id, insn_get_modrm()
301 * For rip-relative instructions, the mod field (top 2 bits) insn_rip_relative()
347 insn_byte_t mod, rm, base; insn_get_displacement() local
356 * mod = 00 - no displacement fields (exceptions below) insn_get_displacement()
357 * mod = 01 - 1-byte displacement field insn_get_displacement()
358 * mod = 10 - displacement field is 4 bytes, or 2 bytes if insn_get_displacement()
360 * mod = 11 - no memory operand insn_get_displacement()
363 * mod = 00, r/m = 110 - displacement field is 2 bytes insn_get_displacement()
366 * mod != 11, r/m = 100 - SIB byte exists insn_get_displacement()
367 * mod = 00, SIB base = 101 - displacement field is 4 bytes insn_get_displacement()
368 * mod = 00, r/m = 101 - rip-relative addressing, displacement insn_get_displacement()
371 mod = X86_MODRM_MOD(insn->modrm.value); insn_get_displacement()
374 if (mod == 3) insn_get_displacement()
376 if (mod == 1) { insn_get_displacement()
380 if ((mod == 0 && rm == 6) || mod == 2) { insn_get_displacement()
386 if ((mod == 0 && rm == 5) || mod == 2 || insn_get_displacement()
387 (mod == 0 && base == 5)) { insn_get_displacement()
H A Dgen-insn-attr-x86.awk235 function convert_operands(count,opnd, i,j,imm,mod)
238 mod = null
251 mod = "INAT_MODRM"
253 return add_flags(imm, mod)
/linux-4.4.14/scripts/
H A Dexport_report.pl7 # Usage: export_report.pl -k Module.symvers [-o report_file ] -f *.mod.c
28 for my $mod (sort keys %$href) {
29 my $list = $href->{$mod};
30 print "\t$mod:\n";
43 "\t-f: treat all the non-option argument as .mod.c files. ",
54 while (<.tmp_versions/*.mod>) {
57 grep s/\.ko/.mod.c/, # change the suffix
179 $thismod =~ s/\.mod\.c/.ko/;
H A DMakefile43 subdir-y += mod
/linux-4.4.14/arch/parisc/kernel/
H A Dinventory.c214 dev->mod0 = pa_pdc_cell->mod[0]; pat_query_module()
226 pa_pdc_cell->mod[0]); pat_query_module()
232 pa_pdc_cell->mod[0], pa_pdc_cell->mod[1], pat_query_module()
233 pa_pdc_cell->mod[2]); pat_query_module()
253 printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell->mod[1]); pat_query_module()
254 for (i = 0; i < pa_pdc_cell->mod[1]; i++) { pat_query_module()
257 i, pa_pdc_cell->mod[2 + i * 3], /* type */ pat_query_module()
258 pa_pdc_cell->mod[3 + i * 3], /* start */ pat_query_module()
259 pa_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */ pat_query_module()
262 i, io_pdc_cell->mod[2 + i * 3], /* type */ pat_query_module()
263 io_pdc_cell->mod[3 + i * 3], /* start */ pat_query_module()
264 io_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */ pat_query_module()
456 * mod to get the HPA for the top-level devices. Bus adapters may have
462 int mod; snake_inventory() local
463 for (mod = 0; mod < 16; mod++) { snake_inventory()
470 module_path.path.mod = mod; snake_inventory()
476 module_path.path.bc[4] = mod; snake_inventory()
480 module_path.path.mod = func; snake_inventory()
H A Ddrivers.c287 * Note that if @node is a parisc device, we don't fill in the 'mod' field.
288 * This is because both callers pass the parent and fill in the mod
299 path->mod = PCI_FUNC(devfn); get_node_path()
323 output += sprintf(output, "%u", (unsigned char) path->mod); print_hwpath()
341 path.mod = dev->hw_path; print_pa_hwpath()
471 return alloc_tree_node(parent, modpath->mod); create_parisc_device()
648 (modpath->mod == PCI_FUNC(devfn))); match_pci_device()
667 char id = (index == 6) ? modpath->mod : modpath->bc[index]; match_parisc_device()
762 path->mod = padev->hw_path; device_to_hwpath()
836 path.mod = i; walk_native_bus()
/linux-4.4.14/drivers/gpu/drm/armada/
H A Darmada_fb.h15 uint8_t mod; member in struct:armada_framebuffer
H A Darmada_fb.c45 #define FMT(drm, fmt, mod) \ armada_framebuffer_create()
48 config = mod; \ armada_framebuffer_create()
81 dfb->mod = config; armada_framebuffer_create()
/linux-4.4.14/arch/sparc/include/asm/
H A Dupa.h17 #define UPA_PORTID_ECCVALID 0x0000000400000000 /* Zero if mod can generate ECC */
18 #define UPA_PORTID_ONEREAD 0x0000000200000000 /* Set if mod generates P_RASB */
20 #define UPA_PORTID_PREQDQ 0x000000007e000000 /* slave-wr's to mod supported */
22 #define UPA_PORTID_UPACAP 0x00000000001f0000 /* UPA capabilities of mod */
/linux-4.4.14/arch/m68k/include/asm/
H A Dmodule.h38 extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
/linux-4.4.14/arch/cris/include/arch-v32/mach-fs/mach/hwregs/asm/
H A Dreg_map_asm.h6 * file: ../../mod/fakereg.rmap
12 * file: ../../mod/modreg.rmap
16 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/reg_map_asm.h -base 0xb0000000 ../../rtl/global.rmap ../../mod/modreg.rmap ../../inst/memarb/rtl/guinness/marb_top.r ../../mod/fakereg.rmap
/linux-4.4.14/drivers/base/
H A Dmodule.c33 void module_add_driver(struct module *mod, struct device_driver *drv) module_add_driver() argument
42 if (mod) module_add_driver()
43 mk = &mod->mkobj; module_add_driver()
H A Dbase.h140 extern void module_add_driver(struct module *mod, struct device_driver *drv);
143 static inline void module_add_driver(struct module *mod, module_add_driver() argument
/linux-4.4.14/sound/soc/intel/baytrail/
H A Dsst-baytrail-dsp.c69 struct sst_module *mod; sst_byt_parse_module() local
77 mod = sst_module_new(fw, &template, NULL); sst_byt_parse_module()
78 if (mod == NULL) sst_byt_parse_module()
92 mod->offset = block->ram_offset + sst_byt_parse_module()
94 mod->type = SST_MEM_IRAM; sst_byt_parse_module()
97 mod->offset = block->ram_offset + sst_byt_parse_module()
99 mod->type = SST_MEM_DRAM; sst_byt_parse_module()
102 mod->offset = block->ram_offset + sst_byt_parse_module()
104 mod->type = SST_MEM_CACHE; sst_byt_parse_module()
112 mod->size = block->size; sst_byt_parse_module()
113 mod->data = (void *)block + sizeof(*block); sst_byt_parse_module()
115 sst_module_alloc_blocks(mod); sst_byt_parse_module()
/linux-4.4.14/arch/m68k/kernel/
H A Dmodule.c104 struct module *mod) module_finalize()
106 module_fixup(mod, mod->arch.fixup_start, mod->arch.fixup_end); module_finalize()
112 void module_fixup(struct module *mod, struct m68k_fixup_info *start, module_fixup() argument
102 module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) module_finalize() argument
/linux-4.4.14/arch/nios2/kernel/
H A Dmodule.c46 struct module *mod) apply_relocate_add()
82 mod->name); apply_relocate_add()
92 mod->name); apply_relocate_add()
97 mod->name); apply_relocate_add()
125 mod->name, ELF32_R_TYPE(rela[i].r_info)); apply_relocate_add()
44 apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, unsigned int relsec, struct module *mod) apply_relocate_add() argument
/linux-4.4.14/tools/perf/arch/powerpc/util/
H A Dskip-callchain-idx.c93 static Dwarf_Frame *get_eh_frame(Dwfl_Module *mod, Dwarf_Addr pc) get_eh_frame() argument
100 cfi = dwfl_module_eh_cfi(mod, &bias); get_eh_frame()
118 static Dwarf_Frame *get_dwarf_frame(Dwfl_Module *mod, Dwarf_Addr pc) get_dwarf_frame() argument
125 cfi = dwfl_module_dwarf_cfi(mod, &bias); get_dwarf_frame()
152 Dwfl_Module *mod; check_return_addr() local
169 mod = dwfl_report_elf(dwfl, exec_file, exec_file, -1, check_return_addr()
171 if (!mod) { check_return_addr()
185 mod = dwfl_addrmodule(dwfl, pc); check_return_addr()
186 if (!mod) { check_return_addr()
195 frame = get_eh_frame(mod, pc); check_return_addr()
197 frame = get_dwarf_frame(mod, pc); check_return_addr()
/linux-4.4.14/drivers/staging/lustre/lustre/mdc/
H A Dmdc_request.c587 struct md_open_data *mod = req->rq_cb_data; mdc_replay_open() local
593 if (mod == NULL) { mdc_replay_open()
602 och = mod->mod_och; mdc_replay_open()
614 close_req = mod->mod_close_req; mdc_replay_open()
633 struct md_open_data *mod = req->rq_cb_data; mdc_commit_open() local
635 if (mod == NULL) mdc_commit_open()
640 * \var mod and will zero references to each other, \var mod will be mdc_commit_open()
650 * be put along with freeing \var mod. mdc_commit_open()
657 obd_mod_put(mod); mdc_commit_open()
664 struct md_open_data *mod; mdc_set_open_replay_data() local
682 mod = obd_mod_alloc(); mdc_set_open_replay_data()
683 if (mod == NULL) { mdc_set_open_replay_data()
690 * Take a reference on \var mod, to be freed on mdc_close(). mdc_set_open_replay_data()
691 * It protects \var mod from being freed on eviction (commit mdc_set_open_replay_data()
695 obd_mod_get(mod); mdc_set_open_replay_data()
696 obd_mod_get(mod); mdc_set_open_replay_data()
699 och->och_mod = mod; mdc_set_open_replay_data()
700 mod->mod_och = och; mdc_set_open_replay_data()
701 mod->mod_is_create = it_disposition(it, DISP_OPEN_CREATE) || mdc_set_open_replay_data()
703 mod->mod_open_req = open_req; mdc_set_open_replay_data()
704 open_req->rq_cb_data = mod; mdc_set_open_replay_data()
723 static void mdc_free_open(struct md_open_data *mod) mdc_free_open() argument
727 if (mod->mod_is_create == 0 && mdc_free_open()
728 imp_connect_disp_stripe(mod->mod_open_req->rq_import)) mdc_free_open()
731 LASSERT(mod->mod_open_req->rq_replay == 0); mdc_free_open()
733 DEBUG_REQ(D_RPCTRACE, mod->mod_open_req, "free open request\n"); mdc_free_open()
735 ptlrpc_request_committed(mod->mod_open_req, committed); mdc_free_open()
736 if (mod->mod_close_req) mdc_free_open()
737 ptlrpc_request_committed(mod->mod_close_req, committed); mdc_free_open()
743 struct md_open_data *mod = och->och_mod; mdc_clear_open_replay_data() local
746 * It is possible to not have \var mod in a case of eviction between mdc_clear_open_replay_data()
749 if (mod == NULL) mdc_clear_open_replay_data()
752 LASSERT(mod != LP_POISON); mdc_clear_open_replay_data()
753 LASSERT(mod->mod_open_req != NULL); mdc_clear_open_replay_data()
754 mdc_free_open(mod); mdc_clear_open_replay_data()
756 mod->mod_och = NULL; mdc_clear_open_replay_data()
758 obd_mod_put(mod); mdc_clear_open_replay_data()
780 struct md_open_data *mod, struct ptlrpc_request **request) mdc_close()
820 if (likely(mod != NULL)) { mdc_close()
821 LASSERTF(mod->mod_open_req != NULL && mdc_close()
822 mod->mod_open_req->rq_type != LI_POISON, mdc_close()
823 "POISONED open %p!\n", mod->mod_open_req); mdc_close()
825 mod->mod_close_req = req; mdc_close()
827 DEBUG_REQ(D_HA, mod->mod_open_req, "matched open"); mdc_close()
830 spin_lock(&mod->mod_open_req->rq_lock); mdc_close()
831 mod->mod_open_req->rq_replay = 0; mdc_close()
832 spin_unlock(&mod->mod_open_req->rq_lock); mdc_close()
872 * server failed before close was sent. Let's check if mod mdc_close()
875 if (mod) { mdc_close()
877 LASSERT(mod->mod_open_req != NULL); mdc_close()
878 if (mod->mod_open_req->rq_committed) mdc_close()
883 if (mod) { mdc_close()
885 mod->mod_close_req = NULL; mdc_close()
886 /* Since now, mod is accessed through open_req only, mdc_close()
887 * thus close req does not keep a reference on mod anymore. */ mdc_close()
888 obd_mod_put(mod); mdc_close()
896 struct md_open_data *mod) mdc_done_writing()
913 if (mod != NULL) { mdc_done_writing()
914 LASSERTF(mod->mod_open_req != NULL && mdc_done_writing()
915 mod->mod_open_req->rq_type != LI_POISON, mdc_done_writing()
916 "POISONED setattr %p!\n", mod->mod_open_req); mdc_done_writing()
918 mod->mod_close_req = req; mdc_done_writing()
919 DEBUG_REQ(D_HA, mod->mod_open_req, "matched setattr"); mdc_done_writing()
922 spin_lock(&mod->mod_open_req->rq_lock); mdc_done_writing()
923 mod->mod_open_req->rq_replay = 0; mdc_done_writing()
924 spin_unlock(&mod->mod_open_req->rq_lock); mdc_done_writing()
938 * Let's check if mod exists and return no error in that case mdc_done_writing()
940 if (mod) { mdc_done_writing()
941 LASSERT(mod->mod_open_req != NULL); mdc_done_writing()
942 if (mod->mod_open_req->rq_committed) mdc_done_writing()
947 if (mod) { mdc_done_writing()
949 mod->mod_close_req = NULL; mdc_done_writing()
950 LASSERT(mod->mod_open_req != NULL); mdc_done_writing()
951 mdc_free_open(mod); mdc_done_writing()
953 /* Since now, mod is accessed through setattr req only, mdc_done_writing()
954 * thus DW req does not keep a reference on mod anymore. */ mdc_done_writing()
955 obd_mod_put(mod); mdc_done_writing()
779 mdc_close(struct obd_export *exp, struct md_op_data *op_data, struct md_open_data *mod, struct ptlrpc_request **request) mdc_close() argument
895 mdc_done_writing(struct obd_export *exp, struct md_op_data *op_data, struct md_open_data *mod) mdc_done_writing() argument
H A Dmdc_reint.c105 struct ptlrpc_request **request, struct md_open_data **mod) mdc_setattr()
152 if (mod && (op_data->op_flags & MF_EPOCH_OPEN) && mdc_setattr()
154 LASSERT(*mod == NULL); mdc_setattr()
156 *mod = obd_mod_alloc(); mdc_setattr()
157 if (*mod == NULL) { mdc_setattr()
161 req->rq_cb_data = *mod; mdc_setattr()
162 (*mod)->mod_open_req = req; mdc_setattr()
164 (*mod)->mod_is_create = true; mdc_setattr()
166 * Take an extra reference on \var mod, it protects \var mdc_setattr()
167 * mod from being freed on eviction (commit callback is mdc_setattr()
171 obd_mod_get(*mod); mdc_setattr()
197 /* Put an extra reference on \var mod on error case. */ mdc_setattr()
198 if (mod != NULL && *mod != NULL) mdc_setattr()
199 obd_mod_put(*mod); mdc_setattr()
103 mdc_setattr(struct obd_export *exp, struct md_op_data *op_data, void *ea, int ealen, void *ea2, int ea2len, struct ptlrpc_request **request, struct md_open_data **mod) mdc_setattr() argument
/linux-4.4.14/net/bluetooth/
H A Decc.c330 /* Computes result = (left + right) % mod.
331 * Assumes that left < mod and right < mod, result != mod.
334 const u64 *mod) vli_mod_add()
340 /* result > mod (result = mod + remainder), so subtract mod to vli_mod_add()
343 if (carry || vli_cmp(result, mod) >= 0) vli_mod_add()
344 vli_sub(result, result, mod); vli_mod_add()
347 /* Computes result = (left - right) % mod.
348 * Assumes that left < mod and right < mod, result != mod.
351 const u64 *mod) vli_mod_sub()
357 * result + mod (with overflow). vli_mod_sub()
360 vli_add(result, result, mod); vli_mod_sub()
459 /* Computes result = (1 / p_input) % mod. All VLIs are the same size.
463 static void vli_mod_inv(u64 *result, const u64 *input, const u64 *mod) vli_mod_inv() argument
476 vli_set(b, mod); vli_mod_inv()
488 carry = vli_add(u, u, mod); vli_mod_inv()
497 carry = vli_add(v, v, mod); vli_mod_inv()
507 vli_add(u, u, mod); vli_mod_inv()
511 carry = vli_add(u, u, mod); vli_mod_inv()
521 vli_add(v, v, mod); vli_mod_inv()
525 carry = vli_add(v, v, mod); vli_mod_inv()
333 vli_mod_add(u64 *result, const u64 *left, const u64 *right, const u64 *mod) vli_mod_add() argument
350 vli_mod_sub(u64 *result, const u64 *left, const u64 *right, const u64 *mod) vli_mod_sub() argument
/linux-4.4.14/kernel/trace/
H A Dbpf_trace.c90 int mod[3] = {}; bpf_trace_printk() local
118 mod[fmt_cnt]++; bpf_trace_printk()
121 mod[fmt_cnt]++; bpf_trace_printk()
155 mod[fmt_cnt]++; bpf_trace_printk()
165 mod[0] == 2 ? r3 : mod[0] == 1 ? (long) r3 : (u32) r3, bpf_trace_printk()
166 mod[1] == 2 ? r4 : mod[1] == 1 ? (long) r4 : (u32) r4, bpf_trace_printk()
167 mod[2] == 2 ? r5 : mod[2] == 1 ? (long) r5 : (u32) r5); bpf_trace_printk()
H A Dtrace_printk.c84 struct module *mod = data; module_trace_bprintk_format_notify() local
85 if (mod->num_trace_bprintk_fmt) { module_trace_bprintk_format_notify()
86 const char **start = mod->trace_bprintk_fmt_start; module_trace_bprintk_format_notify()
87 const char **end = start + mod->num_trace_bprintk_fmt; module_trace_bprintk_format_notify()
143 * v points to the address of the fmt field in the mod list find_next_mod_format()
H A Dtrace_event_perf.c170 module_put(tp_event->mod); perf_trace_event_unreg()
217 try_module_get(tp_event->mod)) { perf_trace_init()
220 module_put(tp_event->mod); perf_trace_init()
H A Dtrace_events.c2187 __register_event(struct trace_event_call *call, struct module *mod) __register_event() argument
2196 call->mod = mod; __register_event()
2464 static void trace_module_add_events(struct module *mod) trace_module_add_events() argument
2468 if (!mod->num_trace_events) trace_module_add_events()
2472 if (trace_module_has_bad_taint(mod)) { trace_module_add_events()
2474 mod->name); trace_module_add_events()
2478 start = mod->trace_events; trace_module_add_events()
2479 end = mod->trace_events + mod->num_trace_events; trace_module_add_events()
2482 __register_event(*call, mod); for_each_event()
2487 static void trace_module_remove_events(struct module *mod) trace_module_remove_events() argument
2494 if (call->mod == mod) { trace_module_remove_events()
2517 struct module *mod = data; trace_module_notify() local
2523 trace_module_add_events(mod); trace_module_notify()
2526 trace_module_remove_events(mod); trace_module_notify()
2677 module_put(data->file->event_call->mod); event_enable_free()
2786 ret = try_module_get(file->event_call->mod); event_enable_func()
2815 module_put(file->event_call->mod); event_enable_func()
2883 if (WARN_ON_ONCE(call->mod)) __trace_early_add_events()
/linux-4.4.14/include/linux/iio/imu/
H A Dadis.h202 #define ADIS_MOD_CHAN(_type, mod, addr, si, info_sep, info_all, bits) { \
205 .channel2 = IIO_MOD_ ## mod, \
220 #define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, info_all, bits) \
221 ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, info_all, bits)
223 #define ADIS_GYRO_CHAN(mod, addr, si, info_sep, info_all, bits) \
224 ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info_sep, info_all, bits)
226 #define ADIS_INCLI_CHAN(mod, addr, si, info_sep, info_all, bits) \
227 ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info_sep, info_all, bits)
229 #define ADIS_ROT_CHAN(mod, addr, si, info_sep, info_all, bits) \
230 ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info_sep, info_all, bits)
/linux-4.4.14/arch/xtensa/kernel/
H A Dmodule.c53 struct module *mod) apply_relocate_add()
93 mod->name, relsec, i, apply_relocate_add()
117 mod->name, relsec, i, apply_relocate_add()
160 mod->name, apply_relocate_add()
180 mod->name, apply_relocate_add()
186 mod->name, apply_relocate_add()
49 apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, unsigned int relsec, struct module *mod) apply_relocate_add() argument
/linux-4.4.14/tools/perf/util/
H A Dunwind-libdw.c26 Dwfl_Module *mod; __report_module() local
39 mod = dwfl_addrmodule(ui->dwfl, ip); __report_module()
40 if (!mod) __report_module()
41 mod = dwfl_report_elf(ui->dwfl, dso->short_name, __report_module()
45 return mod && dwfl_addrmodule(ui->dwfl, ip) == mod ? 0 : -1; __report_module()
H A Dprobe-finder.h31 Dwfl_Module *mod; member in struct:debuginfo
88 Dwfl_Module *mod; /* For solving symbols */ member in struct:trace_event_finder
96 Dwfl_Module *mod; /* For solving symbols */ member in struct:available_var_finder
H A Dparse-events.c1086 static int get_event_modifier(struct event_modifier *mod, char *str, get_event_modifier() argument
1103 memset(mod, 0, sizeof(*mod)); get_event_modifier()
1158 mod->eu = eu; get_event_modifier()
1159 mod->ek = ek; get_event_modifier()
1160 mod->eh = eh; get_event_modifier()
1161 mod->eH = eH; get_event_modifier()
1162 mod->eG = eG; get_event_modifier()
1163 mod->eI = eI; get_event_modifier()
1164 mod->precise = precise; get_event_modifier()
1165 mod->precise_max = precise_max; get_event_modifier()
1166 mod->exclude_GH = exclude_GH; get_event_modifier()
1167 mod->sample_read = sample_read; get_event_modifier()
1168 mod->pinned = pinned; get_event_modifier()
1197 struct event_modifier mod; parse_events__modifier_event() local
1205 if (!add && get_event_modifier(&mod, str, NULL)) parse_events__modifier_event()
1209 if (add && get_event_modifier(&mod, str, evsel)) __evlist__for_each()
1212 evsel->attr.exclude_user = mod.eu; __evlist__for_each()
1213 evsel->attr.exclude_kernel = mod.ek; __evlist__for_each()
1214 evsel->attr.exclude_hv = mod.eh; __evlist__for_each()
1215 evsel->attr.precise_ip = mod.precise; __evlist__for_each()
1216 evsel->attr.exclude_host = mod.eH; __evlist__for_each()
1217 evsel->attr.exclude_guest = mod.eG; __evlist__for_each()
1218 evsel->attr.exclude_idle = mod.eI; __evlist__for_each()
1219 evsel->exclude_GH = mod.exclude_GH; __evlist__for_each()
1220 evsel->sample_read = mod.sample_read; __evlist__for_each()
1221 evsel->precise_max = mod.precise_max; __evlist__for_each()
1224 evsel->attr.pinned = mod.pinned; __evlist__for_each()
H A Dprobe-finder.c74 dbg->mod = dwfl_report_offline(dbg->dwfl, "", "", fd); debuginfo__init_offline_dwarf()
75 if (!dbg->mod) debuginfo__init_offline_dwarf()
78 dbg->dbg = dwfl_module_getdwarf(dbg->mod, &dbg->bias); debuginfo__init_offline_dwarf()
595 static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod, convert_to_trace_point() argument
624 symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL); convert_to_trace_point()
1198 ret = convert_to_trace_point(&pf->sp_die, tf->mod, pf->addr, add_probe_trace_event()
1256 .max_tevs = probe_conf.max_probes, .mod = dbg->mod}; debuginfo__find_trace_events()
1352 ret = convert_to_trace_point(&pf->sp_die, af->mod, pf->addr, add_available_vars()
1394 .mod = dbg->mod, debuginfo__find_available_vars_at()
1430 elf = dwfl_module_getelf(dbg->mod, &dbg->bias); debuginfo__get_text_offset()
1435 n = dwfl_module_relocations(dbg->mod); debuginfo__get_text_offset()
1440 p = dwfl_module_relocation_info(dbg->mod, i, &shndx); debuginfo__get_text_offset()
/linux-4.4.14/drivers/gpu/drm/nouveau/nvkm/engine/gr/
H A Dctxnv40.h78 _cp_bra(struct nvkm_grctx *ctx, u32 mod, int flag, int state, int name) _cp_bra() argument
82 if (mod != 2) { _cp_bra()
88 cp_out(ctx, CP_BRA | (mod << 18) | ip | flag | _cp_bra()
/linux-4.4.14/arch/x86/mm/
H A DMakefile27 mmiotrace-y := kmmio.o pf_in.o mmio-mod.o
H A Dpf_in.c219 * Define register ident in mod/rm byte.
468 unsigned char mod; get_ins_imm_val() local
486 mod = mod_rm >> 6; get_ins_imm_val()
488 switch (mod) { get_ins_imm_val()
/linux-4.4.14/lib/mpi/
H A Dmpi-pow.c34 * RES = BASE ^ EXP mod MOD
36 int mpi_powm(MPI res, MPI base, MPI exp, MPI mod) mpi_powm() argument
53 msize = mod->nlimbs; mpi_powm()
56 msign = mod->sign; mpi_powm()
65 /* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0 mpi_powm()
68 res->nlimbs = (msize == 1 && mod->d[0] == 1) ? 0 : 1; mpi_powm()
80 mod_shift_cnt = count_leading_zeros(mod->d[msize - 1]); mpi_powm()
82 mpihelp_lshift(mp, mod->d, msize, mod_shift_cnt); mpi_powm()
84 MPN_COPY(mp, mod->d, msize); mpi_powm()
/linux-4.4.14/arch/arm/include/asm/
H A Dmodule.h33 u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
/linux-4.4.14/drivers/scsi/bfa/
H A Dbfa_svc.c449 claim_fcxps_mem(struct bfa_fcxp_mod_s *mod) claim_fcxps_mem() argument
454 fcxp = (struct bfa_fcxp_s *) bfa_mem_kva_curp(mod); claim_fcxps_mem()
455 memset(fcxp, 0, sizeof(struct bfa_fcxp_s) * mod->num_fcxps); claim_fcxps_mem()
457 INIT_LIST_HEAD(&mod->fcxp_req_free_q); claim_fcxps_mem()
458 INIT_LIST_HEAD(&mod->fcxp_rsp_free_q); claim_fcxps_mem()
459 INIT_LIST_HEAD(&mod->fcxp_active_q); claim_fcxps_mem()
460 INIT_LIST_HEAD(&mod->fcxp_req_unused_q); claim_fcxps_mem()
461 INIT_LIST_HEAD(&mod->fcxp_rsp_unused_q); claim_fcxps_mem()
463 mod->fcxp_list = fcxp; claim_fcxps_mem()
465 for (i = 0; i < mod->num_fcxps; i++) { claim_fcxps_mem()
466 fcxp->fcxp_mod = mod; claim_fcxps_mem()
469 if (i < (mod->num_fcxps / 2)) { claim_fcxps_mem()
470 list_add_tail(&fcxp->qe, &mod->fcxp_req_free_q); claim_fcxps_mem()
473 list_add_tail(&fcxp->qe, &mod->fcxp_rsp_free_q); claim_fcxps_mem()
483 bfa_mem_kva_curp(mod) = (void *)fcxp; claim_fcxps_mem()
528 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); bfa_fcxp_attach() local
530 mod->bfa = bfa; bfa_fcxp_attach()
531 mod->num_fcxps = cfg->fwcfg.num_fcxp_reqs; bfa_fcxp_attach()
536 mod->req_pld_sz = mod->rsp_pld_sz = BFA_FCXP_MAX_IBUF_SZ; bfa_fcxp_attach()
538 mod->rsp_pld_sz = BFA_FCXP_MAX_LBUF_SZ; bfa_fcxp_attach()
540 INIT_LIST_HEAD(&mod->req_wait_q); bfa_fcxp_attach()
541 INIT_LIST_HEAD(&mod->rsp_wait_q); bfa_fcxp_attach()
543 claim_fcxps_mem(mod); bfa_fcxp_attach()
564 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); bfa_fcxp_iocdisable() local
569 list_splice_tail_init(&mod->fcxp_req_unused_q, &mod->fcxp_req_free_q); bfa_fcxp_iocdisable()
570 list_splice_tail_init(&mod->fcxp_rsp_unused_q, &mod->fcxp_rsp_free_q); bfa_fcxp_iocdisable()
572 list_for_each_safe(qe, qen, &mod->fcxp_active_q) { bfa_fcxp_iocdisable()
670 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; bfa_fcxp_put() local
674 bfa_q_deq(&mod->req_wait_q, &wqe); bfa_fcxp_put()
676 bfa_q_deq(&mod->rsp_wait_q, &wqe); bfa_fcxp_put()
679 bfa_trc(mod->bfa, fcxp->fcxp_tag); bfa_fcxp_put()
690 WARN_ON(!bfa_q_is_on_q(&mod->fcxp_active_q, fcxp)); bfa_fcxp_put()
694 list_add_tail(&fcxp->qe, &mod->fcxp_req_free_q); bfa_fcxp_put()
696 list_add_tail(&fcxp->qe, &mod->fcxp_rsp_free_q); bfa_fcxp_put()
724 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); hal_fcxp_send_comp() local
741 fcxp = BFA_FCXP_FROM_TAG(mod, fcxp_tag); hal_fcxp_send_comp()
745 hal_fcxp_rx_plog(mod->bfa, fcxp, fcxp_rsp); hal_fcxp_send_comp()
748 bfa_trc(mod->bfa, (NULL == fcxp->caller)); hal_fcxp_send_comp()
977 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; bfa_fcxp_get_reqbuf() local
981 reqbuf = bfa_mem_get_dmabuf_kva(mod, fcxp->fcxp_tag, bfa_fcxp_get_reqbuf()
982 mod->req_pld_sz + mod->rsp_pld_sz); bfa_fcxp_get_reqbuf()
989 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; bfa_fcxp_get_reqbufsz() local
991 return mod->req_pld_sz; bfa_fcxp_get_reqbufsz()
1004 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; bfa_fcxp_get_rspbuf() local
1009 fcxp_buf = bfa_mem_get_dmabuf_kva(mod, fcxp->fcxp_tag, bfa_fcxp_get_rspbuf()
1010 mod->req_pld_sz + mod->rsp_pld_sz); bfa_fcxp_get_rspbuf()
1013 return ((u8 *) fcxp_buf) + mod->req_pld_sz; bfa_fcxp_get_rspbuf()
1026 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; bfa_fcxp_free() local
1029 bfa_trc(mod->bfa, fcxp->fcxp_tag); bfa_fcxp_free()
1120 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); bfa_fcxp_req_rsp_alloc_wait() local
1123 WARN_ON(!list_empty(&mod->fcxp_req_free_q)); bfa_fcxp_req_rsp_alloc_wait()
1125 WARN_ON(!list_empty(&mod->fcxp_rsp_free_q)); bfa_fcxp_req_rsp_alloc_wait()
1139 list_add_tail(&wqe->qe, &mod->req_wait_q); bfa_fcxp_req_rsp_alloc_wait()
1141 list_add_tail(&wqe->qe, &mod->rsp_wait_q); bfa_fcxp_req_rsp_alloc_wait()
1147 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); bfa_fcxp_walloc_cancel() local
1149 WARN_ON(!bfa_q_is_on_q(&mod->req_wait_q, wqe) || bfa_fcxp_walloc_cancel()
1150 !bfa_q_is_on_q(&mod->rsp_wait_q, wqe)); bfa_fcxp_walloc_cancel()
1188 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); bfa_fcxp_get_maxrsp() local
1190 return mod->rsp_pld_sz; bfa_fcxp_get_maxrsp()
1196 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); bfa_fcxp_res_recfg() local
1200 for (i = 0; i < (mod->num_fcxps - num_fcxp_fw); i++) { bfa_fcxp_res_recfg()
1201 if (i < ((mod->num_fcxps - num_fcxp_fw) / 2)) { bfa_fcxp_res_recfg()
1202 bfa_q_deq_tail(&mod->fcxp_req_free_q, &qe); bfa_fcxp_res_recfg()
1203 list_add_tail(qe, &mod->fcxp_req_unused_q); bfa_fcxp_res_recfg()
1205 bfa_q_deq_tail(&mod->fcxp_rsp_free_q, &qe); bfa_fcxp_res_recfg()
1206 list_add_tail(qe, &mod->fcxp_rsp_unused_q); bfa_fcxp_res_recfg()
1533 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_attach() local
1537 mod->num_lps = BFA_LPS_MAX_LPORTS; bfa_lps_attach()
1539 mod->num_lps = BFA_LPS_MIN_LPORTS; bfa_lps_attach()
1541 mod->num_lps = BFA_LPS_MAX_LPORTS; bfa_lps_attach()
1542 mod->lps_arr = lps = (struct bfa_lps_s *) bfa_mem_kva_curp(mod); bfa_lps_attach()
1544 bfa_mem_kva_curp(mod) += mod->num_lps * sizeof(struct bfa_lps_s); bfa_lps_attach()
1546 INIT_LIST_HEAD(&mod->lps_free_q); bfa_lps_attach()
1547 INIT_LIST_HEAD(&mod->lps_active_q); bfa_lps_attach()
1548 INIT_LIST_HEAD(&mod->lps_login_q); bfa_lps_attach()
1550 for (i = 0; i < mod->num_lps; i++, lps++) { bfa_lps_attach()
1555 list_add_tail(&lps->qe, &mod->lps_free_q); bfa_lps_attach()
1580 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_iocdisable() local
1584 list_for_each_safe(qe, qen, &mod->lps_active_q) { bfa_lps_iocdisable()
1588 list_for_each_safe(qe, qen, &mod->lps_login_q) { bfa_lps_iocdisable()
1592 list_splice_tail_init(&mod->lps_login_q, &mod->lps_active_q); bfa_lps_iocdisable()
1601 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_login_rsp() local
1604 WARN_ON(rsp->bfa_tag >= mod->num_lps); bfa_lps_login_rsp()
1605 lps = BFA_LPS_FROM_TAG(mod, rsp->bfa_tag); bfa_lps_login_rsp()
1647 list_add_tail(&lps->qe, &mod->lps_active_q); bfa_lps_login_rsp()
1655 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_no_res() local
1669 list_add_tail(&lps->qe, &mod->lps_active_q); bfa_lps_no_res()
1682 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_logout_rsp() local
1685 WARN_ON(rsp->bfa_tag >= mod->num_lps); bfa_lps_logout_rsp()
1686 lps = BFA_LPS_FROM_TAG(mod, rsp->bfa_tag); bfa_lps_logout_rsp()
1697 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_rx_cvl_event() local
1700 lps = BFA_LPS_FROM_TAG(mod, cvl->bfa_tag); bfa_lps_rx_cvl_event()
1722 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa); bfa_lps_free() local
1726 list_add_tail(&lps->qe, &mod->lps_free_q); bfa_lps_free()
1735 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa); bfa_lps_send_login() local
1754 list_add_tail(&lps->qe, &mod->lps_login_q); bfa_lps_send_login()
1917 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_alloc() local
1920 bfa_q_deq(&mod->lps_free_q, &lps); bfa_lps_alloc()
1925 list_add_tail(&lps->qe, &mod->lps_active_q); bfa_lps_alloc()
1988 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_get_fwtag() local
1990 return BFA_LPS_FROM_TAG(mod, lp_tag)->fw_tag; bfa_lps_get_fwtag()
1999 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_get_tag_from_pid() local
2003 for (i = 0, lps = mod->lps_arr; i < mod->num_lps; i++, lps++) { bfa_lps_get_tag_from_pid()
2019 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); bfa_lps_get_base_pid() local
2021 return BFA_LPS_FROM_TAG(mod, 0)->lp_pid; bfa_lps_get_base_pid()
4906 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); bfa_rport_attach() local
4910 INIT_LIST_HEAD(&mod->rp_free_q); bfa_rport_attach()
4911 INIT_LIST_HEAD(&mod->rp_active_q); bfa_rport_attach()
4912 INIT_LIST_HEAD(&mod->rp_unused_q); bfa_rport_attach()
4914 rp = (struct bfa_rport_s *) bfa_mem_kva_curp(mod); bfa_rport_attach()
4915 mod->rps_list = rp; bfa_rport_attach()
4916 mod->num_rports = cfg->fwcfg.num_rports; bfa_rport_attach()
4918 WARN_ON(!mod->num_rports || bfa_rport_attach()
4919 (mod->num_rports & (mod->num_rports - 1))); bfa_rport_attach()
4921 for (i = 0; i < mod->num_rports; i++, rp++) { bfa_rport_attach()
4931 list_add_tail(&rp->qe, &mod->rp_free_q); bfa_rport_attach()
4939 bfa_mem_kva_curp(mod) = (u8 *) rp; bfa_rport_attach()
4960 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); bfa_rport_iocdisable() local
4965 list_splice_tail_init(&mod->rp_unused_q, &mod->rp_free_q); bfa_rport_iocdisable()
4967 list_for_each_safe(qe, qen, &mod->rp_active_q) { bfa_rport_iocdisable()
4974 bfa_rport_alloc(struct bfa_rport_mod_s *mod) bfa_rport_alloc() argument
4978 bfa_q_deq(&mod->rp_free_q, &rport); bfa_rport_alloc()
4980 list_add_tail(&rport->qe, &mod->rp_active_q); bfa_rport_alloc()
4988 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(rport->bfa); bfa_rport_free() local
4990 WARN_ON(!bfa_q_is_on_q(&mod->rp_active_q, rport)); bfa_rport_free()
4992 list_add_tail(&rport->qe, &mod->rp_free_q); bfa_rport_free()
5145 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); bfa_rport_res_recfg() local
5149 for (i = 0; i < (mod->num_rports - num_rport_fw); i++) { bfa_rport_res_recfg()
5150 bfa_q_deq_tail(&mod->rp_free_q, &qe); bfa_rport_res_recfg()
5151 list_add_tail(qe, &mod->rp_unused_q); bfa_rport_res_recfg()
5287 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); bfa_sgpg_attach() local
5300 INIT_LIST_HEAD(&mod->sgpg_q); bfa_sgpg_attach()
5301 INIT_LIST_HEAD(&mod->sgpg_wait_q); bfa_sgpg_attach()
5305 mod->free_sgpgs = mod->num_sgpgs = cfg->drvcfg.num_sgpgs; bfa_sgpg_attach()
5311 hsgpg = (struct bfa_sgpg_s *) bfa_mem_kva_curp(mod); bfa_sgpg_attach()
5313 bfa_mem_dma_seg_iter(mod, seg_ptr, nsegs, idx) { bfa_mem_dma_seg_iter()
5335 list_add_tail(&hsgpg->qe, &mod->sgpg_q); bfa_mem_dma_seg_iter()
5343 bfa_mem_kva_curp(mod) = (u8 *) hsgpg;
5369 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); bfa_sgpg_malloc() local
5373 if (mod->free_sgpgs < nsgpgs) bfa_sgpg_malloc()
5377 bfa_q_deq(&mod->sgpg_q, &hsgpg); bfa_sgpg_malloc()
5382 mod->free_sgpgs -= nsgpgs; bfa_sgpg_malloc()
5389 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); bfa_sgpg_mfree() local
5392 mod->free_sgpgs += nsgpg; bfa_sgpg_mfree()
5393 WARN_ON(mod->free_sgpgs > mod->num_sgpgs); bfa_sgpg_mfree()
5395 list_splice_tail_init(sgpg_q, &mod->sgpg_q); bfa_sgpg_mfree()
5397 if (list_empty(&mod->sgpg_wait_q)) bfa_sgpg_mfree()
5404 wqe = bfa_q_first(&mod->sgpg_wait_q); bfa_sgpg_mfree()
5405 if (mod->free_sgpgs < wqe->nsgpg) bfa_sgpg_mfree()
5406 nsgpg = mod->free_sgpgs; bfa_sgpg_mfree()
5415 } while (mod->free_sgpgs && !list_empty(&mod->sgpg_wait_q)); bfa_sgpg_mfree()
5421 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); bfa_sgpg_wait() local
5424 WARN_ON(nsgpg <= mod->free_sgpgs); bfa_sgpg_wait()
5431 if (mod->free_sgpgs) { bfa_sgpg_wait()
5435 WARN_ON(!list_empty(&mod->sgpg_wait_q)); bfa_sgpg_wait()
5436 list_splice_tail_init(&mod->sgpg_q, &wqe->sgpg_q); bfa_sgpg_wait()
5437 wqe->nsgpg -= mod->free_sgpgs; bfa_sgpg_wait()
5438 mod->free_sgpgs = 0; bfa_sgpg_wait()
5441 list_add_tail(&wqe->qe, &mod->sgpg_wait_q); bfa_sgpg_wait()
5447 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); bfa_sgpg_wcancel() local
5449 WARN_ON(!bfa_q_is_on_q(&mod->sgpg_wait_q, wqe)); bfa_sgpg_wcancel()
5766 struct bfa_uf_mod_s *mod = BFA_UF_MOD(bfa); bfa_uf_res_recfg() local
5770 for (i = 0; i < (mod->num_ufs - num_uf_fw); i++) { bfa_uf_res_recfg()
5771 bfa_q_deq_tail(&mod->uf_free_q, &qe); bfa_uf_res_recfg()
5772 list_add_tail(qe, &mod->uf_unused_q); bfa_uf_res_recfg()
H A Dbfa_fcs.c74 struct bfa_fcs_mod_s *mod; bfa_fcs_attach() local
85 mod = &fcs_modules[i]; bfa_fcs_attach()
86 if (mod->attach) bfa_fcs_attach()
87 mod->attach(fcs); bfa_fcs_attach()
98 struct bfa_fcs_mod_s *mod; bfa_fcs_init() local
101 mod = &fcs_modules[i]; bfa_fcs_init()
102 if (mod->modinit) bfa_fcs_init()
103 mod->modinit(fcs); bfa_fcs_init()
182 struct bfa_fcs_mod_s *mod; bfa_fcs_exit() local
191 mod = &fcs_modules[i]; bfa_fcs_exit()
192 if (mod->modexit) { bfa_fcs_exit()
194 mod->modexit(fcs); bfa_fcs_exit()
/linux-4.4.14/drivers/staging/lustre/lustre/include/
H A Dlu_object.h1113 #define LU_KEY_INIT(mod, type) \
1114 static void *mod##_key_init(const struct lu_context *ctx, \
1127 struct __##mod##__dummy_init {; } /* semicolon catcher */
1129 #define LU_KEY_FINI(mod, type) \
1130 static void mod##_key_fini(const struct lu_context *ctx, \
1137 struct __##mod##__dummy_fini {; } /* semicolon catcher */
1139 #define LU_KEY_INIT_FINI(mod, type) \
1140 LU_KEY_INIT(mod, type); \
1141 LU_KEY_FINI(mod, type)
1143 #define LU_CONTEXT_KEY_DEFINE(mod, tags) \
1144 struct lu_context_key mod##_thread_key = { \
1146 .lct_init = mod##_key_init, \
1147 .lct_fini = mod##_key_fini \
1167 #define LU_KEY_INIT_GENERIC(mod) \
1168 static void mod##_key_init_generic(struct lu_context_key *k, ...) \
1181 #define LU_TYPE_INIT(mod, ...) \
1182 LU_KEY_INIT_GENERIC(mod) \
1183 static int mod##_type_init(struct lu_device_type *t) \
1185 mod##_key_init_generic(__VA_ARGS__, NULL); \
1188 struct __##mod##_dummy_type_init {; }
1190 #define LU_TYPE_FINI(mod, ...) \
1191 static void mod##_type_fini(struct lu_device_type *t) \
1195 struct __##mod##_dummy_type_fini {; }
1197 #define LU_TYPE_START(mod, ...) \
1198 static void mod##_type_start(struct lu_device_type *t) \
1202 struct __##mod##_dummy_type_start {; }
1204 #define LU_TYPE_STOP(mod, ...) \
1205 static void mod##_type_stop(struct lu_device_type *t) \
1209 struct __##mod##_dummy_type_stop {; }
1211 #define LU_TYPE_INIT_FINI(mod, ...) \
1212 LU_TYPE_INIT(mod, __VA_ARGS__); \
1213 LU_TYPE_FINI(mod, __VA_ARGS__); \
1214 LU_TYPE_START(mod, __VA_ARGS__); \
1215 LU_TYPE_STOP(mod, __VA_ARGS__)
H A Dobd.h1160 struct md_open_data **mod);
1253 struct md_open_data *mod; obd_mod_alloc() local
1255 mod = kzalloc(sizeof(*mod), GFP_NOFS); obd_mod_alloc()
1256 if (mod == NULL) obd_mod_alloc()
1258 atomic_set(&mod->mod_refcount, 1); obd_mod_alloc()
1259 return mod; obd_mod_alloc()
1262 #define obd_mod_get(mod) atomic_inc(&(mod)->mod_refcount)
1263 #define obd_mod_put(mod) \
1265 if (atomic_dec_and_test(&(mod)->mod_refcount)) { \
1266 if ((mod)->mod_open_req) \
1267 ptlrpc_req_finished((mod)->mod_open_req); \
1268 kfree(mod); \
/linux-4.4.14/fs/btrfs/
H A Ddir-item.c188 * we're searching in, and 'mod' tells us if you plan on deleting the
189 * item (use mod < 0) or changing the options (use mod > 0)
195 int mod) btrfs_lookup_dir_item()
199 int ins_len = mod < 0 ? -1 : 0; btrfs_lookup_dir_item()
200 int cow = mod != 0; btrfs_lookup_dir_item()
277 * we're searching in, and 'mod' tells us if you plan on deleting the
278 * item (use mod < 0) or changing the options (use mod > 0)
288 int mod) btrfs_lookup_dir_index_item()
292 int ins_len = mod < 0 ? -1 : 0; btrfs_lookup_dir_index_item()
293 int cow = mod != 0; btrfs_lookup_dir_index_item()
358 int mod) btrfs_lookup_xattr()
362 int ins_len = mod < 0 ? -1 : 0; btrfs_lookup_xattr()
363 int cow = mod != 0; btrfs_lookup_xattr()
191 btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u64 dir, const char *name, int name_len, int mod) btrfs_lookup_dir_item() argument
284 btrfs_lookup_dir_index_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u64 dir, u64 objectid, const char *name, int name_len, int mod) btrfs_lookup_dir_index_item() argument
354 btrfs_lookup_xattr(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u64 dir, const char *name, u16 name_len, int mod) btrfs_lookup_xattr() argument
H A Ddelayed-ref.c212 int mod; merge_ref() local
239 mod = next->ref_mod; merge_ref()
245 mod = -next->ref_mod; merge_ref()
249 ref->ref_mod += mod; merge_ref()
398 int mod; add_delayed_ref_tail_merge() local
426 mod = ref->ref_mod; add_delayed_ref_tail_merge()
431 mod = -exist->ref_mod; add_delayed_ref_tail_merge()
434 mod = -ref->ref_mod; add_delayed_ref_tail_merge()
436 exist->ref_mod += mod; add_delayed_ref_tail_merge()
507 * update the reference mod on the head to reflect this new operation, update_existing_head_ref()
516 * If we are going to from a positive ref mod to a negative or vice update_existing_head_ref()
H A Dinode-item.c418 struct btrfs_key *location, int mod) btrfs_lookup_inode()
420 int ins_len = mod < 0 ? -1 : 0; btrfs_lookup_inode()
421 int cow = mod != 0; btrfs_lookup_inode()
416 btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *location, int mod) btrfs_lookup_inode() argument
/linux-4.4.14/crypto/
H A Drsa.c19 * c = m^e mod n;
27 /* (2) c = m^e mod n */ _rsa_enc()
33 * m = c^d mod n;
41 /* (2) m = c^d mod n */ _rsa_dec()
47 * s = m^d mod n
55 /* (2) s = m^d mod n */ _rsa_sign()
61 * m = s^e mod n;
69 /* (2) m = s^e mod n */ _rsa_verify()
/linux-4.4.14/arch/cris/include/arch-v32/arch/hwregs/asm/
H A Dirq_nmi_defs_asm.h6 * file: ../../mod/irq_nmi.r
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/irq_nmi_defs_asm.h ../../mod/irq_nmi.r
/linux-4.4.14/drivers/irqchip/
H A Dirq-tb10x.c57 uint32_t im, mod, pol; tb10x_irq_set_type() local
63 mod = ab_irqctl_readreg(gc, AB_IRQCTL_SRC_MODE) | im; tb10x_irq_set_type()
71 mod ^= im; tb10x_irq_set_type()
76 mod ^= im; tb10x_irq_set_type()
91 ab_irqctl_writereg(gc, AB_IRQCTL_SRC_MODE, mod); tb10x_irq_set_type()
/linux-4.4.14/fs/xfs/
H A Dxfs_linux.h223 __u32 mod; xfs_do_div() local
227 mod = *(__u32 *)a % b; xfs_do_div()
229 return mod; xfs_do_div()
251 /* Side effect free 64 bit mod operation */ xfs_do_mod()
279 __u32 mod; xfs_do_div() local
283 mod = *(__u32 *)a % b; xfs_do_div()
285 return mod; xfs_do_div()
287 mod = do_div(*(__u64 *)a, b); xfs_do_div()
288 return mod; xfs_do_div()
295 /* Side effect free 64 bit mod operation */ xfs_do_mod()
/linux-4.4.14/arch/x86/crypto/
H A Daesni-intel_avx-x86_64.S148 # u8 shifted_hkey_1[16] store HashKey <<1 mod poly here
149 # u8 shifted_hkey_2[16] store HashKey^2 <<1 mod poly here
150 # u8 shifted_hkey_3[16] store HashKey^3 <<1 mod poly here
151 # u8 shifted_hkey_4[16] store HashKey^4 <<1 mod poly here
152 # u8 shifted_hkey_5[16] store HashKey^5 <<1 mod poly here
153 # u8 shifted_hkey_6[16] store HashKey^6 <<1 mod poly here
154 # u8 shifted_hkey_7[16] store HashKey^7 <<1 mod poly here
155 # u8 shifted_hkey_8[16] store HashKey^8 <<1 mod poly here
156 # u8 shifted_hkey_1_k[16] store XOR HashKey <<1 mod poly here (for Karatsuba purposes)
157 # u8 shifted_hkey_2_k[16] store XOR HashKey^2 <<1 mod poly here (for Karatsuba purposes)
158 # u8 shifted_hkey_3_k[16] store XOR HashKey^3 <<1 mod poly here (for Karatsuba purposes)
159 # u8 shifted_hkey_4_k[16] store XOR HashKey^4 <<1 mod poly here (for Karatsuba purposes)
160 # u8 shifted_hkey_5_k[16] store XOR HashKey^5 <<1 mod poly here (for Karatsuba purposes)
161 # u8 shifted_hkey_6_k[16] store XOR HashKey^6 <<1 mod poly here (for Karatsuba purposes)
162 # u8 shifted_hkey_7_k[16] store XOR HashKey^7 <<1 mod poly here (for Karatsuba purposes)
163 # u8 shifted_hkey_8_k[16] store XOR HashKey^8 <<1 mod poly here (for Karatsuba purposes)
166 HashKey = 16*11 # store HashKey <<1 mod poly here
167 HashKey_2 = 16*12 # store HashKey^2 <<1 mod poly here
168 HashKey_3 = 16*13 # store HashKey^3 <<1 mod poly here
169 HashKey_4 = 16*14 # store HashKey^4 <<1 mod poly here
170 HashKey_5 = 16*15 # store HashKey^5 <<1 mod poly here
171 HashKey_6 = 16*16 # store HashKey^6 <<1 mod poly here
172 HashKey_7 = 16*17 # store HashKey^7 <<1 mod poly here
173 HashKey_8 = 16*18 # store HashKey^8 <<1 mod poly here
174 HashKey_k = 16*19 # store XOR of HashKey <<1 mod poly here (for Karatsuba purposes)
175 HashKey_2_k = 16*20 # store XOR of HashKey^2 <<1 mod poly here (for Karatsuba purposes)
176 HashKey_3_k = 16*21 # store XOR of HashKey^3 <<1 mod poly here (for Karatsuba purposes)
177 HashKey_4_k = 16*22 # store XOR of HashKey^4 <<1 mod poly here (for Karatsuba purposes)
178 HashKey_5_k = 16*23 # store XOR of HashKey^5 <<1 mod poly here (for Karatsuba purposes)
179 HashKey_6_k = 16*24 # store XOR of HashKey^6 <<1 mod poly here (for Karatsuba purposes)
180 HashKey_7_k = 16*25 # store XOR of HashKey^7 <<1 mod poly here (for Karatsuba purposes)
181 HashKey_8_k = 16*26 # store XOR of HashKey^8 <<1 mod poly here (for Karatsuba purposes)
245 # GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0)
247 # Output: C = A*B*x mod poly, (i.e. >>1 )
248 # To compute GH = GH*HashKey mod poly, give HK = HashKey<<1 mod poly as input
249 # GH = GH * HK * x mod poly which is equivalent to GH*HashKey mod poly.
306 GHASH_MUL_AVX \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^2<<1 mod poly
307 vmovdqa \T5, HashKey_2(arg1) # [HashKey_2] = HashKey^2<<1 mod poly
312 GHASH_MUL_AVX \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^3<<1 mod poly
318 GHASH_MUL_AVX \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^4<<1 mod poly
324 GHASH_MUL_AVX \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^5<<1 mod poly
330 GHASH_MUL_AVX \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^6<<1 mod poly
336 GHASH_MUL_AVX \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^7<<1 mod poly
342 GHASH_MUL_AVX \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^8<<1 mod poly
352 ## num_initial_blocks = b mod 4#
1167 and $-16, %r13 # r13 = r13 - (r13 mod 16)
1281 and $15, %r13 # r13 = (arg4 mod 16)
1299 # number of bytes in plaintext mod 16)
1307 and $15, %r13 # r13 = (arg4 mod 16)
1322 # number of bytes in plaintext mod 16)
1464 ############### PRECOMPUTATION of HashKey<<1 mod poly from the HashKey
1476 vpxor %xmm2, %xmm6, %xmm6 # xmm6 holds the HashKey<<1 mod poly
1478 vmovdqa %xmm6, HashKey(arg1) # store HashKey<<1 mod poly
1537 # GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0)
1539 # Output: C = A*B*x mod poly, (i.e. >>1 )
1540 # To compute GH = GH*HashKey mod poly, give HK = HashKey<<1 mod poly as input
1541 # GH = GH * HK * x mod poly which is equivalent to GH*HashKey mod poly.
1585 GHASH_MUL_AVX2 \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^2<<1 mod poly
1586 vmovdqa \T5, HashKey_2(arg1) # [HashKey_2] = HashKey^2<<1 mod poly
1588 GHASH_MUL_AVX2 \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^3<<1 mod poly
1591 GHASH_MUL_AVX2 \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^4<<1 mod poly
1594 GHASH_MUL_AVX2 \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^5<<1 mod poly
1597 GHASH_MUL_AVX2 \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^6<<1 mod poly
1600 GHASH_MUL_AVX2 \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^7<<1 mod poly
1603 GHASH_MUL_AVX2 \T5, \HK, \T1, \T3, \T4, \T6, \T2 # T5 = HashKey^8<<1 mod poly
1611 ## num_initial_blocks = b mod 4#
2444 and $-16, %r13 # r13 = r13 - (r13 mod 16)
2558 and $15, %r13 # r13 = (arg4 mod 16)
2576 # (r13 is the number of bytes in plaintext mod 16)
2584 and $15, %r13 # r13 = (arg4 mod 16)
2599 # number of bytes in plaintext mod 16)
2740 ############### PRECOMPUTATION of HashKey<<1 mod poly from the HashKey
2752 vpxor %xmm2, %xmm6, %xmm6 # xmm6 holds the HashKey<<1 mod poly
2754 vmovdqa %xmm6, HashKey(arg1) # store HashKey<<1 mod poly
H A Dcrc32-pclmul_asm.S46 * [x4*128+32 mod P(x) << 32)]' << 1 = 0x154442bd4
49 * [(x4*128-32 mod P(x) << 32)]' << 1 = 0x1c6e41596
55 * [(x128+32 mod P(x) << 32)]' << 1 = 0x1751997d0
58 * [(x128-32 mod P(x) << 32)]' << 1 = 0x0ccaa009e
64 * [(x64 mod P(x) << 32)]' << 1 = 0x163cd6124
H A Dghash-clmulni-intel_asm.S42 * SHASH: operand2, hash_key << 1 mod poly
44 * DATA: operand1 * operand2 mod poly
H A Daesni-intel_asm.S75 #define HashKey 16*0 // store HashKey <<1 mod poly here
76 #define HashKey_2 16*1 // store HashKey^2 <<1 mod poly here
77 #define HashKey_3 16*2 // store HashKey^3 <<1 mod poly here
78 #define HashKey_4 16*3 // store HashKey^4 <<1 mod poly here
80 // bits of HashKey <<1 mod poly here
83 // bits of HashKey^2 <<1 mod poly here
86 // bits of HashKey^3 <<1 mod poly here
89 // bits of HashKey^4 <<1 mod poly here
154 /* GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0)
158 * Output: C = A*B*x mod poly, (i.e. >>1 )
159 * To compute GH = GH*HashKey mod poly, give HK = HashKey<<1 mod poly as input
160 * GH = GH * HK * x mod poly which is equivalent to GH*HashKey mod poly.
217 * num_initial_blocks = b mod 4
357 # TMP5 = HashKey^2<<1 (mod poly)
359 # HashKey_2 = HashKey^2<<1 (mod poly)
371 # TMP5 = HashKey^3<<1 (mod poly)
384 # TMP5 = HashKey^3<<1 (mod poly)
442 * num_initial_blocks = b mod 4
578 # TMP5 = HashKey^2<<1 (mod poly)
580 # HashKey_2 = HashKey^2<<1 (mod poly)
592 # TMP5 = HashKey^3<<1 (mod poly)
605 # TMP5 = HashKey^3<<1 (mod poly)
1299 # Precompute HashKey<<1 (mod poly) from the hash key (required for GHASH)
1314 pxor %xmm2, %xmm13 # %xmm13 holds the HashKey<<1 (mod poly)
1319 movdqa %xmm13, HashKey(%rsp) # store HashKey<<1 (mod poly)
1321 and $-16, %r13 # %r13 = %r13 - (%r13 mod 16)
1362 and $15, %r13 # %r13 = arg4 (mod 16)
1378 # (%r13 is the number of bytes in plaintext mod 16)
1559 # precompute HashKey<<1 mod poly from the HashKey (required for GHASH)
1576 mov %arg4, %r13 # %xmm13 holds HashKey<<1 (mod poly)
1624 and $15, %r13 # %r13 = arg4 (mod 16)
1640 # (%r13 is the number of bytes in plaintext mod 16)
H A Dcrct10dif-pcl-asm_64.S564 # rk1 = 2^(32*3) mod Q << 32
565 # rk2 = 2^(32*5) mod Q << 32
566 # rk3 = 2^(32*15) mod Q << 32
567 # rk4 = 2^(32*17) mod Q << 32
568 # rk5 = 2^(32*3) mod Q << 32
569 # rk6 = 2^(32*2) mod Q << 32
/linux-4.4.14/kernel/gcov/
H A Dbase.c135 struct module *mod = data; gcov_module_notifier() local
145 if (within(info, mod->module_core, mod->core_size)) { gcov_module_notifier()
/linux-4.4.14/sound/soc/intel/haswell/
H A Dsst-haswell-dsp.c92 struct sst_module *mod; hsw_parse_module() local
120 mod = sst_module_new(fw, &template, NULL); hsw_parse_module()
121 if (mod == NULL) hsw_parse_module()
131 sst_module_free(mod); hsw_parse_module()
138 mod->offset = hsw_parse_module()
140 mod->type = SST_MEM_IRAM; hsw_parse_module()
145 mod->offset = block->ram_offset; hsw_parse_module()
146 mod->type = SST_MEM_DRAM; hsw_parse_module()
151 sst_module_free(mod); hsw_parse_module()
155 mod->size = block->size; hsw_parse_module()
156 mod->data = (void *)block + sizeof(*block); hsw_parse_module()
157 mod->data_offset = mod->data - fw->dma_buf; hsw_parse_module()
161 count, mod->type, block->size, ram, hsw_parse_module()
164 ret = sst_module_alloc_blocks(mod); hsw_parse_module()
168 sst_module_free(mod); hsw_parse_module()
174 mod->state = SST_MODULE_STATE_LOADED; hsw_parse_module()
/linux-4.4.14/drivers/scsi/sym53c8xx_2/
H A Dsym_defs.h179 #define SRST 0x40 /* mod: reset chip */
205 #define FM 0x02 /* mod: fetch pin mode */
206 #define WRIE 0x01 /* mod: write and invalidate enable */
213 #define BDIS 0x80 /* mod: burst disable */
214 #define MPEE 0x08 /* mod: master parity error enable */
217 #define DFS 0x20 /* mod: dma fifo size */
233 #define BL_2 0x80 /* mod: burst length shift value +2 */
234 #define BL_1 0x40 /* mod: burst length shift value +1 */
235 #define ERL 0x08 /* mod: enable read line */
236 #define ERMP 0x04 /* mod: enable read multiple */
237 #define BOF 0x02 /* mod: burst op code fetch */
243 #define CLSE 0x80 /* mod: cache line size enable */
245 #define PFEN 0x20 /* mod: pre-fetch enable */
246 #define SSM 0x10 /* mod: single step mode */
247 #define IRQM 0x08 /* mod: irq mode (1 = totem pole !) */
249 #define IRQD 0x02 /* mod: irq disable */
/linux-4.4.14/drivers/media/platform/vivid/
H A Dvivid-radio-common.c120 int mod = 16000; vivid_radio_calc_sig_qual() local
122 int sig_qual, sig_qual_tx = mod; vivid_radio_calc_sig_qual()
129 mod /= 10; vivid_radio_calc_sig_qual()
132 sig_qual = (dev->radio_rx_freq + delta) % mod - delta; vivid_radio_calc_sig_qual()
/linux-4.4.14/arch/tile/lib/
H A Dstrlen_32.c26 * This expression works because we know shift counts are taken mod 32. strlen()
H A Dmemchr_32.c44 * shift counts are taken mod 32. memchr()
H A Dstrchr_32.c36 * counts are taken mod 32. strchr()
H A Dstring-endian.h16 * The MASK expression works because shift counts are taken mod 64.
H A Dmemset_32.c90 /* Align out32 mod the cache line size so we can use wh64. */ memset()
H A Dmemset_64.c89 /* Align out64 mod the cache line size so we can use wh64. */ memset()
/linux-4.4.14/arch/xtensa/lib/
H A Dmemset.S65 .align 4 # 1 mod 4 alignment for LOOPNEZ
66 .byte 0 # (0 mod 4 alignment for LBEG)
134 .byte 0 # 1 mod 4 alignment for LOOPNEZ
135 # (0 mod 4 alignment for LBEG)
H A Dusercopy.S85 bbsi.l a2, 0, .Ldst1mod2 # if dst is 1 mod 2
86 bbsi.l a2, 1, .Ldst2mod4 # if dst is 2 mod 4
128 .byte 0 # 1 mod 4 alignment for LOOPNEZ
129 # (0 mod 4 alignment for LBEG)
153 .align 4 # 1 mod 4 alignment for LOOPNEZ
154 .byte 0 # (0 mod 4 alignment for LBEG)
214 .byte 0 # 1 mod 4 alignement for LOOPNEZ
215 # (0 mod 4 alignment for LBEG)
H A Dstrncpy_user.S87 .Lsrc2mod4: # src address is 2 mod 4
109 .align 4 # 1 mod 4 alignment for LOOPNEZ
110 .byte 0 # (0 mod 4 alignment for LBEG)
186 .align 4 # 1 mod 4 alignment for LOOPNEZ
187 .byte 0 # (0 mod 4 alignment for LBEG)
H A Dmemcopy.S78 .byte 0 # 1 mod 4 alignment for LOOPNEZ
79 # (0 mod 4 alignment for LBEG)
135 _bbsi.l a2, 0, .Ldst1mod2 # if dst is 1 mod 2
136 _bbsi.l a2, 1, .Ldst2mod4 # if dst is 2 mod 4
137 .Ldstaligned: # return here from .Ldst?mod? once dst is aligned
344 .byte 0 # 1 mod 4 alignment for LOOPNEZ
345 # (0 mod 4 alignment for LBEG)
409 _bbsi.l a5, 0, .Lbackdst1mod2 # if dst is 1 mod 2
410 _bbsi.l a5, 1, .Lbackdst2mod4 # if dst is 2 mod 4
411 .Lbackdstaligned: # return here from .Lbackdst?mod? once dst is aligned
/linux-4.4.14/net/tipc/
H A Dcore.h121 static inline u16 mod(u16 x) mod() function
128 return mod(right - left) < 32768u; less_eq()
138 return less_eq(left, right) && (mod(right) != mod(left)); less()
/linux-4.4.14/arch/mips/kernel/
H A Dvpe.c182 static void layout_sections(struct module *mod, const Elf_Ehdr *hdr, layout_sections() argument
208 get_offset((unsigned long *)&mod->core_size, s); layout_sections()
212 mod->core_text_size = mod->core_size; layout_sections()
481 unsigned int nsecs, struct module *mod) simplify_symbols()
537 const char *strtab, struct module *mod) dump_elfsymbols()
552 struct module *mod) find_vpe_symbols()
583 struct module mod; /* so we can re-use the relocations code */ vpe_elfload() local
585 memset(&mod, 0, sizeof(struct module)); vpe_elfload()
586 strcpy(mod.name, "VPE loader"); vpe_elfload()
641 layout_sections(&mod, hdr, sechdrs, secstrings); vpe_elfload()
644 v->load_addr = alloc_progmem(mod.core_size); vpe_elfload()
672 hdr->e_shnum, &mod); vpe_elfload()
689 symindex, i, &mod); vpe_elfload()
692 symindex, i, &mod); vpe_elfload()
734 if ((find_vpe_symbols(v, sechdrs, symindex, strtab, &mod)) < 0) { vpe_elfload()
477 simplify_symbols(Elf_Shdr *sechdrs, unsigned int symindex, const char *strtab, const char *secstrings, unsigned int nsecs, struct module *mod) simplify_symbols() argument
536 dump_elfsymbols(Elf_Shdr *sechdrs, unsigned int symindex, const char *strtab, struct module *mod) dump_elfsymbols() argument
550 find_vpe_symbols(struct vpe *v, Elf_Shdr *sechdrs, unsigned int symindex, const char *strtab, struct module *mod) find_vpe_symbols() argument
H A Dcpu-bugs64.c31 static inline void align_mod(const int align, const int mod) align_mod() argument
42 : GCC_IMM_ASM() (align), GCC_IMM_ASM() (mod)); align_mod()
46 const int align, const int mod) mult_sh_align_mod()
75 align_mod(align, mod); mult_sh_align_mod()
106 align_mod(align, mod); mult_sh_align_mod()
45 mult_sh_align_mod(long *v1, long *v2, long *w, const int align, const int mod) mult_sh_align_mod() argument
/linux-4.4.14/arch/s390/include/asm/
H A Dlivepatch.h28 static inline int klp_write_module_reloc(struct module *mod, unsigned long klp_write_module_reloc() argument
/linux-4.4.14/arch/cris/include/arch-v32/arch/hwregs/
H A Dirq_nmi_defs.h6 * file: ../../mod/irq_nmi.r
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile irq_nmi_defs.h ../../mod/irq_nmi.r
H A DMakefile52 REGDESC += $(BASEDIR)/mod/dma_common/rtl/dma_regdes.r
54 REGDESC += $(BASEDIR)/io/bif/mod/extmem/extmem_regs.r
108 extmem_defs.h: $(BASEDIR)/io/bif/mod/extmem/extmem_regs.r
127 reg_map.h: $(DESIGNDIR)/top/rtl/global.rmap $(DESIGNDIR)/top/mod/modreg.rmap
129 reg_map_asm.h: $(DESIGNDIR)/top/rtl/global.rmap $(DESIGNDIR)/top/mod/modreg.rmap
/linux-4.4.14/arch/metag/kernel/
H A Dmodule.c163 Elf32_Shdr *sechdrs, struct module *mod) do_plt_call()
179 if (location >= mod->module_core do_plt_call()
180 && location < mod->module_core + mod->core_size) do_plt_call()
181 entry = (void *)sechdrs[mod->arch.core_plt_section].sh_addr; do_plt_call()
183 entry = (void *)sechdrs[mod->arch.init_plt_section].sh_addr; do_plt_call()
162 do_plt_call(void *location, Elf32_Addr val, Elf32_Shdr *sechdrs, struct module *mod) do_plt_call() argument
H A Dftrace.c96 int ftrace_make_nop(struct module *mod, ftrace_make_nop() argument
/linux-4.4.14/sound/pci/hda/
H A Dhda_bind.c182 const char *mod = NULL; request_codec_module() local
187 mod = "snd-hda-codec-hdmi"; request_codec_module()
192 mod = "snd-hda-codec-generic"; request_codec_module()
197 mod = modalias; request_codec_module()
201 if (mod) request_codec_module()
202 request_module(mod); request_codec_module()
/linux-4.4.14/drivers/iio/imu/
H A Dadis16400_core.c489 #define ADIS16400_GYRO_CHAN(mod, addr, bits) { \
492 .channel2 = IIO_MOD_ ## mod, \
499 .scan_index = ADIS16400_SCAN_GYRO_ ## mod, \
509 #define ADIS16400_ACCEL_CHAN(mod, addr, bits) { \
512 .channel2 = IIO_MOD_ ## mod, \
519 .scan_index = ADIS16400_SCAN_ACC_ ## mod, \
529 #define ADIS16400_MAGN_CHAN(mod, addr, bits) { \
532 .channel2 = IIO_MOD_ ## mod, \
538 .scan_index = ADIS16400_SCAN_MAGN_ ## mod, \
552 #define ADIS16400_MOD_TEMP_CHAN(mod, addr, bits) { \
556 .extend_name = ADIS16400_MOD_TEMP_NAME_ ## mod, \
564 .scan_index = ADIS16350_SCAN_TEMP_ ## mod, \
593 #define ADIS16400_INCLI_CHAN(mod, addr, bits) { \
596 .channel2 = IIO_MOD_ ## mod, \
601 .scan_index = ADIS16300_SCAN_INCLI_ ## mod, \
/linux-4.4.14/sound/mips/
H A Dhal2.c81 unsigned short mod; /* MOD value */ member in struct:hal2_codec
325 unsigned short mod; hal2_compute_rate() local
328 mod = 4 * 44100 / rate; hal2_compute_rate()
331 mod = 4 * 48000 / rate; hal2_compute_rate()
336 codec->mod = mod; hal2_compute_rate()
337 rate = 4 * codec->master / mod; hal2_compute_rate()
346 int mod = hal2->dac.mod; hal2_set_dac_rate() local
350 ((0xffff & (inc - mod - 1)) << 16) | inc); hal2_set_dac_rate()
357 int mod = hal2->adc.mod; hal2_set_adc_rate() local
361 ((0xffff & (inc - mod - 1)) << 16) | inc); hal2_set_adc_rate()
/linux-4.4.14/tools/iio/
H A Diio_event_monitor.c110 enum iio_modifier mod = IIO_EVENT_CODE_EXTRACT_MODIFIER(event->id); event_is_known() local
144 switch (mod) { event_is_known()
210 enum iio_modifier mod = IIO_EVENT_CODE_EXTRACT_MODIFIER(event->id); print_event() local
227 if (mod != IIO_NO_MOD) print_event()
228 printf("(%s)", iio_modifier_names[mod]); print_event()
/linux-4.4.14/arch/hexagon/kernel/
H A Dmodule.c38 * @mod - pointer to module
42 struct module *mod) module_frob_arch_sections()
63 mod->name); module_frob_arch_sections()
40 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) module_frob_arch_sections() argument
/linux-4.4.14/arch/arm/mach-imx/
H A Dhardware.h29 #define addr_in_module(addr, mod) \
30 ((unsigned long)(addr) - mod ## _BASE_ADDR < mod ## _SIZE)
/linux-4.4.14/drivers/media/radio/wl128x/
H A Dfmdrv_v4l2.c431 struct v4l2_modulator *mod) fm_v4l2_vidioc_g_modulator()
435 if (mod->index != 0) fm_v4l2_vidioc_g_modulator()
441 mod->txsubchans = ((fmdev->tx_data.aud_mode == FM_STEREO_MODE) ? fm_v4l2_vidioc_g_modulator()
446 mod->capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS | fm_v4l2_vidioc_g_modulator()
454 const struct v4l2_modulator *mod) fm_v4l2_vidioc_s_modulator()
461 if (mod->index != 0) fm_v4l2_vidioc_s_modulator()
472 aud_mode = (mod->txsubchans & V4L2_TUNER_SUB_STEREO) ? fm_v4l2_vidioc_s_modulator()
474 rds_mode = (mod->txsubchans & V4L2_TUNER_SUB_RDS) ? fm_v4l2_vidioc_s_modulator()
430 fm_v4l2_vidioc_g_modulator(struct file *file, void *priv, struct v4l2_modulator *mod) fm_v4l2_vidioc_g_modulator() argument
453 fm_v4l2_vidioc_s_modulator(struct file *file, void *priv, const struct v4l2_modulator *mod) fm_v4l2_vidioc_s_modulator() argument
/linux-4.4.14/scripts/kconfig/
H A Dconf.c181 case mod: conf_sym()
190 if (oldval != mod && sym_tristate_within_range(sym, mod)) conf_sym()
210 newval = mod; conf_sym()
249 case mod: conf_choice()
258 case mod: conf_choice()
395 if (sym->curr.tri != mod) conf()
486 printf(" --allmodconfig New config where all options are answered with mod\n"); conf_usage()
H A Dsymbol.c20 .curr = { "m", mod },
220 if (tri == mod && (sym->type != S_TRISTATE || modules_val == no))
232 if (tri == mod)
241 if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
402 if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) sym_calc_value()
483 if (type == S_BOOLEAN && val == mod) sym_tristate_within_range()
536 newval = mod; sym_toggle_tristate_value()
538 case mod: sym_toggle_tristate_value()
626 return sym_tristate_within_range(sym, mod); sym_string_within_range()
649 return sym_set_tristate_value(sym, mod); sym_set_string_value()
710 /* The visibility may limit the value from yes => mod */ sym_get_string_default()
730 /* transpose mod to yes if modules are not enabled */ sym_get_string_default()
731 if (val == mod) sym_get_string_default()
735 /* transpose mod to yes if type is bool */ sym_get_string_default()
736 if (sym->type == S_BOOLEAN && val == mod) sym_get_string_default()
744 case mod: return "m"; sym_get_string_default()
770 case mod: sym_get_string_value()
/linux-4.4.14/include/crypto/
H A Dpublic_key.h76 MPI y; /* DSA public-key value = g^x mod p */
103 MPI s; /* m^d mod n */
/linux-4.4.14/include/uapi/linux/
H A Dtarget_core_user.h28 * userspace should skip hdr->length bytes (mod cmdr_size) to find the
38 * hdr->length, mod cmdr_size. If cmd_tail doesn't equal cmd_head, it
/linux-4.4.14/arch/mips/include/asm/octeon/
H A Dcvmx-srxx-defs.h131 uint64_t mod:4; member in struct:cvmx_srxx_sw_tick_ctl::cvmx_srxx_sw_tick_ctl_s
137 uint64_t mod:4;
/linux-4.4.14/arch/sh/include/asm/
H A Dswitch_to_32.h28 "ldc.l @r2+, mod\n\t" \
39 "stc.l mod, @-r2\n\t" \
/linux-4.4.14/arch/sh/kernel/
H A Dmodule.c123 void module_arch_cleanup(struct module *mod) module_arch_cleanup() argument
125 module_dwarf_cleanup(mod); module_arch_cleanup()
H A Ddwarf.c738 unsigned char *end, struct module *mod) dwarf_parse_cie()
858 if (mod != NULL) dwarf_parse_cie()
859 list_add_tail(&cie->link, &mod->arch.cie_list); dwarf_parse_cie()
869 unsigned char *end, struct module *mod) dwarf_parse_fde()
950 if (mod != NULL) dwarf_parse_fde()
951 list_add_tail(&fde->link, &mod->arch.fde_list); dwarf_parse_fde()
1024 * @mod: the kernel module containing the .eh_frame section
1029 struct module *mod) dwarf_parse_section()
1066 err = dwarf_parse_cie(entry, p, len, end, mod); dwarf_parse_section()
1073 end, mod); dwarf_parse_section()
1128 * module_dwarf_cleanup - remove FDE/CIEs associated with @mod
1129 * @mod: the module that is being unloaded
1132 * @mod's .eh_frame section because @mod is being unloaded.
1134 void module_dwarf_cleanup(struct module *mod) module_dwarf_cleanup() argument
1142 list_for_each_entry_safe(cie, ctmp, &mod->arch.cie_list, link) { module_dwarf_cleanup()
1152 list_for_each_entry_safe(fde, ftmp, &mod->arch.fde_list, link) { module_dwarf_cleanup()
737 dwarf_parse_cie(void *entry, void *p, unsigned long len, unsigned char *end, struct module *mod) dwarf_parse_cie() argument
867 dwarf_parse_fde(void *entry, u32 entry_type, void *start, unsigned long len, unsigned char *end, struct module *mod) dwarf_parse_fde() argument
1028 dwarf_parse_section(char *eh_frame_start, char *eh_frame_end, struct module *mod) dwarf_parse_section() argument
/linux-4.4.14/arch/arm/mach-omap2/
H A Dprm2xxx.h117 #define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
118 #define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
/linux-4.4.14/drivers/scsi/
H A Dncr53c8xx.h699 #define SRST 0x40 /* mod: reset chip */
726 #define FM 0x02 /* mod: fetch pin mode */
727 #define WRIE 0x01 /* mod: write and invalidate enable */
735 #define BDIS 0x80 /* mod: burst disable */
736 #define MPEE 0x08 /* mod: master parity error enable */
739 #define DFS 0x20 /* mod: dma fifo size */
754 #define BL_2 0x80 /* mod: burst length shift value +2 */
755 #define BL_1 0x40 /* mod: burst length shift value +1 */
756 #define ERL 0x08 /* mod: enable read line */
757 #define ERMP 0x04 /* mod: enable read multiple */
758 #define BOF 0x02 /* mod: burst op code fetch */
764 #define CLSE 0x80 /* mod: cache line size enable */
766 #define PFEN 0x20 /* mod: pre-fetch enable */
767 #define EA 0x20 /* mod: 720 enable-ack */
768 #define SSM 0x10 /* mod: single step mode */
769 #define IRQM 0x08 /* mod: irq mode (1 = totem pole !) */
771 #define IRQD 0x02 /* mod: irq disable */
/linux-4.4.14/drivers/s390/cio/
H A Dorb.h22 u32 mod:1; /* modification control */ member in struct:cmd_orb
/linux-4.4.14/arch/x86/include/asm/
H A Dlivepatch.h36 int klp_write_module_reloc(struct module *mod, unsigned long type,
H A Dinst.h202 .macro MODRM mod opd1 opd2
203 .byte \mod | (\opd1 & 7) | ((\opd2 & 7) << 3)
H A Dalternative.h67 extern void alternatives_smp_module_add(struct module *mod, char *name,
70 extern void alternatives_smp_module_del(struct module *mod);
75 static inline void alternatives_smp_module_add(struct module *mod, char *name, alternatives_smp_module_add() argument
78 static inline void alternatives_smp_module_del(struct module *mod) {} alternatives_enable_smp() argument
/linux-4.4.14/arch/x86/tools/
H A Dgen-insn-attr-x86.awk235 function convert_operands(count,opnd, i,j,imm,mod)
238 mod = null
251 mod = "INAT_MODRM"
253 return add_flags(imm, mod)
/linux-4.4.14/samples/livepatch/
H A Dlivepatch-sample.c64 .mod = THIS_MODULE,
/linux-4.4.14/arch/powerpc/include/asm/
H A Dftrace.h56 struct module *mod; member in struct:dyn_arch_ftrace
H A Dmodule.h82 int module_trampoline_target(struct module *mod, u32 *trampoline,
/linux-4.4.14/arch/sh/include/uapi/asm/
H A Dptrace_32.h73 unsigned long mod; member in struct:pt_dspregs
/linux-4.4.14/drivers/video/console/
H A Dbitblit.c116 u32 shift_low = 0, mod = vc->vc_font.width % 8; bit_putcs_unaligned() local
132 shift_low, mod); bit_putcs_unaligned()
133 shift_low += mod; bit_putcs_unaligned()
153 u32 mod = vc->vc_font.width % 8, cnt, pitch, size; bit_putcs() local
184 if (!mod) bit_putcs()
H A Dfbcon_ccw.c30 int mod = vc->vc_font.height % 8; ccw_update_attr() local
33 if (mod) ccw_update_attr()
34 msk <<= (8 - mod); ccw_update_attr()
36 if (offset > mod) ccw_update_attr()
H A Dfbcon_ud.c125 u32 shift_low = 0, mod = vc->vc_font.width % 8; ud_putcs_unaligned() local
140 shift_low, mod); ud_putcs_unaligned()
141 shift_low += mod; ud_putcs_unaligned()
162 u32 mod = vc->vc_font.width % 8, cnt, pitch, size; ud_putcs() local
200 if (!mod) ud_putcs()
/linux-4.4.14/drivers/iio/accel/
H A Dmma9553.c114 enum iio_modifier mod; member in struct:mma9553_event_info
119 .mod = IIO_NO_MOD,
124 .mod = IIO_MOD_STILL,
129 .mod = IIO_MOD_STILL,
134 .mod = IIO_MOD_WALKING,
139 .mod = IIO_MOD_WALKING,
144 .mod = IIO_MOD_JOGGING,
149 .mod = IIO_MOD_JOGGING,
154 .mod = IIO_MOD_RUNNING,
159 .mod = IIO_MOD_RUNNING,
243 enum iio_modifier mod, mma9553_get_event()
250 data->events[i].info->mod == mod && mma9553_get_event()
1055 ev_prev_activity->info->mod, mma9553_event_handler()
1064 ev_activity->info->mod, mma9553_event_handler()
241 mma9553_get_event(struct mma9553_data *data, enum iio_chan_type type, enum iio_modifier mod, enum iio_event_direction dir) mma9553_get_event() argument
/linux-4.4.14/drivers/staging/lustre/lustre/libcfs/
H A Dprng.c37 * x(n)=a*x(n-1)+carry mod 2^16 and y(n)=b*y(n-1)+carry mod 2^16,
/linux-4.4.14/drivers/gpu/drm/nouveau/nvkm/subdev/bios/
H A DM0209.c124 u8 mod = bits % 8; nvbios_M0209Sp() local
126 info->data[i] = info->data[i] >> mod; nvbios_M0209Sp()
/linux-4.4.14/arch/alpha/lib/
H A Dev6-memcpy.S36 and $1, 7, $1 # E : are they the same mod 8?
39 /* source and dest are same mod 8 address */
/linux-4.4.14/fs/freevxfs/
H A Dvxfs_olt.h70 u_int32_t olt_mtime; /* time of last mod. (sec) */
71 u_int32_t olt_mutime; /* time of last mod. (usec) */
/linux-4.4.14/arch/sparc/kernel/
H A Dmodule.c57 struct module *mod) module_frob_arch_sections()
66 printk("%s: no symtab found.\n", mod->name); module_frob_arch_sections()
54 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) module_frob_arch_sections() argument
H A Dftrace.c55 int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, unsigned long addr) ftrace_make_nop() argument
/linux-4.4.14/drivers/macintosh/
H A Dwindfarm_core.c268 struct module *mod = ct->ops->owner; wf_put_control() local
270 module_put(mod); wf_put_control()
363 struct module *mod = sr->ops->owner; wf_put_sensor() local
365 module_put(mod); wf_put_sensor()
/linux-4.4.14/drivers/mtd/
H A Dmtdoops.c159 int i = 0, j, ret, mod; mtdoops_workfunc_erase() local
165 mod = (cxt->nextpage * record_size) % mtd->erasesize; mtdoops_workfunc_erase()
166 if (mod != 0) { mtdoops_workfunc_erase()
167 cxt->nextpage = cxt->nextpage + ((mtd->erasesize - mod) / record_size); mtdoops_workfunc_erase()
/linux-4.4.14/fs/hfsplus/
H A Dbtree.c77 u32 mod = max(node_size, block_size); hfsplus_calc_btree_clump_size() local
118 clump_size /= mod; hfsplus_calc_btree_clump_size()
119 clump_size *= mod; hfsplus_calc_btree_clump_size()
126 clump_size = mod; hfsplus_calc_btree_clump_size()
/linux-4.4.14/include/sound/
H A Dseq_device.h82 struct module *mod);
/linux-4.4.14/arch/parisc/include/asm/
H A Dpdcpat.h275 /* FIXME: mod[508] should really be a union of the various mod components */
281 unsigned long mod[508]; /* PAT cell module components */ member in struct:pdc_pat_cell_mod_maddr_block
289 extern int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long mod, unsigned long view_type, void *mem_addr);
/linux-4.4.14/arch/ia64/lib/
H A Didiv32.S20 # define OP mod
H A Didiv64.S20 # define OP mod
/linux-4.4.14/arch/avr32/kernel/
H A Dmodule.c22 void module_arch_freeing_init(struct module *mod) module_arch_freeing_init() argument
24 vfree(mod->arch.syminfo); module_arch_freeing_init()
25 mod->arch.syminfo = NULL; module_arch_freeing_init()
/linux-4.4.14/drivers/s390/crypto/
H A Dzcrypt_msgtype50.c189 unsigned char *mod, *exp, *inp; ICAMEX_msg_to_type50MEX_msg() local
201 mod = meb1->modulus + sizeof(meb1->modulus) - mod_len; ICAMEX_msg_to_type50MEX_msg()
211 mod = meb2->modulus + sizeof(meb2->modulus) - mod_len; ICAMEX_msg_to_type50MEX_msg()
222 mod = meb3->modulus + sizeof(meb3->modulus) - mod_len; ICAMEX_msg_to_type50MEX_msg()
227 if (copy_from_user(mod, mex->n_modulus, mod_len) || ICAMEX_msg_to_type50MEX_msg()
/linux-4.4.14/drivers/isdn/hardware/mISDN/
H A DmISDNisar.c943 int delay = (ch->mod == 3) ? 1000 : 200; isar_pump_statev_fax()
982 ch->mod = ch->newmod; isar_pump_statev_fax()
1014 ch->mod = ch->newmod; isar_pump_statev_fax()
1034 ch->cmd, 1, &ch->mod); isar_pump_statev_fax()
1367 ch->mod = para; isar_pump_cmd()
1372 (ch->cmd == PCTRL_CMD_FTM) && (ch->mod == para)) isar_pump_cmd()
1389 ch->mod = para; isar_pump_cmd()
1394 (ch->cmd == PCTRL_CMD_FTH) && (ch->mod == para)) isar_pump_cmd()
1411 ch->mod = para; isar_pump_cmd()
1416 (ch->cmd == PCTRL_CMD_FRM) && (ch->mod == para)) isar_pump_cmd()
1433 ch->mod = para; isar_pump_cmd()
1438 (ch->cmd == PCTRL_CMD_FRH) && (ch->mod == para)) isar_pump_cmd()
1548 pr_debug("%s: isar: new mod\n", ich->is->name); isar_l2l1()
/linux-4.4.14/drivers/media/dvb-frontends/
H A Dcx24120.c769 enum fe_modulation mod; member in struct:cx24120_modfec
775 /*delsys mod fec val */
830 c->modulation = modfec_lookup_table[idx].mod; cx24120_get_fec()
834 dev_dbg(&state->i2c->dev, "mod(%d), fec(%d), pilot(%d)\n", cx24120_get_fec()
876 enum fe_modulation mod; member in struct:cx24120_clock_ratios_table
884 /*delsys pilot mod fec m_rat n_rat rate */
937 if (clock_ratios_table[idx].mod != c->modulation) cx24120_set_clock_ratios()
1017 enum fe_modulation mod; member in struct:cx24120_modfec_table
1023 /*delsys mod fec val */
1049 static int cx24120_set_fec(struct cx24120_state *state, enum fe_modulation mod, cx24120_set_fec() argument
1054 dev_dbg(&state->i2c->dev, "(0x%02x,0x%02x)\n", mod, fec); cx24120_set_fec()
1062 if (modfec_table[idx].mod != mod) cx24120_set_fec()
/linux-4.4.14/drivers/staging/lustre/lustre/lov/
H A Dlov_offset.c82 * stripe, and it does its work "mod" the full length of all the stripes.
111 * on a 0 stripe, the "mod stripe width" math will pull it forward to the
237 * through the "mod stripe size" math. we detect it being shifted lov_stripe_intersects()
/linux-4.4.14/drivers/gpu/drm/i915/
H A Dintel_guc.h95 uint32_t db_cacheline; /* Cyclic counter mod pagesize */
/linux-4.4.14/arch/powerpc/crypto/
H A Dsha1.c89 /* Pad out to 56 mod 64 */ sha1_final()
/linux-4.4.14/tools/build/
H A Dfixdep.c44 * parser in scripts/mod/sumversion.c.
/linux-4.4.14/drivers/net/ethernet/brocade/bna/
H A Dbfa_ioc.c2125 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; bfa_ioc_mbox_attach() local
2128 INIT_LIST_HEAD(&mod->cmd_q); bfa_ioc_mbox_attach()
2130 mod->mbhdlr[mc].cbfn = NULL; bfa_ioc_mbox_attach()
2131 mod->mbhdlr[mc].cbarg = ioc->bfa; bfa_ioc_mbox_attach()
2139 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; bfa_ioc_mbox_poll() local
2148 if (list_empty(&mod->cmd_q)) bfa_ioc_mbox_poll()
2161 cmd = list_first_entry(&mod->cmd_q, struct bfa_mbox_cmd, qe); bfa_ioc_mbox_poll()
2180 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; bfa_ioc_mbox_flush() local
2183 while (!list_empty(&mod->cmd_q)) { bfa_ioc_mbox_flush()
2184 cmd = list_first_entry(&mod->cmd_q, struct bfa_mbox_cmd, qe); bfa_ioc_mbox_flush()
2637 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; bfa_nw_ioc_mbox_regisr() local
2639 mod->mbhdlr[mc].cbfn = cbfn; bfa_nw_ioc_mbox_regisr()
2640 mod->mbhdlr[mc].cbarg = cbarg; bfa_nw_ioc_mbox_regisr()
2655 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; bfa_nw_ioc_mbox_queue() local
2664 if (!list_empty(&mod->cmd_q)) { bfa_nw_ioc_mbox_queue()
2665 list_add_tail(&cmd->qe, &mod->cmd_q); bfa_nw_ioc_mbox_queue()
2674 list_add_tail(&cmd->qe, &mod->cmd_q); bfa_nw_ioc_mbox_queue()
2690 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; bfa_nw_ioc_mbox_isr() local
2704 if ((mc >= BFI_MC_MAX) || (mod->mbhdlr[mc].cbfn == NULL)) bfa_nw_ioc_mbox_isr()
2707 mod->mbhdlr[mc].cbfn(mod->mbhdlr[mc].cbarg, &m); bfa_nw_ioc_mbox_isr()

Completed in 5971 milliseconds

123