Ignore:
Timestamp:
2013-02-09T23:14:45Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
22dfd38
Parents:
b5d2e57 (diff), 005b765 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Conflict resulting from bool.h → stdbool.h move and ddf structs turning opaque.
Fails to boot to shell console.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ops/shareout.c

    rb5d2e57 r03362fbd  
    11/*
    2  * Copyright (c) 2011 Martin Sucha
     2 * Copyright (c) 2012 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libext2
     29/** @addtogroup genericipc
    3030 * @{
    3131 */
    32 /**
    33  * @file
     32/** @file
    3433 */
    3534
    36 #ifndef LIBEXT2_LIBEXT2_BLOCK_GROUP_H_
    37 #define LIBEXT2_LIBEXT2_BLOCK_GROUP_H_
     35#include <ipc/sysipc_ops.h>
     36#include <ipc/ipc.h>
     37#include <mm/as.h>
     38#include <synch/spinlock.h>
     39#include <proc/task.h>
     40#include <syscall/copy.h>
     41#include <abi/errno.h>
     42#include <arch.h>
    3843
    39 #include <libblock.h>
     44static int request_preprocess(call_t *call, phone_t *phone)
     45{
     46        size_t size = as_area_get_size(IPC_GET_ARG1(call->data));
    4047
    41 typedef struct ext2_block_group {
    42         uint32_t block_bitmap_block; // Block ID for block bitmap
    43         uint32_t inode_bitmap_block; // Block ID for inode bitmap
    44         uint32_t inode_table_first_block; // Block ID of first block of inode table
    45         uint16_t free_block_count; // Count of free blocks
    46         uint16_t free_inode_count; // Count of free inodes
    47         uint16_t directory_inode_count; // Number of inodes allocated to directories
    48 } ext2_block_group_t;
     48        if (!size)
     49                return EPERM;
     50        IPC_SET_ARG2(call->data, size);
    4951
    50 typedef struct ext2_block_group_ref {
    51         block_t *block; // Reference to a block containing this block group descr
    52         ext2_block_group_t *block_group;
    53 } ext2_block_group_ref_t;
     52        return EOK;
     53}
    5454
    55 #define EXT2_BLOCK_GROUP_DESCRIPTOR_SIZE 32
     55static int answer_preprocess(call_t *answer, ipc_data_t *olddata)
     56{
     57        int rc = EOK;
    5658
    57 extern uint32_t ext2_block_group_get_block_bitmap_block(ext2_block_group_t *);
    58 extern uint32_t ext2_block_group_get_inode_bitmap_block(ext2_block_group_t *);
    59 extern uint32_t ext2_block_group_get_inode_table_first_block(ext2_block_group_t *);
    60 extern uint16_t ext2_block_group_get_free_block_count(ext2_block_group_t *);
    61 extern uint16_t ext2_block_group_get_free_inode_count(ext2_block_group_t *);
    62 extern uint16_t ext2_block_group_get_directory_inode_count(ext2_block_group_t *);
     59        if (!IPC_GET_RETVAL(answer->data)) {
     60                /* Accepted, handle as_area receipt */
    6361
    64 extern void     ext2_block_group_set_free_block_count(ext2_block_group_t *, uint16_t);
     62                irq_spinlock_lock(&answer->sender->lock, true);
     63                as_t *as = answer->sender->as;
     64                irq_spinlock_unlock(&answer->sender->lock, true);
    6565
    66 #endif
     66                uintptr_t dst_base = (uintptr_t) -1;
     67                rc = as_area_share(as, IPC_GET_ARG1(*olddata),
     68                    IPC_GET_ARG2(*olddata), AS, IPC_GET_ARG3(*olddata),
     69                    &dst_base, IPC_GET_ARG1(answer->data));
     70                       
     71                if (rc == EOK) {
     72                        rc = copy_to_uspace((void *) IPC_GET_ARG2(answer->data),
     73                            &dst_base, sizeof(dst_base));
     74                }
     75                       
     76                IPC_SET_RETVAL(answer->data, rc);
     77        }
     78
     79        return rc;
     80}
     81
     82sysipc_ops_t ipc_m_share_out_ops = {
     83        .request_preprocess = request_preprocess,
     84        .request_forget = null_request_forget,
     85        .request_process = null_request_process,
     86        .answer_cleanup = null_answer_cleanup,
     87        .answer_preprocess = answer_preprocess,
     88        .answer_process = null_answer_process,
     89};
    6790
    6891/** @}
Note: See TracChangeset for help on using the changeset viewer.