Changeset fd4d8c0 in mainline


Ignore:
Timestamp:
2006-05-25T21:21:58Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b31d188
Parents:
baafe71
Message:

Modify as_area_share() to accept destination area flags bitmask from the sender
(i.e. the sender can limit access mode to the shared area for the recipient).
Modify IPC_M_AS_AREA_SEND code to support this. Arguments for sender: arg1=as_area,
arg2=size, arg3=flags_mask.

The mechanism seems to work, but the page fault handlers need to be altered to
distinguish between faults under different access modes.

Location:
generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • generic/include/mm/as.h

    rbaafe71 rfd4d8c0  
    149149extern void as_switch(as_t *old, as_t *new);
    150150extern void as_free(as_t *as);
    151 extern int as_area_share(as_t *src_as, __address src_base, size_t acc_size, __address dst_base);
     151extern int as_area_share(as_t *src_as, __address src_base, size_t acc_size,
     152        __address dst_base, int dst_flags_mask);
    152153extern size_t as_get_size(__address base);
    153154extern int used_space_insert(as_area_t *a, __address page, count_t count);
  • generic/src/ipc/sysipc.c

    rbaafe71 rfd4d8c0  
    139139                        interrupts_restore(ipl);
    140140                       
    141                         return as_area_share(as, IPC_GET_ARG2(*olddata),IPC_GET_ARG3(*olddata),
    142                                 IPC_GET_ARG1(answer->data));
     141                        return as_area_share(as, IPC_GET_ARG1(*olddata), IPC_GET_ARG2(*olddata),
     142                                IPC_GET_ARG1(answer->data), IPC_GET_ARG3(*olddata));
    143143                }
    144144        }
     
    166166                break;
    167167        case IPC_M_AS_AREA_SEND:
    168                 size = as_get_size(IPC_GET_ARG2(call->data));
     168                size = as_get_size(IPC_GET_ARG1(call->data));
    169169                if (!size) {
    170170                        return EPERM;
    171171                }
    172                 IPC_SET_ARG3(call->data, size);
     172                IPC_SET_ARG2(call->data, size);
    173173                break;
    174174        default:
  • generic/src/mm/as.c

    rbaafe71 rfd4d8c0  
    459459 * sh_info of the source area.
    460460 *
    461  * @param src_as Pointer to source address space
     461 * @param src_as Pointer to source address space.
    462462 * @param src_base Base address of the source address space area.
    463  * @param acc_size Expected size of the source area
    464  * @param dst_base Target base address
     463 * @param acc_size Expected size of the source area.
     464 * @param dst_base Target base address.
     465 * @param dst_flags_mask Destination address space area flags mask.
    465466 *
    466467 * @return Zero on success or ENOENT if there is no such task or
     
    472473 */
    473474int as_area_share(as_t *src_as, __address src_base, size_t acc_size,
    474                   __address dst_base)
     475                  __address dst_base, int dst_flags_mask)
    475476{
    476477        ipl_t ipl;
     
    568569         * attribute set which prevents race condition with
    569570         * preliminary as_page_fault() calls.
    570          */
    571         dst_area = as_area_create(AS, src_flags, src_size, dst_base, AS_AREA_ATTR_PARTIAL, &anon_backend, NULL);
     571         * The flags of the source area are masked against dst_flags_mask
     572         * to support sharing in less privileged mode.
     573         */
     574        dst_area = as_area_create(AS, src_flags & dst_flags_mask, src_size, dst_base,
     575                                  AS_AREA_ATTR_PARTIAL, &anon_backend, NULL);
    572576        if (!dst_area) {
    573577                /*
Note: See TracChangeset for help on using the changeset viewer.