/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to protocols/software.c

  • Committer: Suren A. Chilingaryan
  • Date: 2016-03-04 15:43:14 UTC
  • Revision ID: csa@suren.me-20160304154314-uor59rrkaw2hexm7
RPM generation

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
struct pcilib_software_register_bank_context_s {
22
22
    pcilib_register_bank_context_t bank_ctx;    /**< the bank context associated with the software registers */
23
23
    pcilib_kmem_handle_t *kmem;                 /**< the kernel memory for software registers */
24
 
    void *addr;                                 /**< the virtual adress of the allocated kernel memory*/
 
24
    volatile void *addr;                        /**< the virtual adress of the allocated kernel memory*/
25
25
};
26
26
 
27
27
void pcilib_software_registers_close(pcilib_t *ctx, pcilib_register_bank_context_t *bank_ctx) {
131
131
        return PCILIB_ERROR_INVALID_ADDRESS;
132
132
    }
133
133
 
134
 
    pcilib_datacpy(&val, ((pcilib_software_register_bank_context_t*)bank_ctx)->addr + addr, access, 1, b->raw_endianess);
 
134
    pcilib_datacpy(&val, (void*)((pcilib_software_register_bank_context_t*)bank_ctx)->addr + addr, access, 1, b->raw_endianess);
135
135
    *value = val;
136
136
 
137
137
    return 0;
147
147
    }
148
148
 
149
149
    // we consider this atomic operation and, therefore, do no locking
150
 
    pcilib_datacpy(((pcilib_software_register_bank_context_t*)bank_ctx)->addr + addr, &value, access, 1, b->raw_endianess);
 
150
    pcilib_datacpy((void*)((pcilib_software_register_bank_context_t*)bank_ctx)->addr + addr, &value, access, 1, b->raw_endianess);
151
151
 
152
152
    return 0;
153
153
}