On 01/11/18 07:28, Pankaj Bansal wrote: > Hi Laszlo, > >> -----Original Message----- >> From: Laszlo Ersek [mailto:ler...@redhat.com] >> Sent: Wednesday, January 10, 2018 10:34 PM >> To: Pankaj Bansal <pankaj.ban...@nxp.com>; edk2-devel@lists.01.org >> Cc: Leif Lindholm <leif.lindh...@linaro.org>; Ard Biesheuvel >> <ard.biesheu...@linaro.org>; Michael Kinney <michael.d.kin...@intel.com> >> Subject: Re: [edk2] [PATCH 2/2] ArmPkg/ArmArchTimerLib: Implement >> GetElapsedTime function of TimerLib
>> (1) Please feel free to pick up my code and work on upstreaming it -- just >> please preserve my S-o-b on the patch(es) (in addition to yours), and the Red >> Hat copyright notice (in addition to your company's) in the new files. >> >> (2) Last time I counted (reading up on the original thread), there were >> 21 TimerLib instances in edk2. Adding the same function to every one of >> them looks terrible. In edk2, I know of only two ways to avoid this: >> >> - introduce a new library class (with class header file), and a simple >> library >> instance (implementation) >> >> - collect (=move) as many as possible of the existing library instances under >> common subdirectories, so that their INF files are basically in the same >> subdirectory. Then the new code can be implemented in a new C file, under >> the same subdirectory, and then all INF files can refer to the new C file >> directly. This kind of code sharing works very well if the library instances >> are >> otherwise closely related. It does not work at all if the library instances >> live in >> separate top-level packages (which is BTW the case here). >> >> >> It seems that Mike wasn't opposed to introducing a TimerTickDiffLib class (or >> something similar) to MdePkg. However, more work looked necessary than I >> had expected, esp. with regard to the caching of timer hardware >> characteristics (please see the last few messages in the thread >> -- either the code has to add its own caching, or all existing, suitable >> TimerLib >> instances have to be verified about caching). Again, please feel free to pick >> up the code and rework it as Mike suggests -- it's basically the >> GetTickDifference() function only that adds value. Feel free to hammer it >> into >> any shape or form necessary. > > Thank you. I will try to work on this problem of integrating these changes in > multiple > TimerLib instances, when I have some room on my plate. > For now, I guess I will just add wrapper functions on top of TimerLib APIs > for my Platform only. Sure, that works as well -- feel free to scavenge the code as you see fit. Thanks, Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel