@@ -27,62 +27,14 @@ static inline struct _cpu *z_arch_curr_cpu(void)
2727 return (struct _cpu * )(long )ret ;
2828}
2929
30- static inline unsigned int z_arch_irq_lock (void )
31- {
32- unsigned long long key ;
33-
34- __asm__ volatile ("pushfq; cli; popq %0" : "=r" (key ));
35- return (int )key ;
36- }
37-
38- static inline void z_arch_irq_unlock (unsigned int key )
39- {
40- if (key & 0x200 ) {
41- __asm__ volatile ("sti" );
42- }
43- }
44-
45- /**
46- * Returns true if interrupts were unlocked prior to the
47- * z_arch_irq_lock() call that produced the key argument.
48- */
49- static inline bool z_arch_irq_unlocked (unsigned int key )
50- {
51- return (key & 0x200 ) != 0 ;
52- }
53-
5430static inline void z_arch_nop (void )
5531{
5632 __asm__ volatile ("nop" );
5733}
5834
59- void z_arch_irq_disable (unsigned int irq );
60- void z_arch_irq_enable (unsigned int irq );
61-
62- /* Not a standard Zephyr function, but probably will be */
63- static inline unsigned long long z_arch_k_cycle_get_64 (void )
64- {
65- unsigned int hi , lo ;
66-
67- __asm__ volatile ("rdtsc" : "=d" (hi ), "=a" (lo ));
68- return (((unsigned long long )hi ) << 32 ) | lo ;
69- }
70-
71- static inline unsigned int z_arch_k_cycle_get_32 (void )
35+ static inline bool z_arch_is_in_isr (void )
7236{
73- #ifdef CONFIG_HPET_TIMER
74- extern u32_t z_timer_cycle_get_32 (void );
75- return z_timer_cycle_get_32 ();
76- #else
77- return (u32_t )z_arch_k_cycle_get_64 ();
78- #endif
79- }
80-
81- #define z_arch_is_in_isr () (z_arch_curr_cpu()->nested != 0)
82-
83- static inline void z_arch_switch (void * switch_to , void * * switched_from )
84- {
85- xuk_switch (switch_to , switched_from );
37+ return z_arch_curr_cpu ()-> nested != 0U ;
8638}
8739
8840static inline u32_t x86_apic_scaled_tsc (void )
@@ -95,21 +47,12 @@ static inline u32_t x86_apic_scaled_tsc(void)
9547 return (u32_t )(tsc >> CONFIG_XUK_APIC_TSC_SHIFT );
9648}
9749
98- void x86_apic_set_timeout (u32_t cyc_from_now );
99-
100- #define Z_ARCH_IRQ_CONNECT (irq , pri , isr , arg , flags ) \
101- z_arch_irq_connect_dynamic(irq, pri, isr, arg, flags)
102-
103- extern int x86_64_except_reason ;
104-
50+ static inline void z_arch_switch (void * switch_to , void * * switched_from )
51+ {
52+ xuk_switch (switch_to , switched_from );
53+ }
10554
106- /* Vector 5 is the "bounds" exception which is otherwise vestigial
107- * (BOUND is an illegal instruction in long mode)
108- */
109- #define Z_ARCH_EXCEPT (reason ) do { \
110- x86_64_except_reason = reason; \
111- __asm__ volatile("int $5"); \
112- } while (false)
55+ void x86_apic_set_timeout (u32_t cyc_from_now );
11356
11457void z_arch_sched_ipi (void );
11558
0 commit comments