Ignore:
Timestamp:
2013-12-31T02:50:45Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1ee46f
Parents:
208b5f5
Message:

libdrv: Make driver ops structures constant

These are statically initialized and we don't modify them.
Moves cca 1KB (30%) of data from .data (rw) section to ro. (driver binaries, amd64)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_ahci.c

    r208b5f5 r9be30cdf  
    3636#include <errno.h>
    3737#include <stdio.h>
     38#include <macros.h>
    3839#include "ahci_iface.h"
    3940#include "ddf/driver.h"
     
    6566
    6667/** Remote AHCI interface operations. */
    67 static remote_iface_func_ptr_t remote_ahci_iface_ops [] = {
     68static const remote_iface_func_ptr_t remote_ahci_iface_ops [] = {
    6869        [IPC_M_AHCI_GET_SATA_DEVICE_NAME] = remote_ahci_get_sata_device_name,
    6970        [IPC_M_AHCI_GET_NUM_BLOCKS] = remote_ahci_get_num_blocks,
     
    7677 */
    7778remote_iface_t remote_ahci_iface = {
    78         .method_count = sizeof(remote_ahci_iface_ops) /
    79             sizeof(remote_ahci_iface_ops[0]),
     79        .method_count = ARRAY_SIZE(remote_ahci_iface_ops),
    8080        .methods = remote_ahci_iface_ops
    8181};
Note: See TracChangeset for help on using the changeset viewer.