Changeset 096d11e5 in mainline for arch/sparc64/include/asm.h


Ignore:
Timestamp:
2005-12-22T11:09:02Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2cf5634
Parents:
d53aba3f
Message:

sparc64 work.
Add functions to read and write TICK and TICK_compare registers.
Add types describing TICK and TICK_compare registers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/include/asm.h

    rd53aba3f r096d11e5  
    5757}
    5858
     59/** Read TICK_compare Register.
     60 *
     61 * @return Value of TICK_comapre register.
     62 */
     63static inline __u64 tick_compare_read(void)
     64{
     65        __u64 v;
     66       
     67        __asm__ volatile ("rd %%tick_cmpr, %0\n" : "=r" (v));
     68       
     69        return v;
     70}
     71
     72/** Write TICK_compare Register.
     73 *
     74 * @param New value of TICK_comapre register.
     75 */
     76static inline void tick_compare_write(__u64 v)
     77{
     78        __asm__ volatile ("wr %0, %1, %%tick_cmpr\n" : : "r" (v), "i" (0));
     79}
     80
     81/** Read TICK Register.
     82 *
     83 * @return Value of TICK register.
     84 */
     85static inline __u64 tick_read(void)
     86{
     87        __u64 v;
     88       
     89        __asm__ volatile ("rdpr %%tick, %0\n" : "=r" (v));
     90       
     91        return v;
     92}
     93
     94/** Write TICK Register.
     95 *
     96 * @param New value of TICK register.
     97 */
     98static inline void tick_write(__u64 v)
     99{
     100        __asm__ volatile ("wrpr %0, %1, %%tick\n" : : "r" (v), "i" (0));
     101}
     102
    59103
    60104/** Enable interrupts.
     
    197241}
    198242
     243
     244
    199245void cpu_halt(void);
    200246void cpu_sleep(void);
Note: See TracChangeset for help on using the changeset viewer.