1 /* { dg-do compile } */
2 /* { dg-options "-Os -mlock -mswape -fno-reorder-blocks" } */
4 /* This caused an ICE in arc_ifcvt when the 1->3 state change was not
5 implemented for TYPE_UNCOND_BRANCH in arc_ccfsm_post_advance. */
7 typedef long __kernel_long_t
;
8 typedef __kernel_long_t __kernel_time_t
;
11 __kernel_time_t tv_sec
;
18 struct device
*parent
;
33 unsigned char enabled
;
34 unsigned char pending
;
38 struct rtc_class_ops
{
39 int (*open
)(struct device
*);
40 void (*release
)(struct device
*);
41 int (*ioctl
)(struct device
*, unsigned int, unsigned long);
42 int (*read_time
)(struct device
*, struct rtc_time
*);
43 int (*set_time
)(struct device
*, struct rtc_time
*);
44 int (*read_alarm
)(struct device
*, struct rtc_wkalrm
*);
45 int (*set_alarm
)(struct device
*, struct rtc_wkalrm
*);
46 //int (*proc)(struct device *, struct seq_file *);
47 int (*set_mmss
)(struct device
*, unsigned long secs
);
48 int (*read_callback
)(struct device
*, int data
);
49 int (*alarm_irq_enable
)(struct device
*, unsigned int enabled
);
60 const struct rtc_class_ops
*ops
;
61 // struct mutex ops_lock;
63 // struct cdev char_dev;
66 unsigned long irq_data
;
67 //spinlock_t irq_lock;
68 //wait_queue_head_t irq_queue;
69 //struct fasync_struct *async_queue;
71 //struct rtc_task *irq_task;
72 //spinlock_t irq_task_lock;
76 //struct timerqueue_head timerqueue;
77 //struct rtc_timer aie_timer;
78 //struct rtc_timer uie_rtctimer;
79 //struct hrtimer pie_timer;
81 //struct work_struct irqwork;
86 //struct work_struct uie_task;
87 //struct timer_list uie_timer;
90 unsigned int uie_irq_active
:1;
91 unsigned int stop_uie_polling
:1;
92 unsigned int uie_task_active
:1;
93 unsigned int uie_timer_active
:1;
97 extern void rtc_time_to_tm(unsigned long time
, struct rtc_time
*tm
);
98 extern struct rtc_device
*rtc_class_open(const char *name
);
99 extern void rtc_class_close(struct rtc_device
*rtc
);
100 extern int rtc_set_time (struct rtc_device
*rtc
, struct rtc_time
*tm
);
102 int rtc_set_ntp_time(struct timespec now
)
104 struct rtc_device
*rtc
;
108 if (now
.tv_nsec
< (1000000000L >> 1))
109 rtc_time_to_tm(now
.tv_sec
, &tm
);
111 rtc_time_to_tm(now
.tv_sec
+ 1, &tm
);
113 rtc
= rtc_class_open("rtc0");
117 if (rtc
->ops
&& (rtc
->ops
->set_time
|| rtc
->ops
->set_mmss
))
118 err
= rtc_set_time(rtc
, &tm
);
119 rtc_class_close(rtc
);