Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dfs/dfs_v1/filesystems/iso9660/dfs_iso9660.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static int dfs_iso9660_close(struct dfs_file *fd)
return 0;
}

static int dfs_iso9660_read(struct dfs_file *fd, void *buf, size_t count)
static ssize_t dfs_iso9660_read(struct dfs_file *fd, void *buf, size_t count)
{
rt_uint32_t pos;
void *buf_ptr;
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>

static struct rt_spinlock _clk_lock = { 0 };
static RT_DEFINE_SPINLOCK(_clk_lock);
static rt_list_t _clk_nodes = RT_LIST_OBJECT_INIT(_clk_nodes);
static rt_list_t _clk_notifier_nodes = RT_LIST_OBJECT_INIT(_clk_notifier_nodes);

Expand Down
2 changes: 1 addition & 1 deletion components/drivers/core/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ rt_err_t rt_device_bus_destroy(rt_device_t dev)
#ifdef RT_USING_DM
#include <drivers/core/bus.h>

static struct rt_spinlock bus_lock = {};
static RT_DEFINE_SPINLOCK(bus_lock);
static rt_list_t bus_nodes = RT_LIST_OBJECT_INIT(bus_nodes);

static void _dm_bus_lock(struct rt_spinlock *spinlock)
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/core/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ struct prefix_track
int uid;
const char *prefix;
};
static struct rt_spinlock _prefix_nodes_lock = { 0 };
static RT_DEFINE_SPINLOCK(_prefix_nodes_lock);
static rt_list_t _prefix_nodes = RT_LIST_OBJECT_INIT(_prefix_nodes);

int rt_dm_dev_set_name_auto(rt_device_t dev, const char *prefix)
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/dma/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <rtdbg.h>

static rt_list_t dmac_nodes = RT_LIST_OBJECT_INIT(dmac_nodes);
static struct rt_spinlock dmac_nodes_lock = {};
static RT_DEFINE_SPINLOCK(dmac_nodes_lock);

rt_err_t rt_dma_controller_register(struct rt_dma_controller *ctrl)
{
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/dma/dma_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <mm_aspace.h>
#include <dt-bindings/size.h>

static struct rt_spinlock dma_pools_lock = {};
static RT_DEFINE_SPINLOCK(dma_pools_lock);
static rt_list_t dma_pool_nodes = RT_LIST_OBJECT_INIT(dma_pool_nodes);

static struct rt_dma_pool *dma_pool_install(rt_region_t *region);
Expand Down
5 changes: 5 additions & 0 deletions components/drivers/include/drivers/core/dm.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ struct rt_dm_ida
};

#define RT_DM_IDA_INIT(id) { .master_id = MASTER_ID_##id }
#define rt_dm_ida_init(ida, id) \
do { \
(ida)->master_id = MASTER_ID_##id; \
rt_spin_lock_init(&(ida)->lock); \
} while (0)

int rt_dm_ida_alloc(struct rt_dm_ida *ida);
rt_bool_t rt_dm_ida_take(struct rt_dm_ida *ida, int id);
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/include/drivers/dev_pin.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct rt_device_pin
const struct rt_pin_ops *ops;
};

#define PIN_NONE (-1)
#define PIN_NONE (-RT_EEMPTY)

#define PIN_LOW 0x00 /*!< low level */
#define PIN_HIGH 0x01 /*!< high level */
Expand Down
4 changes: 2 additions & 2 deletions components/drivers/include/drivers/led.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ struct rt_led_ops
rt_err_t (*set_brightness)(struct rt_led_device *led, rt_uint32_t brightness);
};

rt_err_t rt_hw_led_register(struct rt_led_device *led);
rt_err_t rt_hw_led_unregister(struct rt_led_device *led);
rt_err_t rt_led_register(struct rt_led_device *led);
rt_err_t rt_led_unregister(struct rt_led_device *led);

rt_err_t rt_led_set_state(struct rt_led_device *led, enum rt_led_state state);
rt_err_t rt_led_get_state(struct rt_led_device *led, enum rt_led_state *out_state);
Expand Down
6 changes: 3 additions & 3 deletions components/drivers/led/led-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct gpio_led
rt_uint8_t active_val;
};

#define raw_to_gpio_led(raw) rt_container_of(raw, struct gpio_led, parent);
#define raw_to_gpio_led(raw) rt_container_of(raw, struct gpio_led, parent)

