Giter Club home page Giter Club logo

Comments (3)

chyh1990 avatar chyh1990 commented on August 17, 2024

I change the sem_id base to a large integer.
Originally, sem_id started from 0 is a problem

from ucore_os_plus.

eternalNight avatar eternalNight commented on August 17, 2024

If so, this may not be an issue on arm as it's sem_id is the 64-bit representation of the required in pattern "0x07......". But the sem_id on i386 still looks strange to me.

BTW, what's the problem caused by sem_id starting from 0?

from ucore_os_plus.

chyh1990 avatar chyh1990 commented on August 17, 2024

#define VALID_SEMID(sem_id)
((uintptr_t)(sem_id) < (uintptr_t)(sem_id) + PBASE)

#define semid2sem(sem_id)
((semaphore_t *)((uintptr_t)(sem_id) + PBASE))

#define sem2semid(sem)
((sem_t)((uintptr_t)(sem) - PBASE))

/* This must NOT be 0 */
#define PBASE (KERNBASE+0x100)

on some platforms, KERNBASE may be 0, so i add 0x100 to it

On Sun, Sep 9, 2012 at 12:21 PM, Mao Junjie [email protected]:

If so, this may not be an issue on arm as it's sem_id is the 64-bit
representation of the required in pattern "0x07......". But the sem_id on
i386 still looks strange to me.

BTW, what's the problem caused by sem_id starting from 0?


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-8400567.

Chen Yuheng
Computer Science
Tsinghua University

from ucore_os_plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.