All of lore.kernel.org
 help / color / mirror / Atom feed
* the cost of EXPORT_SYMBOL_GPL
@ 2020-06-16 13:18 Tomek The Messenger
  2020-06-16 13:27 ` Greg KH
  0 siblings, 1 reply; 18+ messages in thread
From: Tomek The Messenger @ 2020-06-16 13:18 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1890 bytes --]

Hi
I am in the middle of implementation of various external kernel modules.
All kernel modules touch some board specific registers. For example let's
say we have 3 groups of register areas:
#define REG1_ADDR (0xFDEA7000)
#define REG1 _SIZE (0x3C0)
#define REG2_ADDR (0xFDEC4000)
#define REG2 _SIZE (0xFF8)
#define REG3_ADDR (0xFDEA6000)
#define REG3_SIZE (0x80)
And let's say we have 5 kernel modules:
A
B
C
D
E

Kernel module A touches only one 32-bit register X from REG1 space and a
lot of registers from REG2 space.
Kernel modules B,C,D touches various registers from REG1 and REG2 space but
not this one which kernel module A touches.
Kernel module E is the only one who touches registers from REG3 space. No
other kernel module touches REG3 space.

If I would implement the code in C++ in user space I would create dynamic
library for access to REG1,REG2,REG3 register space. Each 32-bit register
would have his own separate function to read,write to register. And then
each user space process A-E would be linked against this library during
compilation.
When programming in kernel I don't know what I should do.
Should I implement 6th external kernel module which implements all
operations on access to registers REG1,REG2,REG3??? There will be a lot of
EXPORT_SYMBOL_GPL. Or maybe this approach is NOK, I mean it is good but I
should only place in 6th helper kernel module functions which are used by
more than one kernel module. So for example functions for getting access to
REG3 address space or reg X from REG1 space should be not there. They
should be only in kernel module code A/E. Currently this is code which I
implemented. In 6th helper kernel module there are only registers which are
used by more than one kernel module. But I am not sure if it is good
approach. Maybe there should be there all registers access?

Could anybody help how to organize code here.

BR
Tomek

[-- Attachment #1.2: Type: text/html, Size: 2228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-06-17 18:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-16 13:18 the cost of EXPORT_SYMBOL_GPL Tomek The Messenger
2020-06-16 13:27 ` Greg KH
2020-06-17  7:58   ` Tomek The Messenger
2020-06-17  8:55     ` Greg KH
2020-06-17  9:17       ` Tomek The Messenger
2020-06-17  9:28         ` Tomek The Messenger
2020-06-17  9:41         ` Greg KH
2020-06-17 10:39           ` Tomek The Messenger
2020-06-17 12:24             ` Valdis Klētnieks
2020-06-17 12:31               ` Greg KH
2020-06-17 12:35           ` Martin Kaiser
2020-06-17 12:48             ` Tomek The Messenger
2020-06-17 13:20               ` Valdis Klētnieks
2020-06-17 13:34               ` Ahmad Fatoum
2020-06-17 14:26                 ` Tomek The Messenger
2020-06-17 15:08                   ` Greg KH
2020-06-17 18:33                   ` Valdis Klētnieks
2020-06-17 13:31             ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.