static rt_err_t gpio_led_set_state(struct rt_led_device *led, enum rt_led_state state)
{
Expand Down Expand Up @@ -108,7 +108,7 @@ static rt_err_t ofw_append_gpio_led(struct rt_ofw_node *np)

gled->parent.ops = &gpio_led_ops;

if ((err = rt_hw_led_register(&gled->parent)))
if ((err = rt_led_register(&gled->parent)))
{
goto _fail;
}
Expand Down Expand Up @@ -203,7 +203,7 @@ static rt_err_t gpio_led_remove(struct rt_platform_device *pdev)

rt_ofw_data(led_np) = RT_NULL;

rt_hw_led_unregister(&gled->parent);
rt_led_unregister(&gled->parent);

rt_free(gled);
}
Expand Down
4 changes: 2 additions & 2 deletions components/drivers/led/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void _led_blink_timerout(void *param)
btimer->toggle = !btimer->toggle;
}

rt_err_t rt_hw_led_register(struct rt_led_device *led)
rt_err_t rt_led_register(struct rt_led_device *led)
{
rt_err_t err;
int device_id;
Expand Down Expand Up @@ -193,7 +193,7 @@ rt_err_t rt_hw_led_register(struct rt_led_device *led)
return err;
}

rt_err_t rt_hw_led_unregister(struct rt_led_device *led)
rt_err_t rt_led_unregister(struct rt_led_device *led)
{
if (!led)
{
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/mailbox/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <drivers/platform.h>
#include <drivers/core/dm.h>

static struct rt_spinlock mbox_ops_lock = {};
static RT_DEFINE_SPINLOCK(mbox_ops_lock);
static rt_list_t mbox_nodes = RT_LIST_OBJECT_INIT(mbox_nodes);

static void mbox_chan_timeout(void *param);
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/mfd/mfd-syscon.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <drivers/core/dm.h>
#include <drivers/platform.h>

static struct rt_spinlock _syscon_nodes_lock = { 0 };
static RT_DEFINE_SPINLOCK(_syscon_nodes_lock);
static rt_list_t _syscon_nodes = RT_LIST_OBJECT_INIT(_syscon_nodes);

rt_err_t rt_syscon_read(struct rt_syscon *syscon, rt_off_t offset, rt_uint32_t *out_val)
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/nvme/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
static struct rt_dm_ida nvme_controller_ida = RT_DM_IDA_INIT(CUSTOM);
static struct rt_dm_ida nvme_ida = RT_DM_IDA_INIT(NVME);

static struct rt_spinlock nvme_lock = {};
static RT_DEFINE_SPINLOCK(nvme_lock);
static rt_list_t nvme_nodes = RT_LIST_OBJECT_INIT(nvme_nodes);

rt_inline rt_uint32_t nvme_readl(struct rt_nvme_controller *nvme, int offset)
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/ofw/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ rt_err_t ofw_phandle_hash_reset(rt_phandle min, rt_phandle max)
static rt_phandle ofw_phandle_next(void)
{
rt_phandle next;
static struct rt_spinlock op_lock = {};
static RT_DEFINE_SPINLOCK(op_lock);

rt_hw_spin_lock(&op_lock.lock);

Expand Down
2 changes: 1 addition & 1 deletion components/drivers/pci/endpoint/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <rtdbg.h>

static rt_list_t _ep_nodes = RT_LIST_OBJECT_INIT(_ep_nodes);
static struct rt_spinlock _ep_lock = { 0 };
static RT_DEFINE_SPINLOCK(_ep_lock);

rt_err_t rt_pci_ep_write_header(struct rt_pci_ep *ep, rt_uint8_t func_no,
struct rt_pci_ep_header *hdr)
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/pci/msi/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>

static struct rt_spinlock msi_irq_map_lock = {};
static RT_DEFINE_SPINLOCK(msi_irq_map_lock);
static RT_BITMAP_DECLARE(msi_irq_map, MAX_HANDLERS) = {};

rt_err_t rt_pci_msi_setup_irqs(struct rt_pci_device *pdev, int nvec, int type)
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/pic/pic-gic-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ rt_err_t gic_common_configure_irq(void *base, int irq, rt_uint32_t mode, void (*
rt_uint32_t val, oldval;
rt_uint32_t confoff = (irq / 16) * 4;
rt_uint32_t confmask = 0x2 << ((irq % 16) * 2);
static struct rt_spinlock ic_lock = { 0 };
static RT_DEFINE_SPINLOCK(ic_lock);

level = rt_spin_lock_irqsave(&ic_lock);

Expand Down
2 changes: 1 addition & 1 deletion components/drivers/pic/pic-gicv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static rt_err_t gicv2_irq_set_affinity(struct rt_pic_irq *pirq, rt_bitmap_t *aff
rt_uint32_t val;
rt_ubase_t level;
rt_ubase_t offset = (rt_ubase_t)io_addr & 3UL, shift = offset * 8;
static struct rt_spinlock rmw_lock = {};
static RT_DEFINE_SPINLOCK(rmw_lock);

level = rt_spin_lock_irqsave(&rmw_lock);

Expand Down
3 changes: 2 additions & 1 deletion components/drivers/pic/pic-gicv3-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ static rt_uint32_t lpi_id_bits;
static void *lpi_table;
static void *lpi_pending_table;
static rt_bitmap_t *lpis_vectors = RT_NULL;
static struct rt_spinlock lpis_lock = {}, map_lock = {};
static RT_DEFINE_SPINLOCK(lpis_lock);
static RT_DEFINE_SPINLOCK(map_lock);
static rt_list_t its_nodes = RT_LIST_OBJECT_INIT(its_nodes);
static rt_list_t map_nodes = RT_LIST_OBJECT_INIT(map_nodes);

Expand Down
2 changes: 1 addition & 1 deletion components/drivers/pic/pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static struct rt_pic_irq _pirq_hash[MAX_HANDLERS] =
}
};

static struct rt_spinlock _pic_lock = { };
static RT_DEFINE_SPINLOCK(_pic_lock);
static rt_size_t _pic_name_max = sizeof("PIC");
static rt_list_t _pic_nodes = RT_LIST_OBJECT_INIT(_pic_nodes);
static rt_list_t _traps_nodes = RT_LIST_OBJECT_INIT(_traps_nodes);
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/pin/dev_pin_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "dev_pin_dm.h"

static rt_size_t pin_total_nr = 0;
static struct rt_spinlock pin_lock = {};
static RT_DEFINE_SPINLOCK(pin_lock);
static rt_list_t pin_nodes = RT_LIST_OBJECT_INIT(pin_nodes);

static struct rt_device_pin *pin_device_find(rt_ubase_t pin)
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/regulator/regulator-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static rt_err_t regulator_gpio_probe(struct rt_platform_device *pdev)
/* GPIO flags are ignored, we check by enable-active-high */
rg->enable_pin = rt_pin_get_named_pin(dev, "enable", 0, RT_NULL, RT_NULL);

if (rg->enable_pin < 0 && rg->enable_pin != -RT_EEMPTY)
if (rg->enable_pin < 0 && rg->enable_pin != PIN_NONE)
{
err = rg->enable_pin;
goto _fail;
Expand Down
2 changes: 1 addition & 1 deletion components/drivers/regulator/regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct rt_regulator
struct rt_regulator_node *reg_np;
};

static struct rt_spinlock _regulator_lock = { 0 };
static RT_DEFINE_SPINLOCK(_regulator_lock);

static rt_err_t regulator_enable(struct rt_regulator_node *reg_np);
static rt_err_t regulator_disable(struct rt_regulator_node *reg_np);
Expand Down
6 changes: 1 addition & 5 deletions components/drivers/thermal/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define device_list(dev) (dev)->parent.parent.list
#define device_foreach(dev, nodes) rt_list_for_each_entry(dev, nodes, parent.parent.list)

static struct rt_spinlock nodes_lock = {};
static RT_DEFINE_SPINLOCK(nodes_lock);
static rt_list_t thermal_zone_device_nodes = RT_LIST_OBJECT_INIT(thermal_zone_device_nodes);
static rt_list_t thermal_cooling_device_nodes = RT_LIST_OBJECT_INIT(thermal_cooling_device_nodes);
static rt_list_t thermal_cooling_governor_nodes = RT_LIST_OBJECT_INIT(thermal_cooling_governor_nodes);
Expand Down Expand Up @@ -638,10 +638,6 @@ void rt_thermal_zone_device_update(struct rt_thermal_zone_device *zdev, rt_ubase
int trip_low;
rt_bool_t low_set = RT_FALSE;

if (i >= zdev->trips_nr)
{
goto _call_notifier;
}
rt_memcpy(&trip, &zdev->trips[i], sizeof(trip));

trip_low = trip.temperature - trip.hysteresis;
Expand Down
2 changes: 1 addition & 1 deletion libcpu/aarch64/cortex-a/entry_point.S
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
/*
* Our goal is to boot the rt-thread as possible without modifying the
* bootloader's config, so we use the kernel's boot header for ARM64:
* https://www.kernel.org/doc/html/latest/arm64/booting.html#call-the-kernel-image
* https://www.kernel.org/doc/html/latest/arch/arm64/booting.html#call-the-kernel-image
*/
_head:
b _start /* Executable code */
Expand Down
Loading