HSMs are generic devices that conform to APIs such as PKCS #11. They are accessible to any application that wants to use their services. While TPMs are usually more closely integrated with their host computers, their operating system, their booting sequence, or the built-in hard drive encryption.