sync with OpenBSD -current
This commit is contained in:
parent
38dbdec412
commit
933c153850
49 changed files with 931 additions and 4156 deletions
|
@ -11,24 +11,32 @@ struct device;
|
|||
|
||||
struct backlight_properties {
|
||||
int type;
|
||||
#define BACKLIGHT_RAW 0
|
||||
#define BACKLIGHT_FIRMWARE 1
|
||||
#define BACKLIGHT_PLATFORM 2
|
||||
int max_brightness;
|
||||
int brightness;
|
||||
int power;
|
||||
int scale;
|
||||
#define BACKLIGHT_SCALE_LINEAR 0
|
||||
int state;
|
||||
#define BL_CORE_SUSPENDED 0x00000001
|
||||
};
|
||||
|
||||
struct backlight_ops {
|
||||
int options;
|
||||
#define BL_CORE_SUSPENDRESUME 0x00000001
|
||||
int (*update_status)(struct backlight_device *);
|
||||
int (*get_brightness)(struct backlight_device *);
|
||||
};
|
||||
|
||||
#define BL_CORE_SUSPENDRESUME 1
|
||||
|
||||
struct backlight_device {
|
||||
const struct backlight_ops *ops;
|
||||
struct backlight_properties props;
|
||||
struct task task;
|
||||
void *data;
|
||||
SLIST_ENTRY(backlight_device) next;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
static inline void *
|
||||
|
@ -37,18 +45,25 @@ bl_get_data(struct backlight_device *bd)
|
|||
return bd->data;
|
||||
}
|
||||
|
||||
#define BACKLIGHT_RAW 0
|
||||
#define BACKLIGHT_FIRMWARE 1
|
||||
static inline int
|
||||
backlight_get_brightness(struct backlight_device *bd)
|
||||
{
|
||||
return bd->props.brightness;
|
||||
}
|
||||
|
||||
#define BACKLIGHT_UPDATE_HOTKEY 0
|
||||
|
||||
struct backlight_device *backlight_device_register(const char *, void *,
|
||||
void *, const struct backlight_ops *, struct backlight_properties *);
|
||||
void *, const struct backlight_ops *, const struct backlight_properties *);
|
||||
void backlight_device_unregister(struct backlight_device *);
|
||||
|
||||
struct backlight_device *devm_backlight_device_register(void *, const char *,
|
||||
void *, void *, const struct backlight_ops *,
|
||||
const struct backlight_properties *);
|
||||
static inline struct backlight_device *
|
||||
devm_backlight_device_register(void *dev, const char *name, void *parent,
|
||||
void *data, const struct backlight_ops *bo,
|
||||
const struct backlight_properties *bp)
|
||||
{
|
||||
return backlight_device_register(name, dev, data, bo, bp);
|
||||
}
|
||||
|
||||
static inline void
|
||||
backlight_update_status(struct backlight_device *bd)
|
||||
|
@ -82,10 +97,6 @@ devm_of_find_backlight(struct device *dev)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct backlight_device *
|
||||
backlight_device_get_by_name(const char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
struct backlight_device *backlight_device_get_by_name(const char *);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
struct device_node;
|
||||
|
||||
struct bus_type {
|
||||
};
|
||||
|
||||
struct device_driver {
|
||||
struct device *dev;
|
||||
};
|
||||
|
@ -33,12 +36,13 @@ struct device_attribute {
|
|||
#define device_create_file(a, b) 0
|
||||
#define device_remove_file(a, b)
|
||||
|
||||
#define dev_get_drvdata(x) NULL
|
||||
#define dev_set_drvdata(x, y)
|
||||
void *dev_get_drvdata(struct device *);
|
||||
void dev_set_drvdata(struct device *, void *);
|
||||
|
||||
#define dev_pm_set_driver_flags(x, y)
|
||||
|
||||
#define devm_kzalloc(x, y, z) kzalloc(y, z)
|
||||
#define devm_kfree(x, y) kfree(y)
|
||||
|
||||
#define dev_warn(dev, fmt, arg...) \
|
||||
printf("drm:pid%d:%s *WARNING* " fmt, curproc->p_p->ps_pid, \
|
||||
|
@ -78,6 +82,10 @@ struct device_attribute {
|
|||
#define dev_err_once(dev, fmt, arg...) \
|
||||
printf("drm:pid%d:%s *ERROR* " fmt, curproc->p_p->ps_pid, \
|
||||
__func__ , ## arg)
|
||||
|
||||
#define dev_err_probe(dev, err, fmt, arg...) \
|
||||
printf("drm:pid%d:%s *ERROR* " fmt, curproc->p_p->ps_pid, \
|
||||
__func__ , ## arg), err
|
||||
|
||||
#ifdef DRMDEBUG
|
||||
#define dev_info(dev, fmt, arg...) \
|
||||
|
|
|
@ -169,6 +169,9 @@ iowrite64(u64 val, volatile void __iomem *addr)
|
|||
#define readq(p) ioread64(p)
|
||||
#define writeq(v, p) iowrite64(v, p)
|
||||
|
||||
#define readl_relaxed(p) readl(p)
|
||||
#define writel_relaxed(v, p) writel(v, p)
|
||||
|
||||
int drm_mtrr_add(unsigned long, size_t, int);
|
||||
int drm_mtrr_del(int, unsigned long, size_t, int);
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define IORESOURCE_MEM 0x0001
|
||||
|
||||
struct resource {
|
||||
u_long start;
|
||||
u_long end;
|
||||
|
|
|
@ -40,7 +40,12 @@ jiffies_to_nsecs(const unsigned long x)
|
|||
#define usecs_to_jiffies(x) (((uint64_t)(x)) * hz / 1000000)
|
||||
#define nsecs_to_jiffies(x) (((uint64_t)(x)) * hz / 1000000000)
|
||||
#define nsecs_to_jiffies64(x) (((uint64_t)(x)) * hz / 1000000000)
|
||||
#define get_jiffies_64() jiffies
|
||||
|
||||
static inline uint64_t
|
||||
get_jiffies_64(void)
|
||||
{
|
||||
return jiffies;
|
||||
}
|
||||
|
||||
static inline int
|
||||
time_after(const unsigned long a, const unsigned long b)
|
||||
|
@ -55,6 +60,12 @@ time_after_eq(const unsigned long a, const unsigned long b)
|
|||
return((long)(b - a) <= 0);
|
||||
}
|
||||
|
||||
static inline int
|
||||
time_after_eq64(const unsigned long long a, const unsigned long long b)
|
||||
{
|
||||
return((long long)(b - a) <= 0);
|
||||
}
|
||||
|
||||
#define time_after32(a,b) ((int32_t)((uint32_t)(b) - (uint32_t)(a)) < 0)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -149,4 +149,6 @@ _in_dbg_master(void)
|
|||
|
||||
#define STUB() do { printf("%s: stub\n", __func__); } while(0)
|
||||
|
||||
#define CONCATENATE(x, y) __CONCAT(x, y)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: pci.h,v 1.14 2023/09/13 12:31:49 jsg Exp $ */
|
||||
/* $OpenBSD: pci.h,v 1.15 2023/12/23 14:18:27 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2015 Mark Kettenis
|
||||
*
|
||||
|
@ -482,6 +482,14 @@ pci_set_power_state(struct pci_dev *dev, int state)
|
|||
return 0;
|
||||
}
|
||||
|
||||
struct pci_driver;
|
||||
|
||||
static inline int
|
||||
pci_register_driver(struct pci_driver *pci_drv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
pci_unregister_driver(void *d)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ typedef uint32_t __be32;
|
|||
typedef uint64_t __le64;
|
||||
typedef uint64_t __be64;
|
||||
|
||||
typedef bus_addr_t dma_addr_t;
|
||||
typedef uint64_t dma_addr_t;
|
||||
typedef paddr_t phys_addr_t;
|
||||
typedef paddr_t resource_size_t;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue