1. 13 Jan, 2022 1 commit
    • Austin Zhang's avatar
      atrtc: reads Century field from FADT table · e1ef6c0e
      Austin Zhang authored
      The ACPI spec describes the FADT->Century field as:
      
          The RTC CMOS RAM index to the century of data value (hundred and
          thousand year decimals).  If this field contains a zero, then the
          RTC centenary feature is not supported.  If this field has a non-zero
          value, then this field contains an index into RTC RAM space that
          OSPM can use to program the centenary field.
      
      Use this field to decide whether to program the CENTURY register
      of the CMOS RTC device.
      
      Reviewed by:	akumar3@isilon.com, dab, vangyzen
      MFC after:	1 week
      Sponsored by:	Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D33667
      
      MFC after:	1 week
      Sponsored by:	Dell EMC Isilon
      e1ef6c0e
  2. 01 Sep, 2020 2 commits
  3. 11 Mar, 2019 2 commits
  4. 10 Mar, 2019 2 commits
  5. 25 Jun, 2018 2 commits
  6. 13 Mar, 2018 2 commits
  7. 12 Mar, 2018 2 commits
  8. 11 Mar, 2018 12 commits
  9. 29 Jan, 2018 2 commits
  10. 16 Jan, 2018 6 commits
    • ian's avatar
      Remove redundant critical_enter/exit() calls. The block of code delimited · f0c14bee
      ian authored
      by these calls is now protected by a spin mutex (obscured within the
      RTC_LOCK/RTC_UNLOCK macros).
      
      Reported by:	bde@
      f0c14bee
    • Ian Lepore's avatar
      Remove redundant critical_enter/exit() calls. The block of code delimited · e7803246
      Ian Lepore authored
      by these calls is now protected by a spin mutex (obscured within the
      RTC_LOCK/RTC_UNLOCK macros).
      
      Reported by:	bde@
      e7803246
    • ian's avatar
      Move some code around and rename a couple variables; no functional changes. · 2fcaa5e7
      ian authored
      The static atrtc_set() function was called only from clock_settime(), so
      just move its contents entirely into clock_settime() and delete atrtc_set().
      
      Rename the struct bcd_clocktime variables from 'ct' to 'bct'.  I had
      originally wanted to emphasize how identical the clocktime and bcd_clocktime
      structs were, but things evolved to the point where the structs are not at
      all identical anymore, so now emphasizing the difference seems better.
      2fcaa5e7
    • Ian Lepore's avatar
      Move some code around and rename a couple variables; no functional changes. · 428cdf02
      Ian Lepore authored
      The static atrtc_set() function was called only from clock_settime(), so
      just move its contents entirely into clock_settime() and delete atrtc_set().
      
      Rename the struct bcd_clocktime variables from 'ct' to 'bct'.  I had
      originally wanted to emphasize how identical the clocktime and bcd_clocktime
      structs were, but things evolved to the point where the structs are not at
      all identical anymore, so now emphasizing the difference seems better.
      428cdf02
    • ian's avatar
      Add static inline rtcin_locked() and rtcout_locked() functions for doing a · 6ac58f60
      ian authored
      related series of operations without doing a lock/unlock for each byte.
      Use them when reading and writing the entire set of time registers.
      
      The original rtcin() and writertc() functions which do lock/unlock on each
      byte still exist, because they are public and called by outside code.
      6ac58f60
    • Ian Lepore's avatar
      Add static inline rtcin_locked() and rtcout_locked() functions for doing a · e5ef0142
      Ian Lepore authored
      related series of operations without doing a lock/unlock for each byte.
      Use them when reading and writing the entire set of time registers.
      
      The original rtcin() and writertc() functions which do lock/unlock on each
      byte still exist, because they are public and called by outside code.
      e5ef0142
  11. 15 Jan, 2018 2 commits
  12. 27 Nov, 2017 2 commits
    • pfg's avatar
      sys/x86: further adoption of SPDX licensing ID tags. · 921a5b48
      pfg authored
      Mainly focus on files that use BSD 2-Clause license, however the tool I
      was using misidentified many licenses so this was mostly a manual - error
      prone - task.
      
      The Software Package Data Exchange (SPDX) group provides a specification
      to make it easier for automated tools to detect and summarize well known
      opensource licenses. We are gradually adopting the specification, noting
      that the tags are considered only advisory and do not, in any way,
      superceed or replace the license texts.
      921a5b48
    • Pedro F. Giffuni's avatar
      sys/x86: further adoption of SPDX licensing ID tags. · ebf5747b
      Pedro F. Giffuni authored
      Mainly focus on files that use BSD 2-Clause license, however the tool I
      was using misidentified many licenses so this was mostly a manual - error
      prone - task.
      
      The Software Package Data Exchange (SPDX) group provides a specification
      to make it easier for automated tools to detect and summarize well known
      opensource licenses. We are gradually adopting the specification, noting
      that the tags are considered only advisory and do not, in any way,
      superceed or replace the license texts.
      ebf5747b
  13. 11 Aug, 2017 2 commits
    • ian's avatar
      Stop calling atrtc_set() from the xen timer clock_settime() method. That · 7ba2756f
      ian authored
      removes the only reference to atrtc_set() from outside of atrtc.c, so make
      it static.
      
      The xen timer driver registers as a realtime clock with 1us resolution.  In
      the past that resulted in only the xen timer's clock_settime() getting
      called, so it would call atrtc_set() to set the hardware clock as well.  As
      of r32090, the clock_settime() method of all registered realtime clocks gets
      called, so the xen driver no longer needs to chain-call the lower-resolution
      driver.
      
      Thanks to royger@ for talking me through the xen stuff, and for testing.
      7ba2756f
    • Ian Lepore's avatar
      Stop calling atrtc_set() from the xen timer clock_settime() method. That · c82d887d
      Ian Lepore authored
      removes the only reference to atrtc_set() from outside of atrtc.c, so make
      it static.
      
      The xen timer driver registers as a realtime clock with 1us resolution.  In
      the past that resulted in only the xen timer's clock_settime() getting
      called, so it would call atrtc_set() to set the hardware clock as well.  As
      of r32090, the clock_settime() method of all registered realtime clocks gets
      called, so the xen driver no longer needs to chain-call the lower-resolution
      driver.
      
      Thanks to royger@ for talking me through the xen stuff, and for testing.
      c82d887d
  14. 12 Jul, 2017 1 commit
    • ian's avatar
      Protect access to the AT realtime clock with its own mutex. · 24259940
      ian authored
      The mutex protecting access to the registered realtime clock should not be
      overloaded to protect access to the atrtc hardware, which might not even be
      the registered rtc. More importantly, the resettodr mutex needs to be
      eliminated to remove locking/sleeping restrictions on clock drivers, and
      that can't happen if MD code for amd64 depends on it. This change moves the
      protection into what's really being protected: access to the atrtc date and
      time registers.
      
      This change also adds protection when the clock is accessed from
      xentimer_settime(), which bypasses the resettodr locking.
      
      Differential Revision:	https://reviews.freebsd.org/D11483
      24259940