Changeset 31282767 in rtems


Ignore:
Timestamp:
Jul 10, 2008, 6:43:45 AM (11 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, 4.9, master
Children:
eed04912
Parents:
780428f
Message:

changed names of internal macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h

    r780428f r31282767  
    253253}
    254254
     255/**
     256 * @brief Enables external exceptions.
     257 *
     258 * You can use this function to enable the external exceptions and restore the
     259 * machine state with ppc_external_exceptions_disable() later.
     260 */
    255261static inline uint32_t ppc_external_exceptions_enable()
    256262{
     
    270276}
    271277
     278/**
     279 * @brief Restores machine state.
     280 *
     281 * @see ppc_external_exceptions_enable()
     282 */
    272283static inline void ppc_external_exceptions_disable( uint32_t msr)
    273284{
     
    291302}
    292303
    293 #define PPC_RETURN_SPECIAL_PURPOSE_REGISTER( spr) \
     304/* Do not use the following macros.  Use the inline functions instead. */
     305
     306#define PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER( spr) \
    294307        uint32_t val; \
    295308        asm volatile ( \
     
    299312        return val;
    300313
    301 #define PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( spr) \
    302         PPC_RETURN_SPECIAL_PURPOSE_REGISTER( spr)
    303 
    304 #define PPC_SET_SPECIAL_PURPOSE_REGISTER( spr, val) \
     314#define PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( spr) \
     315        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER( spr)
     316
     317#define PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER( spr, val) \
    305318        asm volatile ( \
    306319                "mtspr " #spr ", %0" \
     
    309322        );
    310323
    311 #define PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( spr, val) \
    312         PPC_SET_SPECIAL_PURPOSE_REGISTER( spr, val)
     324#define PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( spr, val) \
     325        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER( spr, val)
    313326
    314327static inline uint32_t ppc_special_purpose_register_0()
    315328{
    316         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG0);
     329        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG0);
    317330}
    318331
    319332static inline void ppc_set_special_purpose_register_0( uint32_t val)
    320333{
    321         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG0, val);
     334        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG0, val);
    322335}
    323336
    324337static inline uint32_t ppc_special_purpose_register_1()
    325338{
    326         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG1);
     339        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG1);
    327340}
    328341
    329342static inline void ppc_set_special_purpose_register_1( uint32_t val)
    330343{
    331         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG1, val);
     344        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG1, val);
    332345}
    333346
    334347static inline uint32_t ppc_special_purpose_register_2()
    335348{
    336         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG2);
     349        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG2);
    337350}
    338351
    339352static inline void ppc_set_special_purpose_register_2( uint32_t val)
    340353{
    341         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG2, val);
     354        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG2, val);
    342355}
    343356
    344357static inline uint32_t ppc_special_purpose_register_3()
    345358{
    346         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG3);
     359        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG3);
    347360}
    348361
    349362static inline void ppc_set_special_purpose_register_3( uint32_t val)
    350363{
    351         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG3, val);
     364        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG3, val);
    352365}
    353366
    354367static inline uint32_t ppc_special_purpose_register_4()
    355368{
    356         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG4);
     369        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG4);
    357370}
    358371
    359372static inline void ppc_set_special_purpose_register_4( uint32_t val)
    360373{
    361         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG4, val);
     374        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG4, val);
    362375}
    363376
    364377static inline uint32_t ppc_special_purpose_register_5()
    365378{
    366         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG5);
     379        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG5);
    367380}
    368381
    369382static inline void ppc_set_special_purpose_register_5( uint32_t val)
    370383{
    371         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG5, val);
     384        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG5, val);
    372385}
    373386
    374387static inline uint32_t ppc_special_purpose_register_6()
    375388{
    376         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG6);
     389        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG6);
    377390}
    378391
    379392static inline void ppc_set_special_purpose_register_6( uint32_t val)
    380393{
    381         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG6, val);
     394        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG6, val);
    382395}
    383396
    384397static inline uint32_t ppc_special_purpose_register_7()
    385398{
    386         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG7);
     399        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG7);
    387400}
    388401
    389402static inline void ppc_set_special_purpose_register_7( uint32_t val)
    390403{
    391         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG7, val);
     404        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( SPRG7, val);
    392405}
    393406
    394407static inline uint32_t ppc_user_special_purpose_register_0()
    395408{
    396         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( USPRG0);
     409        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( USPRG0);
    397410}
    398411
    399412static inline void ppc_set_user_special_purpose_register_0( uint32_t val)
    400413{
    401         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( USPRG0, val);
     414        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( USPRG0, val);
    402415}
    403416
    404417static inline uint32_t ppc_timer_control_register()
    405418{
    406         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_TCR);
     419        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_TCR);
    407420}
    408421
    409422static inline void ppc_set_timer_control_register( uint32_t val)
    410423{
    411         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_TCR, val);
     424        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_TCR, val);
    412425}
    413426
    414427static inline uint32_t ppc_timer_status_register()
    415428{
    416         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_TSR);
     429        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_TSR);
    417430}
    418431
    419432static inline void ppc_set_timer_status_register( uint32_t val)
    420433{
    421         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_TSR, val);
     434        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_TSR, val);
    422435}
    423436
    424437static inline uint32_t ppc_decrementer_auto_reload_register()
    425438{
    426         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_DECAR);
     439        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_DECAR);
    427440}
    428441
    429442static inline void ppc_set_decrementer_auto_reload_register( uint32_t val)
    430443{
    431         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_DECAR, val);
     444        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( BOOKE_DECAR, val);
    432445}
    433446
    434447static inline uint32_t ppc_hardware_implementation_dependent_register_0()
    435448{
    436         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( HID0);
     449        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( HID0);
    437450}
    438451
    439452static inline void ppc_set_hardware_implementation_dependent_register_0( uint32_t val)
    440453{
    441         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( HID0, val);
     454        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( HID0, val);
    442455}
    443456
    444457static inline uint32_t ppc_hardware_implementation_dependent_register_1()
    445458{
    446         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( HID1);
     459        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( HID1);
    447460}
    448461
    449462static inline void ppc_set_hardware_implementation_dependent_register_1( uint32_t val)
    450463{
    451         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( HID1, val);
     464        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( HID1, val);
    452465}
    453466
     
    463476static inline void ppc_set_time_base( uint32_t val)
    464477{
    465         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( TBWL, val);
     478        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( TBWL, val);
    466479}
    467480
    468481static inline uint32_t ppc_time_base_upper()
    469482{
    470         PPC_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( TBRU);
     483        PPC_INTERNAL_MACRO_RETURN_SPECIAL_PURPOSE_REGISTER_EXPAND( TBRU);
    471484}
    472485
    473486static inline void ppc_set_time_base_upper( uint32_t val)
    474487{
    475         PPC_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( TBWU, val);
     488        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER_EXPAND( TBWU, val);
    476489}
    477490
Note: See TracChangeset for help on using the changeset viewer.