Skip to content

Revert "Move RealTimeClockLib header"#12291

Open
ardbiesheuvel wants to merge 1 commit intotianocore:masterfrom
ardbiesheuvel:revert-rtclib-removal
Open

Revert "Move RealTimeClockLib header"#12291
ardbiesheuvel wants to merge 1 commit intotianocore:masterfrom
ardbiesheuvel:revert-rtclib-removal

Conversation

@ardbiesheuvel
Copy link
Member

This reverts commit 57230ff.

RealTimeClockLib is not a generic library class that is intended to be used widely to get access to the RTC when the associated runtime services are not available in the calling context.

The purpose of RealTimeClockLib is to abstract the underlying hardware access from the generic RealTimeClockRuntimeDxe driver, which backs the runtime services.

This means it does not belong in a different package; it belongs in the same package as the driver.

…b header"

This reverts commit 57230ff.

RealTimeClockLib is not a generic library class that is intended to be
used widely to get access to the RTC when the associated runtime
services are not available in the calling context.

The purpose of RealTimeClockLib is to abstract the underlying hardware
access from the generic RealTimeClockRuntimeDxe driver, which backs the
runtime services.

This means it does not belong in a different package; it belongs in the
same package as the driver.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
@Flickdm
Copy link
Contributor

Flickdm commented Mar 13, 2026

Does this need to be marked a breaking change?

@felixpgithub
Copy link
Contributor

Ard,

I agree with your argumentation, but both RealTimeClockLib library class and RealTimeClockRuntimeDxe driver have no architectural dependencies. So, rather than moving RealTimeClockLib back to the EmbeddedPkg, shouldn't we instead move RealTimeClockRuntimeDxe driver to the MdeModulePkg?

@leiflindholm
Copy link
Member

Ard,

I agree with your argumentation, but both RealTimeClockLib library class and RealTimeClockRuntimeDxe driver have no architectural dependencies. So, rather than moving RealTimeClockLib back to the EmbeddedPkg, shouldn't we instead move RealTimeClockRuntimeDxe driver to the MdeModulePkg?

I was about to suggest the same.

There are several users of the header in edk2-platforms, and not all of them especially embedded.

@Flickdm
Copy link
Contributor

Flickdm commented Mar 13, 2026

@felixpgithub @leiflindholm

Not sure if you saw the full background but this was what sparked the conversation - not that I think this changes your positions
#12271

@ardbiesheuvel
Copy link
Member Author

Ard,
I agree with your argumentation, but both RealTimeClockLib library class and RealTimeClockRuntimeDxe driver have no architectural dependencies. So, rather than moving RealTimeClockLib back to the EmbeddedPkg, shouldn't we instead move RealTimeClockRuntimeDxe driver to the MdeModulePkg?

I was about to suggest the same.

There are several users of the header in edk2-platforms, and not all of them especially embedded.

Each of those platforms also includes EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf, which should be the only consumer of the library implementation.

If that belongs in MdeModulePkg too, we can migrate it but /that/ would be a breaking change.

I fail to see the motivation for the original commit, to migrate a library class that is only intended for use by a driver in EmbeddedPkg, and it is inviting misuse.

@felixpgithub
Copy link
Contributor

I fail to see the motivation for the original commit, to migrate a library class that is only intended for use by a driver in EmbeddedPkg, and it is inviting misuse.

Yes, I think the driver and the library should have been moved together.
It's similar to the ResetSystemLib/ResetSystemRuntimeDxe that are already in the MdeModulePkg.

Migrating RealTimeClockRuntimeDxe to MdeModulePkg would also help to reduce fragmentation between x64 and ARM projects. x64 projects are now using PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe, which can be replaced with RealTimeClockRuntimeDxe.inf and PC/AT compatible instance of RealTimeClockLib.
It can be done without moving anything, but then project are getting dependency on EmbeddedPkg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants