alarm: Make the debugging output useful
[akaros.git] / kern / include / linux_compat.h
index f8c5067..d4ca975 100644 (file)
 //#define CONFIG_INET 1        // will deal with this manually
 #define CONFIG_PCI_MSI 1
 
-#define __rcu
-#define rcu_read_lock()
-#define rcu_read_unlock()
-#define rcu_dereference(x) (x)
-#define rcu_dereference_protected(x, y) (x)
-#ifndef rcu_assign_pointer
-#define rcu_assign_pointer(dst, src) (dst) = (src)
-#endif
-#define RCU_INIT_POINTER(dst, src) rcu_assign_pointer(dst, src)
-#define synchronize_rcu()
-#define synchronize_sched()
+static inline void synchronize_sched(void)
+{
+       synchronize_rcu();
+}
 
 #define atomic_cmpxchg(_addr, _old, _new)                                      \
 ({                                                                             \
@@ -869,14 +862,14 @@ static inline int request_firmware(const struct firmware **fwp,
                                                                   struct device *ignored)
 {
        struct firmware *ret_fw;
-       struct file *fw_file;
+       struct file_or_chan *fw_file;
        void *fw_data;
        char dirname[] = "/lib/firmware/";
        /* could dynamically allocate the min of this and some MAX */
        char fullpath[sizeof(dirname) + strlen(file_name) + 1];
 
        snprintf(fullpath, sizeof(fullpath), "%s%s", dirname, file_name);
-       fw_file = do_file_open(fullpath, O_READ, 0);
+       fw_file = foc_open(fullpath, O_READ, 0);
        if (!fw_file) {
                printk("Unable to find firmware file %s!\n", fullpath);
                return -1;
@@ -884,14 +877,14 @@ static inline int request_firmware(const struct firmware **fwp,
        fw_data = kread_whole_file(fw_file);
        if (!fw_data) {
                printk("Unable to load firmware file %s!\n", fullpath);
-               kref_put(&fw_file->f_kref);
+               foc_decref(fw_file);
                return -1;
        }
        ret_fw = kmalloc(sizeof(struct firmware), MEM_WAIT);
        ret_fw->data = fw_data;
-       ret_fw->size = fw_file->f_dentry->d_inode->i_size;
+       ret_fw->size = foc_get_len(fw_file);
        *fwp = ret_fw;
-       kref_put(&fw_file->f_kref);
+       foc_decref(fw_file);
        return 0;
 }