Update Red Bear driver substrate
Red Bear OS Team
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef _LINUX_DEVICE_H
|
||||
#define _LINUX_DEVICE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include "types.h"
|
||||
#include <stddef.h>
|
||||
|
||||
struct device_driver {
|
||||
@@ -27,11 +27,7 @@ static inline void dev_set_drvdata(struct device *dev, void *data)
|
||||
dev->driver_data = data;
|
||||
}
|
||||
|
||||
struct class {
|
||||
const char *name;
|
||||
};
|
||||
|
||||
extern struct device *devm_kzalloc(struct device *dev, size_t size, gfp_t flags);
|
||||
extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t flags);
|
||||
extern void devm_kfree(struct device *dev, void *ptr);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef _LINUX_FIRMWARE_H
|
||||
#define _LINUX_FIRMWARE_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct firmware {
|
||||
@@ -23,4 +24,6 @@ extern int request_firmware_nowait(
|
||||
extern int request_firmware_direct(const struct firmware **fw,
|
||||
const char *name, struct device *dev);
|
||||
|
||||
#define FW_ACTION_HOTPLUG 0
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,29 +3,16 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
static inline int in_interrupt(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
extern void local_irq_save(unsigned long *flags);
|
||||
extern void local_irq_restore(unsigned long flags);
|
||||
extern void local_irq_disable(void);
|
||||
extern void local_irq_enable(void);
|
||||
extern int irqs_disabled(void);
|
||||
|
||||
static inline int in_irq(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void local_irq_save(unsigned long *flags)
|
||||
{
|
||||
(void)flags;
|
||||
}
|
||||
|
||||
static inline void local_irq_restore(unsigned long flags)
|
||||
{
|
||||
(void)flags;
|
||||
}
|
||||
|
||||
static inline void local_irq_disable(void) {}
|
||||
static inline void local_irq_enable(void) {}
|
||||
static inline int in_interrupt(void) { return irqs_disabled(); }
|
||||
static inline int in_irq(void) { return irqs_disabled(); }
|
||||
|
||||
#define disable_irq_nosync(irq) ((void)(irq))
|
||||
#define enable_irq(irq) ((void)(irq))
|
||||
|
||||
@@ -11,12 +11,7 @@ extern void mutex_init(struct mutex *lock);
|
||||
extern void mutex_lock(struct mutex *lock);
|
||||
extern void mutex_unlock(struct mutex *lock);
|
||||
extern int mutex_is_locked(struct mutex *lock);
|
||||
|
||||
static inline int mutex_trylock(struct mutex *lock)
|
||||
{
|
||||
(void)lock;
|
||||
return 1;
|
||||
}
|
||||
extern int mutex_trylock(struct mutex *lock);
|
||||
|
||||
#define DEFINE_MUTEX(name) struct mutex name = { .__opaque = {0} }
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ struct pci_device_id {
|
||||
|
||||
struct pci_dev {
|
||||
u16 vendor;
|
||||
u16 device;
|
||||
u16 device_id;
|
||||
u8 bus_number;
|
||||
u8 dev_number;
|
||||
u8 func_number;
|
||||
@@ -33,7 +33,7 @@ struct pci_dev {
|
||||
u64 resource_start[6];
|
||||
u64 resource_len[6];
|
||||
void *driver_data;
|
||||
struct device device;
|
||||
struct device device_obj;
|
||||
};
|
||||
|
||||
struct pci_driver {
|
||||
|
||||
@@ -11,39 +11,13 @@ struct timer_list {
|
||||
unsigned char __opaque[64];
|
||||
};
|
||||
|
||||
static inline void setup_timer(struct timer_list *timer,
|
||||
void (*function)(unsigned long),
|
||||
unsigned long data)
|
||||
{
|
||||
timer->function = function;
|
||||
timer->data = data;
|
||||
timer->expires = 0;
|
||||
}
|
||||
|
||||
static inline int mod_timer(struct timer_list *timer, unsigned long expires)
|
||||
{
|
||||
(void)timer;
|
||||
(void)expires;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int del_timer(struct timer_list *timer)
|
||||
{
|
||||
(void)timer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int del_timer_sync(struct timer_list *timer)
|
||||
{
|
||||
(void)timer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int timer_pending(const struct timer_list *timer)
|
||||
{
|
||||
(void)timer;
|
||||
return 0;
|
||||
}
|
||||
extern void setup_timer(struct timer_list *timer,
|
||||
void (*function)(unsigned long),
|
||||
unsigned long data);
|
||||
extern int mod_timer(struct timer_list *timer, unsigned long expires);
|
||||
extern int del_timer(struct timer_list *timer);
|
||||
extern int del_timer_sync(struct timer_list *timer);
|
||||
extern int timer_pending(const struct timer_list *timer);
|
||||
|
||||
#define DEFINE_TIMER(_name, _function, _flags, _data) \
|
||||
struct timer_list _name = { .function = (_function), .data = (_data) }
|
||||
|
||||
Reference in New Issue
Block a user